libDXF 0.0.1
A library with DXF related functions written in C.
Functions

shape.c File Reference

Functions for a DXF shape entity (SHAPE). More...

#include "shape.h"
Include dependency graph for shape.c:

Go to the source code of this file.

Functions

DxfShapedxf_shape_new ()
 Allocate memory for a DxfShape.
DxfShapedxf_shape_init (DxfShape *shape)
 Allocate memory and initialize data fields in a SHAPE entity to default values.
DxfShapedxf_shape_read (DxfFile *fp, DxfShape *shape)
 Read data from a DXF file into a SHAPE entity.
int dxf_shape_write (DxfFile *fp, DxfShape *shape)
 Write DXF output for a DXF SHAPE entity.
int dxf_shape_free (DxfShape *shape)
 Free the allocated memory for a DXF SHAPE and all it's data fields.
void dxf_shape_free_chain (DxfShape *shapes)
 Free the allocated memory for a chain of DXF SHAPE entities and all their data fields.
int dxf_shape_get_id_code (DxfShape *shape)
 Get the id_code from a DXF SHAPE entity.
DxfShapedxf_shape_set_id_code (DxfShape *shape, int id_code)
 Set the id_code for a DXF SHAPE entity.
char * dxf_shape_get_linetype (DxfShape *shape)
 Get the linetype from a DXF SHAPE entity.
DxfShapedxf_shape_set_linetype (DxfShape *shape, char *linetype)
 Set the linetype for a DXF SHAPE entity.
char * dxf_shape_get_layer (DxfShape *shape)
 Get the layer from a DXF SHAPE entity.
DxfShapedxf_shape_set_layer (DxfShape *shape, char *layer)
 Set the layer for a DXF SHAPE entity.
double dxf_shape_get_elevation (DxfShape *shape)
 Get the elevation from a DXF SHAPE entity.
DxfShapedxf_shape_set_elevation (DxfShape *shape, double elevation)
 Set the elevation for a DXF SHAPE entity.
double dxf_shape_get_thickness (DxfShape *shape)
 Get the thickness from a DXF SHAPE entity.
DxfShapedxf_shape_set_thickness (DxfShape *shape, double thickness)
 Set the thickness for a DXF SHAPE entity.
double dxf_shape_get_linetype_scale (DxfShape *shape)
 Get the linetype_scale from a DXF SHAPE entity.
DxfShapedxf_shape_set_linetype_scale (DxfShape *shape, double linetype_scale)
 Set the linetype_scale for a DXF SHAPE entity.
int16_t dxf_shape_get_visibility (DxfShape *shape)
 Get the visibility from a DXF SHAPE entity.
DxfShapedxf_shape_set_visibility (DxfShape *shape, int16_t visibility)
 Set the visibility for a DXF SHAPE entity.
int dxf_shape_get_color (DxfShape *shape)
 Get the color from a DXF SHAPE entity.
DxfShapedxf_shape_set_color (DxfShape *shape, int color)
 Set the color for a DXF SHAPE entity.
int dxf_shape_get_paperspace (DxfShape *shape)
 Get the paperspace flag value from a DXF SHAPE entity.
DxfShapedxf_shape_set_paperspace (DxfShape *shape, int paperspace)
 Set the paperspace flag for a DXF SHAPE entity.
int dxf_shape_get_graphics_data_size (DxfShape *shape)
 Get the graphics_data_size value from a DXF SHAPE entity.
DxfShapedxf_shape_set_graphics_data_size (DxfShape *shape, int graphics_data_size)
 Set the graphics_data_size value for a DXF SHAPE entity.
int16_t dxf_shape_get_shadow_mode (DxfShape *shape)
 Get the shadow_mode from a DXF SHAPE entity.
DxfShapedxf_shape_set_shadow_mode (DxfShape *shape, int16_t shadow_mode)
 Set the shadow_mode for a DXF SHAPE entity.
DxfBinaryGraphicsDatadxf_shape_get_binary_graphics_data (DxfShape *shape)
 Get the pointer to the binary_graphics_data from a DXF SHAPE entity.
DxfShapedxf_shape_set_binary_graphics_data (DxfShape *shape, DxfBinaryGraphicsData *data)
 Set the pointer to the binary_graphics_data for a DXF SHAPE entity.
char * dxf_shape_get_dictionary_owner_soft (DxfShape *shape)
 Get the pointer to the dictionary_owner_soft from a DXF SHAPE entity.
DxfShapedxf_shape_set_dictionary_owner_soft (DxfShape *shape, char *dictionary_owner_soft)
 Set the pointer to the dictionary_owner_soft for a DXF SHAPE entity.
char * dxf_shape_get_material (DxfShape *shape)
 Get the pointer to the material from a DXF SHAPE entity.
DxfShapedxf_shape_set_material (DxfShape *shape, char *material)
 Set the pointer to the material for a DXF SHAPE entity.
char * dxf_shape_get_dictionary_owner_hard (DxfShape *shape)
 Get the pointer to the dictionary_owner_hard from a DXF SHAPE entity.
DxfShapedxf_shape_set_dictionary_owner_hard (DxfShape *shape, char *dictionary_owner_hard)
 Set the pointer to the dictionary_owner_hard for a DXF SHAPE entity.
int16_t dxf_shape_get_lineweight (DxfShape *shape)
 Get the lineweight from a DXF SHAPE entity.
DxfShapedxf_shape_set_lineweight (DxfShape *shape, int16_t lineweight)
 Set the lineweight for a DXF SHAPE entity.
char * dxf_shape_get_plot_style_name (DxfShape *shape)
 Get the plot_style_name from a DXF SHAPE entity.
DxfShapedxf_shape_set_plot_style_name (DxfShape *shape, char *plot_style_name)
 Set the plot_style_name for a DXF SHAPE entity.
long dxf_shape_get_color_value (DxfShape *shape)
 Get the color_value from a DXF SHAPE entity.
DxfShapedxf_shape_set_color_value (DxfShape *shape, long color_value)
 Set the color_value for a DXF SHAPE entity.
char * dxf_shape_get_color_name (DxfShape *shape)
 Get the color_name from a DXF SHAPE entity.
DxfShapedxf_shape_set_color_name (DxfShape *shape, char *color_name)
 Set the color_name for a DXF SHAPE entity.
long dxf_shape_get_transparency (DxfShape *shape)
 Get the transparency from a DXF SHAPE entity.
DxfShapedxf_shape_set_transparency (DxfShape *shape, long transparency)
 Set the transparency for a DXF SHAPE entity.
DxfPointdxf_shape_get_p0 (DxfShape *shape)
 Get the insertion point p0 of a DXF SHAPE entity.
DxfShapedxf_shape_set_p0 (DxfShape *shape, DxfPoint *p0)
 Set the insertion point p0 of a DXF SHAPE entity.
double dxf_shape_get_x0 (DxfShape *shape)
 Get the X-value of the insertion point x0 of a DXF SHAPE entity.
DxfShapedxf_shape_set_x0 (DxfShape *shape, double x0)
 Set the X-value of the insertion point x0 of a DXF SHAPE entity.
double dxf_shape_get_y0 (DxfShape *shape)
 Get the Y-value of the insertion point y0 of a DXF SHAPE entity.
DxfShapedxf_shape_set_y0 (DxfShape *shape, double y0)
 Set the Y-value of the insertion point y0 of a DXF SHAPE entity.
double dxf_shape_get_z0 (DxfShape *shape)
 Get the Z-value of the insertion point z0 of a DXF SHAPE entity.
DxfShapedxf_shape_set_z0 (DxfShape *shape, double z0)
 Set the Z-value of the insertion point z0 of a DXF SHAPE entity.
double dxf_shape_get_size (DxfShape *shape)
 Get the size of a DXF SHAPE entity.
DxfShapedxf_shape_set_size (DxfShape *shape, double size)
 Set the size of a DXF SHAPE entity.
double dxf_shape_get_rel_x_scale (DxfShape *shape)
 Get the rel_x_scale of a DXF SHAPE entity.
DxfShapedxf_shape_set_rel_x_scale (DxfShape *shape, double rel_x_scale)
 Set the rel_x_scale of a DXF SHAPE entity.
double dxf_shape_get_rot_angle (DxfShape *shape)
 Get the rot_angle of a DXF SHAPE entity.
DxfShapedxf_shape_set_rot_angle (DxfShape *shape, double rot_angle)
 Set the rot_angle of a DXF SHAPE entity.
double dxf_shape_get_obl_angle (DxfShape *shape)
 Get the obl_angle of a DXF SHAPE entity.
DxfShapedxf_shape_set_obl_angle (DxfShape *shape, double obl_angle)
 Set the obl_angle of a DXF SHAPE entity.
double dxf_shape_get_extr_x0 (DxfShape *shape)
 Get the X-value of the extrusion vector extr_x0 of a DXF SHAPE entity.
DxfShapedxf_shape_set_extr_x0 (DxfShape *shape, double extr_x0)
 Set the X-value of the extrusion vector extr_x0 of a DXF SHAPE entity.
double dxf_shape_get_extr_y0 (DxfShape *shape)
 Get the Y-value of the extrusion vector extr_y0 of a DXF SHAPE entity.
DxfShapedxf_shape_set_extr_y0 (DxfShape *shape, double extr_y0)
 Set the Y-value of the extrusion vector extr_y0 of a DXF SHAPE entity.
double dxf_shape_get_extr_z0 (DxfShape *shape)
 Get the Z-value of the extrusion vector extr_z0 of a DXF SHAPE entity.
DxfShapedxf_shape_set_extr_z0 (DxfShape *shape, double extr_z0)
 Set the Z-value of the extrusion vector extr_z0 of a DXF SHAPE entity.
DxfShapedxf_shape_get_next (DxfShape *shape)
 Get the pointer to the next SHAPE entity from a DXF SHAPE entity.
DxfShapedxf_shape_set_next (DxfShape *shape, DxfShape *next)
 Set the pointer to the next SHAPE for a DXF SHAPE entity.
DxfShapedxf_shape_get_last (DxfShape *shape)
 Get the pointer to the last SHAPE entity from a linked list of DXF SHAPE entities.

Detailed Description

Functions for a DXF shape entity (SHAPE).

Author:
Copyright (C) 2008, 2010, 2012, 2014, 2015, 2017 by Bert Timmerman <bert.timmerman@xs4all.nl>.
Copyright (C) 2010 by Luis Matos <gass@otiliamatos.ath.cx>.
Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.

Copyright Notices.


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to:
Free Software Foundation, Inc.,
59 Temple Place,
Suite 330,
Boston,
MA 02111 USA.

Drawing eXchange Format (DXF) is a defacto industry standard for the exchange of drawing files between various Computer Aided Drafting programs.
DXF is an industry standard designed by Autodesk(TM).
For more details see http://www.autodesk.com .


Definition in file shape.c.


Function Documentation

DxfShape* dxf_shape_new ( )

Allocate memory for a DxfShape.

Fill the memory contents with zeros.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.

Definition at line 56 of file shape.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_shape_init(), and dxf_shape_read().

DxfShape* dxf_shape_init ( DxfShape shape)

Allocate memory and initialize data fields in a SHAPE entity to default values.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Parameters:
shapea pointer to the DXF SHAPE entity.

Definition at line 94 of file shape.c.

References _, dxf_shape_struct::binary_graphics_data, dxf_shape_struct::color, dxf_shape_struct::color_name, dxf_shape_struct::color_value, dxf_shape_struct::dictionary_owner_hard, dxf_shape_struct::dictionary_owner_soft, dxf_binary_graphics_data_init(), dxf_binary_graphics_data_new(), DXF_COLOR_BYLAYER, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, DXF_DEFAULT_LINETYPE_SCALE, DXF_DEFAULT_VISIBILITY, DXF_MODELSPACE, dxf_shape_new(), dxf_shape_struct::elevation, dxf_shape_struct::extr_x0, dxf_shape_struct::extr_y0, dxf_shape_struct::extr_z0, dxf_shape_struct::graphics_data_size, dxf_shape_struct::id_code, dxf_shape_struct::layer, dxf_shape_struct::linetype, dxf_shape_struct::linetype_scale, dxf_shape_struct::lineweight, dxf_shape_struct::material, dxf_shape_struct::next, dxf_shape_struct::obl_angle, dxf_shape_struct::p0, dxf_shape_struct::paperspace, dxf_shape_struct::plot_style_name, dxf_shape_struct::rel_x_scale, dxf_shape_struct::rot_angle, dxf_shape_struct::shadow_mode, dxf_shape_struct::shape_name, dxf_shape_struct::size, dxf_shape_struct::thickness, dxf_shape_struct::transparency, dxf_shape_struct::visibility, dxf_point_struct::x0, dxf_point_struct::y0, and dxf_point_struct::z0.

Referenced by dxf_shape_read().

Here is the call graph for this function:

DxfShape* dxf_shape_read ( DxfFile fp,
DxfShape shape 
)

Read data from a DXF file into a SHAPE entity.

The last line read from file contained the string "SHAPE".
Hereafter follows some data for the SHAPE, to be terminated with a " 0" string announcing the following entity, or the end of the ENTITY section marker ENDSEC.

Returns:
a pointer to shape.
Parameters:
fpDXF file pointer to an input file (or device).
shapea pointer to the DXF SHAPE entity.

Definition at line 169 of file shape.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_13, dxf_shape_struct::binary_graphics_data, dxf_shape_struct::color, dxf_shape_struct::color_name, dxf_shape_struct::color_value, dxf_binary_graphics_data_struct::data_line, dxf_shape_struct::dictionary_owner_hard, dxf_shape_struct::dictionary_owner_soft, dxf_binary_graphics_data_init(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, dxf_shape_init(), dxf_shape_new(), dxf_shape_struct::elevation, dxf_shape_struct::extr_x0, dxf_shape_struct::extr_y0, dxf_shape_struct::extr_z0, dxf_file_struct::filename, dxf_file_struct::fp, dxf_shape_struct::graphics_data_size, dxf_shape_struct::id_code, dxf_shape_struct::layer, dxf_file_struct::line_number, dxf_shape_struct::linetype, dxf_shape_struct::linetype_scale, dxf_shape_struct::lineweight, dxf_shape_struct::material, dxf_binary_graphics_data_struct::next, dxf_shape_struct::obl_angle, dxf_shape_struct::p0, dxf_shape_struct::paperspace, dxf_shape_struct::plot_style_name, dxf_shape_struct::rel_x_scale, dxf_shape_struct::rot_angle, dxf_shape_struct::shadow_mode, dxf_shape_struct::shape_name, dxf_shape_struct::size, dxf_shape_struct::thickness, dxf_shape_struct::transparency, dxf_shape_struct::visibility, dxf_point_struct::x0, dxf_point_struct::y0, and dxf_point_struct::z0.

Here is the call graph for this function:

int dxf_shape_write ( DxfFile fp,
DxfShape shape 
)

Write DXF output for a DXF SHAPE entity.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.

Todo:
for version R14.
Implementing the start of application-defined group "{application_name", with Group code 102.
For example: "{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group.

application-defined codes: Group codes and values within the 102 groups are application defined (optional).

End of group, "}" (optional), with Group code 102.

Parameters:
fpDXF file pointer to an output file (or device).
shapea pointer to the DXF SHAPE entity.

Definition at line 493 of file shape.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_11, AutoCAD_12, AutoCAD_13, AutoCAD_14, AutoCAD_2000, AutoCAD_2002, AutoCAD_2004, AutoCAD_2008, AutoCAD_2009, dxf_shape_struct::binary_graphics_data, dxf_shape_struct::color, dxf_shape_struct::color_name, dxf_shape_struct::color_value, dxf_shape_struct::dictionary_owner_hard, dxf_shape_struct::dictionary_owner_soft, dxf_binary_graphics_data_get_data_line(), dxf_binary_graphics_data_get_next(), DXF_COLOR_BYLAYER, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, DXF_FLATLAND, DXF_PAPERSPACE, dxf_shape_struct::elevation, dxf_shape_struct::extr_x0, dxf_shape_struct::extr_y0, dxf_shape_struct::extr_z0, dxf_file_struct::fp, dxf_shape_struct::graphics_data_size, dxf_shape_struct::id_code, dxf_shape_struct::layer, dxf_shape_struct::linetype, dxf_shape_struct::linetype_scale, dxf_shape_struct::lineweight, dxf_shape_struct::material, dxf_shape_struct::obl_angle, dxf_shape_struct::paperspace, dxf_shape_struct::plot_style_name, dxf_shape_struct::rel_x_scale, dxf_shape_struct::rot_angle, dxf_shape_struct::shadow_mode, dxf_shape_struct::shape_name, dxf_shape_struct::size, dxf_shape_struct::thickness, dxf_shape_struct::transparency, dxf_shape_struct::visibility, dxf_shape_struct::x0, dxf_shape_struct::y0, and dxf_shape_struct::z0.

Here is the call graph for this function:

int dxf_shape_free ( DxfShape shape)

Free the allocated memory for a DXF SHAPE and all it's data fields.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Parameters:
shapea pointer to the memory occupied by the DXF SHAPE entity.

Definition at line 722 of file shape.c.

References _, dxf_shape_struct::binary_graphics_data, dxf_shape_struct::color_name, dxf_shape_struct::dictionary_owner_hard, dxf_shape_struct::dictionary_owner_soft, dxf_binary_graphics_data_free_chain(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_point_free(), dxf_shape_struct::layer, dxf_shape_struct::linetype, dxf_shape_struct::material, dxf_shape_struct::next, dxf_shape_struct::p0, dxf_shape_struct::plot_style_name, and dxf_shape_struct::shape_name.

Referenced by dxf_shape_free_chain().

Here is the call graph for this function:

void dxf_shape_free_chain ( DxfShape shapes)

Free the allocated memory for a chain of DXF SHAPE entities and all their data fields.

Parameters:
shapesa pointer to the chain of DXF SHAPE entities.

Definition at line 771 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_shape_free(), and dxf_shape_struct::next.

Here is the call graph for this function:

int dxf_shape_get_id_code ( DxfShape shape)

Get the id_code from a DXF SHAPE entity.

Returns:
id_code.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 804 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::id_code.

DxfShape* dxf_shape_set_id_code ( DxfShape shape,
int  id_code 
)

Set the id_code for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
id_codethe id_code to be set for the entity.
This is to be an unique (sequential) number in the DXF file.

Definition at line 838 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::id_code.

char* dxf_shape_get_linetype ( DxfShape shape)

Get the linetype from a DXF SHAPE entity.

Returns:
linetype when sucessful, NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 879 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::linetype.

DxfShape* dxf_shape_set_linetype ( DxfShape shape,
char *  linetype 
)

Set the linetype for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
linetypea pointer to a string containing the linetype to be set for the entity.

Definition at line 914 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::linetype.

char* dxf_shape_get_layer ( DxfShape shape)

Get the layer from a DXF SHAPE entity.

Returns:
layer when sucessful, NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 955 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::layer.

DxfShape* dxf_shape_set_layer ( DxfShape shape,
char *  layer 
)

Set the layer for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
layera pointer to a string containing the layer to be set for the entity.

Definition at line 990 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::layer.

double dxf_shape_get_elevation ( DxfShape shape)

Get the elevation from a DXF SHAPE entity.

Returns:
elevation.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1031 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::elevation.

DxfShape* dxf_shape_set_elevation ( DxfShape shape,
double  elevation 
)

Set the elevation for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
elevationthe elevation to be set for the entity.

Definition at line 1059 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::elevation.

double dxf_shape_get_thickness ( DxfShape shape)

Get the thickness from a DXF SHAPE entity.

Returns:
thickness.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1092 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::thickness.

DxfShape* dxf_shape_set_thickness ( DxfShape shape,
double  thickness 
)

Set the thickness for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
thicknessthe thickness to be set for the entity.

Definition at line 1127 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::thickness.

double dxf_shape_get_linetype_scale ( DxfShape shape)

Get the linetype_scale from a DXF SHAPE entity.

Returns:
linetype_scale.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1167 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::linetype_scale.

DxfShape* dxf_shape_set_linetype_scale ( DxfShape shape,
double  linetype_scale 
)

Set the linetype_scale for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
linetype_scalethe linetype_scale to be set for the entity.

Definition at line 1201 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::linetype_scale.

int16_t dxf_shape_get_visibility ( DxfShape shape)

Get the visibility from a DXF SHAPE entity.

Returns:
visibility.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1241 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::visibility.

DxfShape* dxf_shape_set_visibility ( DxfShape shape,
int16_t  visibility 
)

Set the visibility for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
visibilitythe visibility to be set for the entity.

Definition at line 1281 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::visibility.

int dxf_shape_get_color ( DxfShape shape)

Get the color from a DXF SHAPE entity.

Returns:
color.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1326 of file shape.c.

References _, dxf_shape_struct::color, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfShape* dxf_shape_set_color ( DxfShape shape,
int  color 
)

Set the color for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
colorthe color to be set for the entity.

Definition at line 1360 of file shape.c.

References _, dxf_shape_struct::color, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_shape_get_paperspace ( DxfShape shape)

Get the paperspace flag value from a DXF SHAPE entity.

Returns:
paperspace flag value.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1399 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::paperspace.

DxfShape* dxf_shape_set_paperspace ( DxfShape shape,
int  paperspace 
)

Set the paperspace flag for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
paperspacethe paperspace flag value to be set for the entity.

Definition at line 1439 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::paperspace.

int dxf_shape_get_graphics_data_size ( DxfShape shape)

Get the graphics_data_size value from a DXF SHAPE entity.

Returns:
graphics_data_size value when successful, or EXIT_FAILURE when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1486 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::graphics_data_size.

DxfShape* dxf_shape_set_graphics_data_size ( DxfShape shape,
int  graphics_data_size 
)

Set the graphics_data_size value for a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
graphics_data_sizethe graphics_data_size value to be set for the entity.

Definition at line 1529 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::graphics_data_size.

int16_t dxf_shape_get_shadow_mode ( DxfShape shape)

Get the shadow_mode from a DXF SHAPE entity.

Returns:
shadow_mode when successful, or EXIT_FAILURE when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1576 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::shadow_mode.

DxfShape* dxf_shape_set_shadow_mode ( DxfShape shape,
int16_t  shadow_mode 
)

Set the shadow_mode for a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
shadow_modethe shadow_mode to be set for the entity.

Definition at line 1619 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::shadow_mode.

DxfBinaryGraphicsData* dxf_shape_get_binary_graphics_data ( DxfShape shape)

Get the pointer to the binary_graphics_data from a DXF SHAPE entity.

Returns:
pointer to the binary_graphics_data.
Warning:
No checks are performed on the returned pointer.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1667 of file shape.c.

References _, dxf_shape_struct::binary_graphics_data, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfShape* dxf_shape_set_binary_graphics_data ( DxfShape shape,
DxfBinaryGraphicsData data 
)

Set the pointer to the binary_graphics_data for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
dataa string containing the pointer to the binary_graphics_data for the entity.

Definition at line 1703 of file shape.c.

References _, dxf_shape_struct::binary_graphics_data, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

char* dxf_shape_get_dictionary_owner_soft ( DxfShape shape)

Get the pointer to the dictionary_owner_soft from a DXF SHAPE entity.

Returns:
pointer to the dictionary_owner_soft.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1747 of file shape.c.

References _, dxf_shape_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfShape* dxf_shape_set_dictionary_owner_soft ( DxfShape shape,
char *  dictionary_owner_soft 
)

Set the pointer to the dictionary_owner_soft for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
dictionary_owner_softa string containing the pointer to the dictionary_owner_soft for the entity.

Definition at line 1783 of file shape.c.

References _, dxf_shape_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

char* dxf_shape_get_material ( DxfShape shape)

Get the pointer to the material from a DXF SHAPE entity.

Returns:
a pointer to material when successful, or NULL when an error occurred.
Warning:
No checks are performed on the returned pointer.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1827 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::material.

DxfShape* dxf_shape_set_material ( DxfShape shape,
char *  material 
)

Set the pointer to the material for a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
materiala string containing the pointer to the material for the entity.

Definition at line 1865 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::material.

char* dxf_shape_get_dictionary_owner_hard ( DxfShape shape)

Get the pointer to the dictionary_owner_hard from a DXF SHAPE entity.

Returns:
pointer to the dictionary_owner_hard.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1909 of file shape.c.

References _, dxf_shape_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfShape* dxf_shape_set_dictionary_owner_hard ( DxfShape shape,
char *  dictionary_owner_hard 
)

Set the pointer to the dictionary_owner_hard for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
dictionary_owner_harda string containing the pointer to the dictionary_owner_hard for the entity.

Definition at line 1945 of file shape.c.

References _, dxf_shape_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int16_t dxf_shape_get_lineweight ( DxfShape shape)

Get the lineweight from a DXF SHAPE entity.

Returns:
lineweight when successful, or EXIT_FAILURE when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 1987 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::lineweight.

DxfShape* dxf_shape_set_lineweight ( DxfShape shape,
int16_t  lineweight 
)

Set the lineweight for a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
lineweightthe lineweight to be set for the entity.

Definition at line 2018 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::lineweight.

char* dxf_shape_get_plot_style_name ( DxfShape shape)

Get the plot_style_name from a DXF SHAPE entity.

Returns:
a pointer to plot_style_name when sucessful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2052 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::plot_style_name.

DxfShape* dxf_shape_set_plot_style_name ( DxfShape shape,
char *  plot_style_name 
)

Set the plot_style_name for a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
plot_style_namea string containing the plot_style_name for the entity.

Definition at line 2090 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::plot_style_name.

long dxf_shape_get_color_value ( DxfShape shape)

Get the color_value from a DXF SHAPE entity.

Returns:
color_value when successful, or EXIT_FAILURE when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2132 of file shape.c.

References _, dxf_shape_struct::color_value, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfShape* dxf_shape_set_color_value ( DxfShape shape,
long  color_value 
)

Set the color_value for a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
color_valuethe color_value to be set for the entity.

Definition at line 2163 of file shape.c.

References _, dxf_shape_struct::color_value, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

char* dxf_shape_get_color_name ( DxfShape shape)

Get the color_name from a DXF SHAPE entity.

Returns:
color_name when sucessful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2197 of file shape.c.

References _, dxf_shape_struct::color_name, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfShape* dxf_shape_set_color_name ( DxfShape shape,
char *  color_name 
)

Set the color_name for a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
color_namea string containing the color_name for the entity.

Definition at line 2235 of file shape.c.

References _, dxf_shape_struct::color_name, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

long dxf_shape_get_transparency ( DxfShape shape)

Get the transparency from a DXF SHAPE entity.

Returns:
transparency when successful, or EXIT_FAILURE when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2277 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::transparency.

DxfShape* dxf_shape_set_transparency ( DxfShape shape,
long  transparency 
)

Set the transparency for a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
transparencythe transparency to be set for the entity.

Definition at line 2308 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::transparency.

DxfPoint* dxf_shape_get_p0 ( DxfShape shape)

Get the insertion point p0 of a DXF SHAPE entity.

Returns:
the insertion point p0.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2341 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::p0.

DxfShape* dxf_shape_set_p0 ( DxfShape shape,
DxfPoint p0 
)

Set the insertion point p0 of a DXF SHAPE entity.

Returns:
a pointer to a DXF SHAPE entity.
Parameters:
shapea pointer to a DXF SHAPE entity.
p0a pointer to a DXF POINT entity.

Definition at line 2378 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::p0.

double dxf_shape_get_x0 ( DxfShape shape)

Get the X-value of the insertion point x0 of a DXF SHAPE entity.

Returns:
the X-value of the insertion point x0.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2419 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_shape_struct::p0, and dxf_point_struct::x0.

DxfShape* dxf_shape_set_x0 ( DxfShape shape,
double  x0 
)

Set the X-value of the insertion point x0 of a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
x0the X-value of the insertion point x0 of a DXF SHAPE entity.

Definition at line 2459 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_shape_struct::p0, dxf_shape_struct::x0, and dxf_point_struct::x0.

double dxf_shape_get_y0 ( DxfShape shape)

Get the Y-value of the insertion point y0 of a DXF SHAPE entity.

Returns:
the Y-value of the insertion point y0.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2501 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_shape_struct::p0, and dxf_point_struct::y0.

DxfShape* dxf_shape_set_y0 ( DxfShape shape,
double  y0 
)

Set the Y-value of the insertion point y0 of a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
y0the Y-value of the insertion point y0 of a DXF SHAPE entity.

Definition at line 2541 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_shape_struct::p0, dxf_shape_struct::y0, and dxf_point_struct::y0.

double dxf_shape_get_z0 ( DxfShape shape)

Get the Z-value of the insertion point z0 of a DXF SHAPE entity.

Returns:
the Z-value of the insertion point z0.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2583 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_shape_struct::p0, and dxf_point_struct::z0.

DxfShape* dxf_shape_set_z0 ( DxfShape shape,
double  z0 
)

Set the Z-value of the insertion point z0 of a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
z0the Z-value of the insertion point z0 of a DXF SHAPE entity.

Definition at line 2623 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_shape_struct::p0, dxf_shape_struct::z0, and dxf_point_struct::z0.

double dxf_shape_get_size ( DxfShape shape)

Get the size of a DXF SHAPE entity.

Returns:
the size.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2664 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::size.

DxfShape* dxf_shape_set_size ( DxfShape shape,
double  size 
)

Set the size of a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
sizethe size of a DXF SHAPE entity.

Definition at line 2696 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::size.

double dxf_shape_get_rel_x_scale ( DxfShape shape)

Get the rel_x_scale of a DXF SHAPE entity.

Returns:
the rel_x_scale.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2729 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::rel_x_scale.

DxfShape* dxf_shape_set_rel_x_scale ( DxfShape shape,
double  rel_x_scale 
)

Set the rel_x_scale of a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
rel_x_scalethe rel_x_scale of a DXF SHAPE entity.

Definition at line 2761 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::rel_x_scale.

double dxf_shape_get_rot_angle ( DxfShape shape)

Get the rot_angle of a DXF SHAPE entity.

Returns:
the rot_angle.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2794 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::rot_angle.

DxfShape* dxf_shape_set_rot_angle ( DxfShape shape,
double  rot_angle 
)

Set the rot_angle of a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
rot_anglethe rot_angle of a DXF SHAPE entity.

Definition at line 2826 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::rot_angle.

double dxf_shape_get_obl_angle ( DxfShape shape)

Get the obl_angle of a DXF SHAPE entity.

Returns:
the obl_angle.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2859 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::obl_angle.

DxfShape* dxf_shape_set_obl_angle ( DxfShape shape,
double  obl_angle 
)

Set the obl_angle of a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
obl_anglethe obl_angle of a DXF SHAPE entity.

Definition at line 2891 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::obl_angle.

double dxf_shape_get_extr_x0 ( DxfShape shape)

Get the X-value of the extrusion vector extr_x0 of a DXF SHAPE entity.

Returns:
the X-value of the extrusion vector extr_x0.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2925 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::extr_x0.

DxfShape* dxf_shape_set_extr_x0 ( DxfShape shape,
double  extr_x0 
)

Set the X-value of the extrusion vector extr_x0 of a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
extr_x0the X-value of the extrusion vector extr_x0 of a DXF SHAPE entity.

Definition at line 2958 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::extr_x0.

double dxf_shape_get_extr_y0 ( DxfShape shape)

Get the Y-value of the extrusion vector extr_y0 of a DXF SHAPE entity.

Returns:
the Y-value of the extrusion vector extr_y0.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 2993 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::extr_y0.

DxfShape* dxf_shape_set_extr_y0 ( DxfShape shape,
double  extr_y0 
)

Set the Y-value of the extrusion vector extr_y0 of a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
extr_y0the Y-value of the extrusion vector extr_y0 of a DXF SHAPE entity.

Definition at line 3026 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::extr_y0.

double dxf_shape_get_extr_z0 ( DxfShape shape)

Get the Z-value of the extrusion vector extr_z0 of a DXF SHAPE entity.

Returns:
the Z-value of the extrusion vector extr_z0.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 3061 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::extr_z0.

DxfShape* dxf_shape_set_extr_z0 ( DxfShape shape,
double  extr_z0 
)

Set the Z-value of the extrusion vector extr_z0 of a DXF SHAPE entity.

Returns:
a pointer to shape when successful, or NULL when an error occurred.
Parameters:
shapea pointer to a DXF SHAPE entity.
extr_z0the Z-value of the extrusion vector extr_z0 of a DXF SHAPE entity.

Definition at line 3094 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::extr_z0.

DxfShape* dxf_shape_get_next ( DxfShape shape)

Get the pointer to the next SHAPE entity from a DXF SHAPE entity.

Returns:
pointer to the next SHAPE entity.
Warning:
No checks are performed on the returned pointer.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 3131 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::next.

DxfShape* dxf_shape_set_next ( DxfShape shape,
DxfShape next 
)

Set the pointer to the next SHAPE for a DXF SHAPE entity.

Parameters:
shapea pointer to a DXF SHAPE entity.
nexta pointer to the next SHAPE for the entity.

Definition at line 3167 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::next.

DxfShape* dxf_shape_get_last ( DxfShape shape)

Get the pointer to the last SHAPE entity from a linked list of DXF SHAPE entities.

Returns:
pointer to the last SHAPE entity.
Warning:
No checks are performed on the returned pointer.
Parameters:
shapea pointer to a DXF SHAPE entity.

Definition at line 3210 of file shape.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_shape_struct::next.