libDXF 0.0.1
A library with DXF related functions written in C.
|
Header file for a DXF layer index object (LAYER_INDEX
).
More...
Go to the source code of this file.
Data Structures | |
struct | dxf_layer_index_struct |
DXF definition of an AutoCAD idbuffer object (LAYER_INDEX ). More... | |
Typedefs | |
typedef struct dxf_layer_index_struct | DxfLayerIndex |
DXF definition of an AutoCAD idbuffer object (LAYER_INDEX ). | |
Functions | |
DxfLayerIndex * | dxf_layer_index_new () |
Allocate memory for a DxfLayerIndex . | |
DxfLayerIndex * | dxf_layer_index_init (DxfLayerIndex *layer_index) |
Allocate memory and initialize data fields in a LAYER_INDEX object. | |
DxfLayerIndex * | dxf_layer_index_read (DxfFile *fp, DxfLayerIndex *layer_index) |
Read data from a DXF file into a DXF LAYER_INDEX object. | |
int | dxf_layer_index_write (DxfFile *fp, DxfLayerIndex *layer_index) |
Write DXF output to a file for a DXF LAYER_INDEX object. | |
int | dxf_layer_index_free (DxfLayerIndex *layer_index) |
Free the allocated memory for a DXF LAYER_INDEX and all it's data fields. | |
void | dxf_layer_index_free_chain (DxfLayerIndex *layer_indices) |
Free the allocated memory for a chain of DXF LAYER_INDEX objects and all their data fields. | |
int | dxf_layer_index_get_id_code (DxfLayerIndex *layer_index) |
Get the ID code from a DXF LAYER_INDEX object. | |
DxfLayerIndex * | dxf_layer_index_set_id_code (DxfLayerIndex *layer_index, int id_code) |
Set the ID code for a DXF LAYER_INDEX object. | |
char * | dxf_layer_index_get_dictionary_owner_soft (DxfLayerIndex *layer_index) |
Get the soft pointer to the dictionary owner from a DXF LAYER_INDEX object. | |
DxfLayerIndex * | dxf_layer_index_set_dictionary_owner_soft (DxfLayerIndex *layer_index, char *dictionary_owner_soft) |
Set the pointer to the dictionary_owner_soft for a DXF LAYER_INDEX object. | |
char * | dxf_layer_index_get_dictionary_owner_hard (DxfLayerIndex *layer_index) |
Get the hard pointer to the dictionary owner from a DXF LAYER_INDEX object. | |
DxfLayerIndex * | dxf_layer_index_set_dictionary_owner_hard (DxfLayerIndex *layer_index, char *dictionary_owner_hard) |
Set the pointer to the dictionary_owner_hard for a DXF LAYER_INDEX object. | |
double | dxf_layer_index_get_time_stamp (DxfLayerIndex *layer_index) |
Get the time_stamp from a DXF LAYER_INDEX object. | |
DxfLayerIndex * | dxf_layer_index_set_time_stamp (DxfLayerIndex *layer_index, double time_stamp) |
Set the radius for a DXF LAYER_INDEX object. | |
DxfLayerIndex * | dxf_layer_index_get_next (DxfLayerIndex *layer_index) |
Get the pointer to the next LAYER_INDEX object from a DXF LAYER_INDEX object. | |
DxfLayerIndex * | dxf_layer_index_set_next (DxfLayerIndex *layer_index, DxfLayerIndex *next) |
Set the pointer to the next LAYER_INDEX object for a DXF LAYER_INDEX object. | |
DxfLayerIndex * | dxf_layer_index_get_last (DxfLayerIndex *layer_index) |
Get the pointer to the last LAYER_INDEX object from a linked list of DXF LAYER_INDEX object. |
Header file for a DXF layer index object (LAYER_INDEX
).
A layer index is a list showing which objects are on which layers.
This list is used when the program is referencing the drawing in conjunction with demand loading to determine which objects need to be read in and displayed.
Objects on frozen layers in a referenced drawing are not read in if the referenced drawing has a layer index and is being demand loaded.
Layer indexes are best used in drawings that will be used as xrefs in other drawings where demand loading is enabled.
Drawings that are not going to be used as xrefs or partially opened will not benefit from layer and spatial indexing or demand loading.
LAYER_INDEX
object was introduced in DXF R14.
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 layer_index.h.
typedef struct dxf_layer_index_struct DxfLayerIndex |
DXF definition of an AutoCAD idbuffer object (LAYER_INDEX
).
DxfLayerIndex* dxf_layer_index_new | ( | ) |
Allocate memory for a DxfLayerIndex
.
Fill the memory contents with zeros.
Definition at line 71 of file layer_index.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_layer_index_init(), and dxf_layer_index_read().
DxfLayerIndex* dxf_layer_index_init | ( | DxfLayerIndex * | layer_index | ) |
Allocate memory and initialize data fields in a LAYER_INDEX
object.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful. layer_index | DXF LAYER_INDEX object. |
Definition at line 109 of file layer_index.c.
References _, dxf_layer_index_struct::dictionary_owner_hard, dxf_layer_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_layer_index_new(), dxf_layer_name_init(), dxf_layer_name_new(), DXF_MAX_PARAM, dxf_layer_index_struct::hard_owner_reference, dxf_layer_index_struct::id_code, dxf_layer_index_struct::layer_name, dxf_layer_name_struct::name, dxf_layer_index_struct::next, dxf_layer_index_struct::number_of_entries, and dxf_layer_index_struct::time_stamp.
Referenced by dxf_layer_index_read().
DxfLayerIndex* dxf_layer_index_read | ( | DxfFile * | fp, |
DxfLayerIndex * | layer_index | ||
) |
Read data from a DXF file into a DXF LAYER_INDEX
object.
The last line read from file contained the string "LAYER_INDEX".
Now follows some data for the LAYER_INDEX
, to be terminated with a " 0" string announcing the following entity, or the end of the ENTITY
section marker ENDSEC
.
While parsing the DXF file store data in layer_index
.
layer_index
. fp | DXF file pointer to an input file (or device). |
layer_index | DXF LAYER_INDEX object. |
Definition at line 167 of file layer_index.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, dxf_layer_index_struct::dictionary_owner_hard, dxf_layer_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_layer_index_init(), dxf_layer_index_new(), dxf_layer_name_init(), dxf_file_struct::filename, dxf_file_struct::fp, dxf_layer_index_struct::hard_owner_reference, dxf_layer_index_struct::id_code, dxf_layer_index_struct::layer_name, dxf_file_struct::line_number, dxf_layer_name_struct::name, dxf_layer_name_struct::next, dxf_layer_index_struct::number_of_entries, and dxf_layer_index_struct::time_stamp.
int dxf_layer_index_write | ( | DxfFile * | fp, |
DxfLayerIndex * | layer_index | ||
) |
Write DXF output to a file for a DXF LAYER_INDEX
object.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. fp | DXF file pointer to an output file (or device). |
layer_index | DXF LAYER_INDEX object. |
Definition at line 333 of file layer_index.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, dxf_layer_index_struct::dictionary_owner_hard, dxf_layer_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_file_struct::fp, dxf_layer_index_struct::hard_owner_reference, dxf_layer_index_struct::id_code, dxf_layer_index_struct::layer_name, dxf_layer_name_struct::name, dxf_layer_name_struct::next, dxf_layer_index_struct::number_of_entries, and dxf_layer_index_struct::time_stamp.
int dxf_layer_index_free | ( | DxfLayerIndex * | layer_index | ) |
Free the allocated memory for a DXF LAYER_INDEX
and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. layer_index | Pointer to the memory occupied by the DXF LAYER_INDEX object. |
Definition at line 441 of file layer_index.c.
References _, dxf_layer_index_struct::dictionary_owner_hard, dxf_layer_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_layer_name_free_chain(), DXF_MAX_PARAM, dxf_layer_index_struct::hard_owner_reference, dxf_layer_index_struct::layer_name, and dxf_layer_index_struct::next.
Referenced by dxf_layer_index_free_chain().
void dxf_layer_index_free_chain | ( | DxfLayerIndex * | layer_indices | ) |
Free the allocated memory for a chain of DXF LAYER_INDEX
objects and all their data fields.
layer_indices | pointer to the chain of DXF LAYER_INDEX objects. |
Definition at line 489 of file layer_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_layer_index_free(), and dxf_layer_index_struct::next.
int dxf_layer_index_get_id_code | ( | DxfLayerIndex * | layer_index | ) |
Get the ID code from a DXF LAYER_INDEX
object.
layer_index | a pointer to a DXF LAYER_INDEX object. |
Definition at line 522 of file layer_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_index_struct::id_code.
DxfLayerIndex* dxf_layer_index_set_id_code | ( | DxfLayerIndex * | layer_index, |
int | id_code | ||
) |
Set the ID code for a DXF LAYER_INDEX
object.
layer_index | a pointer to a DXF LAYER_INDEX object. |
id_code | Identification number for the object. This is to be an unique (sequential) number in the DXF file. |
Definition at line 557 of file layer_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_index_struct::id_code.
char* dxf_layer_index_get_dictionary_owner_soft | ( | DxfLayerIndex * | layer_index | ) |
Get the soft pointer to the dictionary owner from a DXF LAYER_INDEX
object.
layer_index | a pointer to a DXF LAYER_INDEX object. |
Definition at line 602 of file layer_index.c.
References _, dxf_layer_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
DxfLayerIndex* dxf_layer_index_set_dictionary_owner_soft | ( | DxfLayerIndex * | layer_index, |
char * | dictionary_owner_soft | ||
) |
Set the pointer to the dictionary_owner_soft for a DXF LAYER_INDEX
object.
layer_index | a pointer to a DXF LAYER_INDEX object. |
dictionary_owner_soft | a string containing the pointer to the dictionary_owner_soft for the entity. |
Definition at line 638 of file layer_index.c.
References _, dxf_layer_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
char* dxf_layer_index_get_dictionary_owner_hard | ( | DxfLayerIndex * | layer_index | ) |
Get the hard pointer to the dictionary owner from a DXF LAYER_INDEX
object.
layer_index | a pointer to a DXF LAYER_INDEX object. |
Definition at line 682 of file layer_index.c.
References _, dxf_layer_index_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
DxfLayerIndex* dxf_layer_index_set_dictionary_owner_hard | ( | DxfLayerIndex * | layer_index, |
char * | dictionary_owner_hard | ||
) |
Set the pointer to the dictionary_owner_hard for a DXF LAYER_INDEX
object.
layer_index | a pointer to a DXF LAYER_INDEX object. |
dictionary_owner_hard | a string containing the pointer to the dictionary_owner_hard for the entity. |
Definition at line 718 of file layer_index.c.
References _, dxf_layer_index_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
double dxf_layer_index_get_time_stamp | ( | DxfLayerIndex * | layer_index | ) |
Get the time_stamp
from a DXF LAYER_INDEX
object.
time_stamp
. layer_index | a pointer to a DXF LAYER_INDEX object. |
Definition at line 759 of file layer_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_index_struct::time_stamp.
DxfLayerIndex* dxf_layer_index_set_time_stamp | ( | DxfLayerIndex * | layer_index, |
double | time_stamp | ||
) |
Set the radius for a DXF LAYER_INDEX
object.
layer_index | a pointer to a DXF LAYER_INDEX object. |
time_stamp | the time_stamp to be set for the object. |
Definition at line 794 of file layer_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_index_struct::time_stamp.
DxfLayerIndex* dxf_layer_index_get_next | ( | DxfLayerIndex * | layer_index | ) |
Get the pointer to the next LAYER_INDEX
object from a DXF LAYER_INDEX
object.
LAYER_INDEX
object.layer_index | a pointer to a DXF LAYER_INDEX object. |
Definition at line 837 of file layer_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_index_struct::next.
DxfLayerIndex* dxf_layer_index_set_next | ( | DxfLayerIndex * | layer_index, |
DxfLayerIndex * | next | ||
) |
Set the pointer to the next LAYER_INDEX
object for a DXF LAYER_INDEX
object.
layer_index | a pointer to a DXF LAYER_INDEX object. |
next | a pointer to the next LAYER_INDEX object for the object. |
Definition at line 873 of file layer_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_index_struct::next.
DxfLayerIndex* dxf_layer_index_get_last | ( | DxfLayerIndex * | layer_index | ) |
Get the pointer to the last LAYER_INDEX
object from a linked list of DXF LAYER_INDEX
object.
LAYER_INDEX
object.layer_index | a pointer to a DXF LAYER_INDEX object. |
Definition at line 917 of file layer_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_index_struct::next.