![]() |
libDXF 0.0.1
A library with DXF related functions written in C.
|
Functions for a DXF spatial_index object (SPATIAL_INDEX).
More...
#include "spatial_index.h"
Go to the source code of this file.
Functions | |
| DxfSpatialIndex * | dxf_spatial_index_new () |
Allocate memory for a DxfSpatialIndex. | |
| DxfSpatialIndex * | dxf_spatial_index_init (DxfSpatialIndex *spatial_index) |
Allocate memory and initialize data fields in a SPATIAL_INDEX object. | |
| DxfSpatialIndex * | dxf_spatial_index_read (DxfFile *fp, DxfSpatialIndex *spatial_index) |
Read data from a DXF file into a DXF SPATIAL_INDEX object. | |
| int | dxf_spatial_index_write (DxfFile *fp, DxfSpatialIndex *spatial_index) |
Write DXF output to a file for a DXF SPATIAL_INDEX object. | |
| int | dxf_spatial_index_free (DxfSpatialIndex *spatial_index) |
Free the allocated memory for a DXF SPATIAL_INDEX and all it's data fields. | |
| void | dxf_spatial_index_free_chain (DxfSpatialIndex *spatial_indices) |
Free the allocated memory for a chain of DXF SPATIAL_INDEX objects and all their data fields. | |
| int | dxf_spatial_index_get_id_code (DxfSpatialIndex *spatial_index) |
Get the id_code from a DXF SPATIAL_INDEX object. | |
| DxfSpatialIndex * | dxf_spatial_index_set_id_code (DxfSpatialIndex *spatial_index, int id_code) |
Set the id_code for a DXF SPATIAL_INDEX object. | |
| char * | dxf_spatial_index_get_dictionary_owner_soft (DxfSpatialIndex *spatial_index) |
Get the pointer to the dictionary_owner_soft from a DXF SPATIAL_INDEX object. | |
| DxfSpatialIndex * | dxf_spatial_index_set_dictionary_owner_soft (DxfSpatialIndex *spatial_index, char *dictionary_owner_soft) |
Set the pointer to the dictionary_owner_soft for a DXF SPATIAL_INDEX object. | |
| char * | dxf_spatial_index_get_dictionary_owner_hard (DxfSpatialIndex *spatial_index) |
Get the pointer to the dictionary_owner_hard from a DXF SPATIAL_INDEX object. | |
| DxfSpatialIndex * | dxf_spatial_index_set_dictionary_owner_hard (DxfSpatialIndex *spatial_index, char *dictionary_owner_hard) |
Set the pointer to the dictionary_owner_hard for a DXF SPATIAL_INDEX object. | |
| double | dxf_spatial_index_get_time_stamp (DxfSpatialIndex *spatial_index) |
Get the time stamp time_stamp of a DXF SPATIAL_INDEX object. | |
| DxfSpatialIndex * | dxf_spatial_index_set_time_stamp (DxfSpatialIndex *spatial_index, double time_stamp) |
Set the time stamp time_stamp of a DXF SPATIAL_INDEX object. | |
| DxfSpatialIndex * | dxf_spatial_index_get_next (DxfSpatialIndex *spatial_index) |
Get the pointer to the next SPATIAL_INDEX object from a DXF SPATIAL_INDEX object. | |
| DxfSpatialIndex * | dxf_spatial_index_set_next (DxfSpatialIndex *spatial_index, DxfSpatialIndex *next) |
Set the pointer to the next SPATIAL_INDEX object for a DXF SPATIAL_INDEX object. | |
| DxfSpatialIndex * | dxf_spatial_index_get_last (DxfSpatialIndex *spatial_index) |
Get the pointer to the last SPATIAL_INDEX object from a linked list of DXF SPATIAL_INDEX objects. | |
Functions for a DXF spatial_index object (SPATIAL_INDEX).
The SPATIAL_INDEX is always written out empty to a DXF file.
This object can be ignored.
SPATIAL_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 spatial_index.c.
| DxfSpatialIndex* dxf_spatial_index_new | ( | ) |
Allocate memory for a DxfSpatialIndex.
Fill the memory contents with zeros.
Definition at line 55 of file spatial_index.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_spatial_index_init(), and dxf_spatial_index_read().
| DxfSpatialIndex* dxf_spatial_index_init | ( | DxfSpatialIndex * | spatial_index | ) |
Allocate memory and initialize data fields in a SPATIAL_INDEX object.
NULL when no memory was allocated, a pointer to the allocated memory when succesful. | spatial_index | a pointer to the DXF SPATIAL_INDEX object. |
Definition at line 93 of file spatial_index.c.
References _, dxf_spatial_index_struct::dictionary_owner_hard, dxf_spatial_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spatial_index_new(), dxf_spatial_index_struct::id_code, dxf_spatial_index_struct::next, and dxf_spatial_index_struct::time_stamp.
Referenced by dxf_spatial_index_read().

| DxfSpatialIndex* dxf_spatial_index_read | ( | DxfFile * | fp, |
| DxfSpatialIndex * | spatial_index | ||
| ) |
Read data from a DXF file into a DXF SPATIAL_INDEX object.
The last line read from file contained the string "SPATIAL_INDEX".
Now follows some data for the SPATIAL_INDEX, to be terminated with a " 0" string announcing the following object, or the end of the OBJECTS section marker ENDSEC.
While parsing the DXF file store data in spatial_index.
spatial_index. | fp | DXF file pointer to an input file (or device). |
| spatial_index | a pointer to the DXF SPATIAL_INDEX object. |
Definition at line 155 of file spatial_index.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, dxf_spatial_index_struct::dictionary_owner_hard, dxf_spatial_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spatial_index_init(), dxf_spatial_index_new(), dxf_file_struct::filename, dxf_file_struct::fp, dxf_spatial_index_struct::id_code, dxf_file_struct::line_number, and dxf_spatial_index_struct::time_stamp.

| int dxf_spatial_index_write | ( | DxfFile * | fp, |
| DxfSpatialIndex * | spatial_index | ||
| ) |
Write DXF output to a file for a DXF SPATIAL_INDEX object.
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.| fp | DXF file pointer to an output file (or device). |
| spatial_index | a pointer to the DXF SPATIAL_INDEX object. |
Definition at line 282 of file spatial_index.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, dxf_spatial_index_struct::dictionary_owner_hard, dxf_spatial_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_file_struct::fp, dxf_spatial_index_struct::id_code, and dxf_spatial_index_struct::time_stamp.
| int dxf_spatial_index_free | ( | DxfSpatialIndex * | spatial_index | ) |
Free the allocated memory for a DXF SPATIAL_INDEX and all it's data fields.
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred. | spatial_index | a pointer to the memory occupied by the DXF SPATIAL_INDEX object. |
Definition at line 376 of file spatial_index.c.
References _, dxf_spatial_index_struct::dictionary_owner_hard, dxf_spatial_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spatial_index_struct::next.
Referenced by dxf_spatial_index_free_chain().
| void dxf_spatial_index_free_chain | ( | DxfSpatialIndex * | spatial_indices | ) |
Free the allocated memory for a chain of DXF SPATIAL_INDEX objects and all their data fields.
| spatial_indices | a pointer to the chain of DXF SPATIAL_INDEX objects. |
Definition at line 417 of file spatial_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spatial_index_free(), and dxf_spatial_index_struct::next.

| int dxf_spatial_index_get_id_code | ( | DxfSpatialIndex * | spatial_index | ) |
Get the id_code from a DXF SPATIAL_INDEX object.
id_code. | spatial_index | a pointer to a DXF SPATIAL_INDEX object. |
Definition at line 451 of file spatial_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spatial_index_struct::id_code.
| DxfSpatialIndex* dxf_spatial_index_set_id_code | ( | DxfSpatialIndex * | spatial_index, |
| int | id_code | ||
| ) |
Set the id_code for a DXF SPATIAL_INDEX object.
| spatial_index | a pointer to a DXF SPATIAL_INDEX object. |
| id_code | the id_code to be set for the object.This is to be an unique (sequential) number in the DXF file. |
Definition at line 485 of file spatial_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spatial_index_struct::id_code.
| char* dxf_spatial_index_get_dictionary_owner_soft | ( | DxfSpatialIndex * | spatial_index | ) |
Get the pointer to the dictionary_owner_soft from a DXF SPATIAL_INDEX object.
dictionary_owner_soft.| spatial_index | a pointer to a DXF SPATIAL_INDEX object. |
Definition at line 529 of file spatial_index.c.
References _, dxf_spatial_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
| DxfSpatialIndex* dxf_spatial_index_set_dictionary_owner_soft | ( | DxfSpatialIndex * | spatial_index, |
| char * | dictionary_owner_soft | ||
| ) |
Set the pointer to the dictionary_owner_soft for a DXF SPATIAL_INDEX object.
| spatial_index | a pointer to a DXF SPATIAL_INDEX object. |
| dictionary_owner_soft | a string containing the pointer to the dictionary_owner_soft for the object. |
Definition at line 565 of file spatial_index.c.
References _, dxf_spatial_index_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
| char* dxf_spatial_index_get_dictionary_owner_hard | ( | DxfSpatialIndex * | spatial_index | ) |
Get the pointer to the dictionary_owner_hard from a DXF SPATIAL_INDEX object.
dictionary_owner_hard.| spatial_index | a pointer to a DXF SPATIAL_INDEX object. |
Definition at line 609 of file spatial_index.c.
References _, dxf_spatial_index_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
| DxfSpatialIndex* dxf_spatial_index_set_dictionary_owner_hard | ( | DxfSpatialIndex * | spatial_index, |
| char * | dictionary_owner_hard | ||
| ) |
Set the pointer to the dictionary_owner_hard for a DXF SPATIAL_INDEX object.
| spatial_index | a pointer to a DXF SPATIAL_INDEX object. |
| dictionary_owner_hard | a string containing the pointer to the dictionary_owner_hard for the object. |
Definition at line 645 of file spatial_index.c.
References _, dxf_spatial_index_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
| double dxf_spatial_index_get_time_stamp | ( | DxfSpatialIndex * | spatial_index | ) |
Get the time stamp time_stamp of a DXF SPATIAL_INDEX object.
time_stamp. | spatial_index | a pointer to a DXF SPATIAL_INDEX object. |
Definition at line 687 of file spatial_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spatial_index_struct::time_stamp.
| DxfSpatialIndex* dxf_spatial_index_set_time_stamp | ( | DxfSpatialIndex * | spatial_index, |
| double | time_stamp | ||
| ) |
Set the time stamp time_stamp of a DXF SPATIAL_INDEX object.
spatial_index when successful, or NULL when an error occurred. | spatial_index | a pointer to a DXF SPATIAL_FILTER object. |
| time_stamp | the time stamp time_stamp to be set for a DXF SPATIAL_INDEX object. |
Definition at line 720 of file spatial_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spatial_index_struct::time_stamp.
| DxfSpatialIndex* dxf_spatial_index_get_next | ( | DxfSpatialIndex * | spatial_index | ) |
Get the pointer to the next SPATIAL_INDEX object from a DXF SPATIAL_INDEX object.
SPATIAL_INDEX object.| spatial_index | a pointer to a DXF SPATIAL_INDEX object. |
Definition at line 757 of file spatial_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spatial_index_struct::next.
| DxfSpatialIndex* dxf_spatial_index_set_next | ( | DxfSpatialIndex * | spatial_index, |
| DxfSpatialIndex * | next | ||
| ) |
Set the pointer to the next SPATIAL_INDEX object for a DXF SPATIAL_INDEX object.
| spatial_index | a pointer to a DXF SPATIAL_INDEX object. |
| next | a pointer to the next SPATIAL_INDEX object for the object. |
Definition at line 793 of file spatial_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spatial_index_struct::next.
| DxfSpatialIndex* dxf_spatial_index_get_last | ( | DxfSpatialIndex * | spatial_index | ) |
Get the pointer to the last SPATIAL_INDEX object from a linked list of DXF SPATIAL_INDEX objects.
SPATIAL_INDEX object.| spatial_index | a pointer to a DXF SPATIAL_INDEX object. |
Definition at line 837 of file spatial_index.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spatial_index_struct::next.
1.7.3