libDXF 0.0.1
A library with DXF related functions written in C.
|
Functions for a DXF class entity (CLASS
).
More...
#include "class.h"
Go to the source code of this file.
Functions | |
DxfClass * | dxf_class_new () |
Allocate memory for a DXF CLASS entity. | |
DxfClass * | dxf_class_init (DxfClass *class) |
Allocate memory and initialize data fields in a DXF CLASS entity. | |
DxfClass * | dxf_class_read (DxfFile *fp, DxfClass *class) |
Read data from a DXF file into a DXF CLASS entity. | |
int | dxf_class_write (DxfFile *fp, DxfClass *class) |
Write DXF output to a file for a DXF CLASS entity. | |
int | dxf_class_write_endclass (DxfFile *fp) |
Write DXF output to a file for an end of CLASSES section marker. | |
int | dxf_class_free (DxfClass *class) |
Free the allocated memory for a DXF CLASS and all it's data fields. | |
void | dxf_class_free_chain (DxfClass *classes) |
Free the allocated memory for a chain of DXF CLASS classes and all their data fields. | |
char * | dxf_class_get_record_type (DxfClass *class) |
Get the record type from a DXF CLASS entity. | |
DxfClass * | dxf_class_set_record_type (DxfClass *class, char *record_type) |
Set the record type for a DXF CLASS entity. | |
char * | dxf_class_get_record_name (DxfClass *class) |
Get the record name from a DXF CLASS entity. | |
DxfClass * | dxf_class_set_record_name (DxfClass *class, char *record_name) |
Set the record name for a DXF CLASS entity. | |
char * | dxf_class_get_class_name (DxfClass *class) |
Get the class name from a DXF CLASS entity. | |
DxfClass * | dxf_class_set_class_name (DxfClass *class, char *class_name) |
Set the class name for a DXF CLASS entity. | |
char * | dxf_class_get_app_name (DxfClass *class) |
Get the application name from a DXF CLASS entity. | |
DxfClass * | dxf_class_set_app_name (DxfClass *class, char *app_name) |
Set the application name for a DXF CLASS entity. | |
int | dxf_class_get_proxy_cap_flag (DxfClass *class) |
Get the proxy_cap_flag from a DXF CLASS entity. | |
DxfClass * | dxf_class_set_proxy_cap_flag (DxfClass *class, int proxy_cap_flag) |
Set the proxy_cap_flag for a DXF CLASS entity. | |
int | dxf_class_is_editable (DxfClass *class) |
Test if operations on this CLASS symbol table entry are allowed. | |
int | dxf_class_erase_allowed (DxfClass *class) |
Test if erasing on this CLASS symbol table entry is allowed. | |
int | dxf_class_transform_allowed (DxfClass *class) |
Test if transforming on this CLASS symbol table entry is allowed. | |
int | dxf_class_color_change_allowed (DxfClass *class) |
Test if changing the color in this CLASS symbol table entry is allowed. | |
int | dxf_class_layer_change_allowed (DxfClass *class) |
Test if changing the layer in this CLASS symbol table entry is allowed. | |
int | dxf_class_linetype_change_allowed (DxfClass *class) |
Test if changing the linetype in this CLASS symbol table entry is allowed. | |
int | dxf_class_linetype_scale_change_allowed (DxfClass *class) |
Test if changing the linetype scale in this CLASS symbol table entry is allowed. | |
int | dxf_class_visibility_change_allowed (DxfClass *class) |
Test if changing the visibility in this CLASS symbol table entry is allowed. | |
int | dxf_class_cloning_allowed (DxfClass *class) |
Test if cloning of this CLASS symbol table entry is allowed. | |
int | dxf_class_lineweight_change_allowed (DxfClass *class) |
Test if changing the line weight in this CLASS symbol table entry is allowed. | |
int | dxf_class_plot_style_name_change_allowed (DxfClass *class) |
Test if changing the plot style name in this CLASS symbol table entry is allowed. | |
int | dxf_class_is_R13_format_proxy (DxfClass *class) |
Test if changing the plot style name in this CLASS symbol table entry is allowed. | |
int | dxf_class_get_was_a_proxy_flag (DxfClass *class) |
Get the was_a_proxy_flag from a DXF CLASS entity. | |
DxfClass * | dxf_class_set_was_a_proxy_flag (DxfClass *class, int was_a_proxy_flag) |
Set the was_a_proxy_flag for a DXF CLASS entity. | |
int | dxf_class_get_is_an_entity_flag (DxfClass *class) |
Get the is_an_entity_flag value from a DXF CLASS entity. | |
DxfClass * | dxf_class_set_is_an_entity_flag (DxfClass *class, int is_an_entity_flag) |
Set the is_an_entity_flag for a DXF CLASS entity. | |
DxfClass * | dxf_class_get_next (DxfClass *class) |
Get the pointer to the next CLASS entity from a DXF CLASS entity. | |
DxfClass * | dxf_class_set_next (DxfClass *class, DxfClass *next) |
Set the pointer to the next CLASS for a DXF CLASS entity. | |
DxfClass * | dxf_class_get_last (DxfClass *class) |
Get the pointer to the last CLASS from a linked list of DXF CLASS . |
Functions for a DXF class entity (CLASS
).
DXF Record Name Code 1 |
C++ Class Name Code 2 |
Code 90 | Code 280 |
Code 281 |
Version introduction |
---|---|---|---|---|---|
ACDBDICTIONARYWDFLT | AcDbDictionaryWithDefault | 0 | 0 | 0 | DXF R15/2000 |
ACDBPLACEHOLDER | AcDbPlaceHolder | 0 | 0 | 0 | DXF R15/2000 |
ARCALIGNEDTEXT | AcDbArcAlignedText | 0 | 0 | 1 | DXF R15/2000 |
DICTIONARYVAR | AcDbDictionaryVar | 0 | 0 | 0 | DXF R13 |
HATCH | AcDbHatch | 0 | 0 | 1 | DXF R13 |
IDBUFFER | AcDbIdBuffer | 0 | 0 | 0 | DXF R13 |
IMAGE | AcDbRasterImage | 127 | 0 | 1 | DXF R13 |
IMAGEDEF | AcDbRasterImageDef | 0 | 0 | 0 | DXF R13 |
IMAGEDEF_REACTOR | AcDbRasterImageDefReactor | 1 | 0 | 0 | DXF R13 |
LAYER_INDEX | AcDbLayerIndex | 0 | 0 | 0 | DXF R13 |
LAYOUT | AcDbLayout | 0 | 0 | 0 | DXF R15/2000 |
LWPOLYLINE | AcDbPolyline | 0 | 0 | 1 | DXF R13 |
OBJECT_PTR | CAseDLPNTableRecord | 1 | 0 | 0 | DXF R13 |
OLE2FRAME | AcDbOle2Frame | 0 | 0 | 1 | DXF R13 |
PLOTSETTINGS | AcDbPlotSettings | 0 | 0 | 0 | DXF R15/2000 |
RASTERVARIABLES | AcDbRasterVariables | 0 | 0 | 0 | DXF R13 |
RTEXT | RText | 0 | 0 | 1 | DXF R15/2000 |
SORTENTSTABLE | AcDbSortentsTable | 0 | 0 | 0 | DXF R13 |
SPATIAL_INDEX | AcDbSpatialIndex | 0 | 0 | 0 | DXF R13 |
SPATIAL_FILTER | AcDbSpatialFilter | 0 | 0 | 0 | DXF R13 |
WIPEOUT | AcDbWipeout | 127 | 0 | 1 | DXF R15/2000 |
WIPEOUTVARIABLES | AcDbWipeoutVariables | 0 | 0 | 0 | DXF R15/2000 |
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 class.c.
DxfClass* dxf_class_new | ( | ) |
Allocate memory for a DXF CLASS
entity.
Fill the memory contents with zeros.
Definition at line 55 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_init(), and dxf_class_read().
Allocate memory and initialize data fields in a DXF CLASS
entity.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful. class | DXF class entity. |
Definition at line 93 of file class.c.
References _, dxf_class_new(), dxf_class_set_app_name(), dxf_class_set_class_name(), dxf_class_set_is_an_entity_flag(), dxf_class_set_next(), dxf_class_set_proxy_cap_flag(), dxf_class_set_record_name(), dxf_class_set_record_type(), dxf_class_set_was_a_proxy_flag(), DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_read(), and dxf_drawing_init().
Read data from a DXF file into a DXF CLASS
entity.
The last line read from file contained the string "CLASS".
Now follows some data for the CLASS
, to be terminated with a " 0" string announcing the following entity, or the end of the ENTITY
section marker ENDCLASS
.
While parsing the DXF file store data in class
.
class
. record_type
has group code 0 which will cause a parsing error and record_type
and other class
variables will not be read. See the while condition above. fp | DXF file pointer to an input file (or device). |
class | DXF class entity. |
Definition at line 144 of file class.c.
References _, dxf_class_get_class_name(), dxf_class_get_record_name(), dxf_class_get_record_type(), dxf_class_init(), dxf_class_new(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_file_struct::filename, dxf_file_struct::fp, and dxf_file_struct::line_number.
Write DXF output to a file for a DXF CLASS
entity.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. fp | DXF file pointer to an output file (or device). |
class | DXF class section. |
Definition at line 296 of file class.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_14, dxf_class_get_app_name(), dxf_class_get_class_name(), dxf_class_get_is_an_entity_flag(), dxf_class_get_proxy_cap_flag(), dxf_class_get_record_name(), dxf_class_get_record_type(), dxf_class_get_was_a_proxy_flag(), dxf_class_set_app_name(), dxf_class_set_record_name(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_file_struct::fp.
int dxf_class_write_endclass | ( | DxfFile * | fp | ) |
Write DXF output to a file for an end of CLASSES
section marker.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. Definition at line 396 of file class.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_file_struct::fp.
int dxf_class_free | ( | DxfClass * | class | ) |
Free the allocated memory for a DXF CLASS
and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. class | Pointer to the memory occupied by the DXF CLASS entity. |
Definition at line 429 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_free_chain().
void dxf_class_free_chain | ( | DxfClass * | classes | ) |
Free the allocated memory for a chain of DXF CLASS
classes and all their data fields.
classes | pointer to the chain of DXF CLASS classes. |
Definition at line 471 of file class.c.
References _, dxf_class_free(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_class_struct::next.
Referenced by dxf_drawing_free().
char* dxf_class_get_record_type | ( | DxfClass * | class | ) |
Get the record type from a DXF CLASS
entity.
NULL
when an error occurred. class | a pointer to a DXF CLASS entity. |
Definition at line 504 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_read(), and dxf_class_write().
Set the record type for a DXF CLASS
entity.
class | a pointer to a DXF CLASS entity. |
record_type | a string containing the record type for the entity. |
Definition at line 542 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_init().
char* dxf_class_get_record_name | ( | DxfClass * | class | ) |
Get the record name from a DXF CLASS
entity.
NULL
when an error occurred. class | a pointer to a DXF CLASS entity. |
Definition at line 582 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_read(), and dxf_class_write().
Set the record name for a DXF CLASS
entity.
class | a pointer to a DXF CLASS entity. |
record_name | a string containing the record name for the entity. |
Definition at line 620 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_init(), and dxf_class_write().
char* dxf_class_get_class_name | ( | DxfClass * | class | ) |
Get the class name from a DXF CLASS
entity.
NULL
when an error occurred. class | a pointer to a DXF CLASS entity. |
Definition at line 660 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_read(), and dxf_class_write().
Set the class name for a DXF CLASS
entity.
class | a pointer to a DXF CLASS entity. |
class_name | a string containing the class name for the entity. |
Definition at line 698 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_init().
char* dxf_class_get_app_name | ( | DxfClass * | class | ) |
Get the application name from a DXF CLASS
entity.
NULL
when an error occurred. class | a pointer to a DXF CLASS entity. |
Definition at line 738 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_write().
Set the application name for a DXF CLASS
entity.
class | a pointer to a DXF CLASS entity. |
app_name | a string containing the application name for the entity. |
Definition at line 776 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_init(), and dxf_class_write().
int dxf_class_get_proxy_cap_flag | ( | DxfClass * | class | ) |
Get the proxy_cap_flag from a DXF CLASS
entity.
class | a pointer to a DXF CLASS entity. |
Definition at line 817 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_write().
Set the proxy_cap_flag for a DXF CLASS
entity.
class | a pointer to a DXF CLASS entity. |
proxy_cap_flag | Proxy capabilities flag. |
Definition at line 855 of file class.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_class_struct::proxy_cap_flag.
Referenced by dxf_class_init().
int dxf_class_is_editable | ( | DxfClass * | class | ) |
Test if operations on this CLASS
symbol table entry are allowed.
TRUE
when operations on this CLASS
symbol table entry are allowed, or FALSE
when operations on this CLASS
symbol table entry are not allowed. class | DXF CLASS symbol table entry. |
Definition at line 898 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_erase_allowed | ( | DxfClass * | class | ) |
Test if erasing on this CLASS
symbol table entry is allowed.
TRUE
when erasing on this CLASS
symbol table entry is allowed, or FALSE
when erasing on this CLASS
symbol table entry is not allowed. class | DXF CLASS symbol table entry. |
Definition at line 934 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_transform_allowed | ( | DxfClass * | class | ) |
Test if transforming on this CLASS
symbol table entry is allowed.
TRUE
when transforming on this CLASS
symbol table entry is allowed, or FALSE
when transforming on this CLASS
symbol table entry is not allowed. class | DXF CLASS symbol table entry. |
Definition at line 970 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_color_change_allowed | ( | DxfClass * | class | ) |
Test if changing the color in this CLASS
symbol table entry is allowed.
TRUE
when changing the color in this CLASS
symbol table entry is allowed, or FALSE
when changing the color in this CLASS
symbol table entry is not allowed. class | DXF CLASS symbol table entry. |
Definition at line 1006 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_layer_change_allowed | ( | DxfClass * | class | ) |
Test if changing the layer in this CLASS
symbol table entry is allowed.
TRUE
when changing the layer in this CLASS
symbol table entry is allowed, or FALSE
when changing the layer in this CLASS
symbol table entry is not allowed. class | DXF CLASS symbol table entry. |
Definition at line 1042 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_linetype_change_allowed | ( | DxfClass * | class | ) |
Test if changing the linetype in this CLASS
symbol table entry is allowed.
TRUE
when changing the linetype in this CLASS
symbol table entry is allowed, or FALSE
when changing the linetype in this CLASS
symbol table entry is not allowed. class | DXF CLASS symbol table entry. |
Definition at line 1078 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_linetype_scale_change_allowed | ( | DxfClass * | class | ) |
Test if changing the linetype scale in this CLASS
symbol table entry is allowed.
TRUE
when changing the linetype scale in this CLASS
symbol table entry is allowed, or FALSE
when changing the linetype scale in this CLASS
symbol table entry is not allowed. class | DXF CLASS symbol table entry. |
Definition at line 1114 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_visibility_change_allowed | ( | DxfClass * | class | ) |
Test if changing the visibility in this CLASS
symbol table entry is allowed.
TRUE
when changing the visibility in this CLASS
symbol table entry is allowed, or FALSE
when changing the visibility in this CLASS
symbol table entry is not allowed. class | DXF CLASS symbol table entry. |
Definition at line 1150 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_cloning_allowed | ( | DxfClass * | class | ) |
Test if cloning of this CLASS
symbol table entry is allowed.
TRUE
when cloning of this CLASS
symbol table entry is allowed, or FALSE
when cloning of this CLASS
symbol table entry is not allowed. class | DXF CLASS symbol table entry. |
Definition at line 1185 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_lineweight_change_allowed | ( | DxfClass * | class | ) |
Test if changing the line weight in this CLASS
symbol table entry is allowed.
TRUE
when changing the line weight in this CLASS
symbol table entry is allowed, or FALSE
when changing the line weight in this CLASS
symbol table entry is not allowed. class | DXF CLASS symbol table entry. |
Definition at line 1221 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_plot_style_name_change_allowed | ( | DxfClass * | class | ) |
Test if changing the plot style name in this CLASS
symbol table entry is allowed.
TRUE
when changing the plot style name in this CLASS
symbol table entry is allowed, or FALSE
when changing the plot style name in this CLASS
symbol table entry is not allowed. class | DXF CLASS symbol table entry. |
Definition at line 1257 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_is_R13_format_proxy | ( | DxfClass * | class | ) |
Test if changing the plot style name in this CLASS
symbol table entry is allowed.
TRUE
when this CLASS
symbol table entry is a R13 format proxy, or FALSE
when this CLASS
symbol table entry is not a R13 format proxy. class | DXF CLASS symbol table entry. |
Definition at line 1293 of file class.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_class_get_was_a_proxy_flag | ( | DxfClass * | class | ) |
Get the was_a_proxy_flag from a DXF CLASS
entity.
class | a pointer to a DXF CLASS entity. |
Definition at line 1326 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_write().
Set the was_a_proxy_flag for a DXF CLASS
entity.
class | a pointer to a DXF CLASS entity. |
was_a_proxy_flag | Was-a-proxy flag. |
Definition at line 1371 of file class.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_class_struct::was_a_proxy_flag.
Referenced by dxf_class_init().
int dxf_class_get_is_an_entity_flag | ( | DxfClass * | class | ) |
Get the is_an_entity_flag value from a DXF CLASS
entity.
class | a pointer to a DXF CLASS entity. |
Definition at line 1418 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_write().
Set the is_an_entity_flag for a DXF CLASS
entity.
class | a pointer to a DXF CLASS entity. |
is_an_entity_flag | Is-an-entity flag. |
Definition at line 1463 of file class.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_class_struct::is_an_entity_flag.
Referenced by dxf_class_init().
Get the pointer to the next CLASS
entity from a DXF CLASS
entity.
CLASS
entity.class | a pointer to a DXF CLASS entity. |
Definition at line 1513 of file class.c.
References _, DEBUG, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Set the pointer to the next CLASS
for a DXF CLASS
entity.
class | a pointer to a DXF CLASS entity. |
next | a pointer to the next CLASS for the entity. |
Definition at line 1552 of file class.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_class_init().
Get the pointer to the last CLASS
from a linked list of DXF CLASS
.
CLASS
.class | a pointer to a DXF CLASS . |
Definition at line 1595 of file class.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_class_struct::next.