libDXF 0.0.1
A library with DXF related functions written in C.
|
Header file for a DXF layer table (LAYER
).
More...
#include "global.h"
Go to the source code of this file.
Data Structures | |
struct | dxf_layer_struct |
DXF definition of an AutoCAD layer entity. More... | |
Typedefs | |
typedef struct dxf_layer_struct | DxfLayer |
DXF definition of an AutoCAD layer entity. | |
Functions | |
DxfLayer * | dxf_layer_new () |
Allocate memory for a DXF LAYER . | |
DxfLayer * | dxf_layer_init (DxfLayer *layer) |
Allocate memory and initialize data fields in a DXF LAYER table. | |
DxfLayer * | dxf_layer_read (DxfFile *fp, DxfLayer *layer) |
Read data from a DXF file into a DXF LAYER table. | |
int | dxf_layer_write (DxfFile *fp, DxfLayer *layer) |
Write DXF output for a DXF LAYER table. | |
int | dxf_layer_free (DxfLayer *layer) |
Free the allocated memory for a DXF LAYER and all it's data fields. | |
void | dxf_layer_free_chain (DxfLayer *layers) |
Free the allocated memory for a chain of DXF LAYER tables and all their data fields. | |
int | dxf_layer_get_id_code (DxfLayer *layer) |
Get the ID code from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_id_code (DxfLayer *layer, int id_code) |
Set the ID code for a DXF LAYER entity. | |
char * | dxf_layer_get_layer_name (DxfLayer *layer) |
Get the layer_name from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_layer_name (DxfLayer *layer, char *layer_name) |
Set the layer_name for a DXF LAYER entity. | |
char * | dxf_layer_get_linetype (DxfLayer *layer) |
Get the linetype from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_linetype (DxfLayer *layer, char *linetype) |
Set the linetype for a DXF LAYER entity. | |
int | dxf_layer_get_color (DxfLayer *layer) |
Get the color from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_color (DxfLayer *layer, int color) |
Set the color for a DXF LAYER entity. | |
int | dxf_layer_is_off (DxfLayer *layer) |
Test if layer is off. | |
int | dxf_layer_get_flag (DxfLayer *layer) |
Get the flag from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_flag (DxfLayer *layer, int flag) |
Set the flag for a DXF LAYER entity. | |
int | dxf_layer_is_frozen (DxfLayer *layer) |
Test if layer is frozen. | |
int | dxf_layer_is_locked (DxfLayer *layer) |
Test if layer is locked. | |
int | dxf_layer_is_xreferenced (DxfLayer *layer) |
Test if layer is externally dependent on an xref. | |
int | dxf_layer_is_xresolved (DxfLayer *layer) |
Test if layer is externally dependent on a xref and has been successfully resolved. | |
int | dxf_layer_is_referenced (DxfLayer *layer) |
Test if layer is internally referenced by an entity. | |
int | dxf_layer_get_plotting_flag (DxfLayer *layer) |
Get the plotting_flag from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_plotting_flag (DxfLayer *layer, int plotting_flag) |
Set the plotting_flag for a DXF LAYER entity. | |
char * | dxf_layer_get_dictionary_owner_soft (DxfLayer *layer) |
Get the soft pointer to the dictionary owner from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_dictionary_owner_soft (DxfLayer *layer, char *dictionary_owner_soft) |
Set the pointer to the dictionary_owner_soft for a DXF LAYER entity. | |
char * | dxf_layer_get_material (DxfLayer *layer) |
Get the pointer to the material from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_material (DxfLayer *layer, char *material) |
Set the pointer to the material for a DXF LAYER entity. | |
char * | dxf_layer_get_dictionary_owner_hard (DxfLayer *layer) |
Get the hard pointer to the dictionary owner from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_dictionary_owner_hard (DxfLayer *layer, char *dictionary_owner_hard) |
Set the pointer to the dictionary_owner_hard for a DXF LAYER entity. | |
int16_t | dxf_layer_get_lineweight (DxfLayer *layer) |
Get the lineweight from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_lineweight (DxfLayer *layer, int16_t lineweight) |
Set the lineweight for a DXF LAYER entity. | |
char * | dxf_layer_get_plot_style_name (DxfLayer *layer) |
Get the plot_style_name from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_plot_style_name (DxfLayer *layer, char *plot_style_name) |
Set the plot_style_name for a DXF LAYER entity. | |
DxfLayer * | dxf_layer_get_next (DxfLayer *layer) |
Get the pointer to the next LAYER entity from a DXF LAYER entity. | |
DxfLayer * | dxf_layer_set_next (DxfLayer *layer, DxfLayer *next) |
Set the pointer to the next LAYER for a DXF LAYER entity. | |
DxfLayer * | dxf_layer_get_last (DxfLayer *layer) |
Get the pointer to the last LAYER entity from a linked list of DXF LAYER entities. |
Header file for a DXF layer table (LAYER
).
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.h.
typedef struct dxf_layer_struct DxfLayer |
DXF definition of an AutoCAD layer entity.
DxfLayer* dxf_layer_new | ( | ) |
Allocate memory for a DXF LAYER
.
Fill the memory contents with zeros.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful. Definition at line 52 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_insert_struct::layer.
Referenced by dxf_layer_init(), and dxf_layer_read().
Allocate memory and initialize data fields in a DXF LAYER
table.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful. layer | DXF LAYER table. |
Definition at line 90 of file layer.c.
References _, DXF_COLOR_BYLAYER, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LINETYPE, dxf_layer_new(), dxf_layer_set_color(), dxf_layer_set_dictionary_owner_hard(), dxf_layer_set_dictionary_owner_soft(), dxf_layer_set_flag(), dxf_layer_set_id_code(), dxf_layer_set_layer_name(), dxf_layer_set_linetype(), dxf_layer_set_lineweight(), dxf_layer_set_material(), dxf_layer_set_next(), dxf_layer_set_plot_style_name(), and dxf_layer_set_plotting_flag().
Referenced by dxf_layer_read().
Read data from a DXF file into a DXF LAYER
table.
The last line read from file contained the string "LAYER".
Now follows some data for the LAYER
, to be terminated with a " 0" string announcing the following table, or the end of the TABLE
section marker ENDTAB
.
While parsing the DXF file store data in layer
.
layer
. fp | DXF file pointer to an input file (or device). |
layer | DXF LAYER table. |
Definition at line 145 of file layer.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_13, dxf_layer_struct::color, dxf_layer_struct::dictionary_owner_hard, dxf_layer_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LINETYPE, dxf_layer_init(), dxf_layer_new(), dxf_file_struct::filename, dxf_layer_struct::flag, dxf_file_struct::fp, dxf_layer_struct::layer_name, dxf_file_struct::line_number, dxf_layer_struct::linetype, dxf_layer_struct::lineweight, dxf_layer_struct::material, dxf_layer_struct::plot_style_name, and dxf_layer_struct::plotting_flag.
Write DXF output for a DXF LAYER
table.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. fp | DXF file pointer to an output file (or device). |
layer | DXF LAYER table. |
Definition at line 318 of file layer.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_14, AutoCAD_2000, AutoCAD_2007, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LINETYPE, dxf_layer_get_color(), dxf_layer_get_dictionary_owner_soft(), dxf_layer_get_flag(), dxf_layer_get_id_code(), dxf_layer_get_layer_name(), dxf_layer_get_linetype(), dxf_layer_get_lineweight(), dxf_layer_get_material(), dxf_layer_get_plot_style_name(), dxf_layer_get_plotting_flag(), dxf_layer_set_linetype(), dxf_file_struct::fp, and dxf_layer_struct::id_code.
int dxf_layer_free | ( | DxfLayer * | layer | ) |
Free the allocated memory for a DXF LAYER
and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. layer | Pointer to the memory occupied by the DXF LAYER table. |
Definition at line 431 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_layer_get_dictionary_owner_hard(), dxf_layer_get_dictionary_owner_soft(), dxf_layer_get_layer_name(), dxf_layer_get_linetype(), dxf_layer_get_material(), dxf_layer_get_plot_style_name(), and dxf_layer_struct::next.
Referenced by dxf_layer_free_chain().
void dxf_layer_free_chain | ( | DxfLayer * | layers | ) |
Free the allocated memory for a chain of DXF LAYER
tables and all their data fields.
layers | pointer to the chain of DXF LAYER tables. |
Definition at line 482 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_layer_free(), and dxf_layer_struct::next.
int dxf_layer_get_id_code | ( | DxfLayer * | layer | ) |
Get the ID code from a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
Definition at line 515 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::id_code.
Referenced by dxf_layer_write().
Set the ID code for a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
id_code | Identification number for the entity. This is to be an unique (sequential) number in the DXF file. |
Definition at line 550 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::id_code.
Referenced by dxf_layer_init().
char* dxf_layer_get_layer_name | ( | DxfLayer * | layer | ) |
Get the layer_name
from a DXF LAYER
entity.
layer_name
when sucessful, NULL
when an error occurred. layer | a pointer to a DXF LAYER entity. |
Definition at line 592 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::layer_name.
Referenced by dxf_layer_free(), and dxf_layer_write().
Set the layer_name
for a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
layer_name | a string containing the layer_name for the entity. |
Definition at line 627 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::layer_name.
Referenced by dxf_layer_init().
char* dxf_layer_get_linetype | ( | DxfLayer * | layer | ) |
Get the linetype from a DXF LAYER
entity.
NULL
when an error occurred. layer | a pointer to a DXF LAYER entity. |
Definition at line 668 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::linetype.
Referenced by dxf_layer_free(), and dxf_layer_write().
Set the linetype for a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
linetype | a string containing the linetype for the entity. |
Definition at line 703 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::linetype.
Referenced by dxf_layer_init(), and dxf_layer_write().
int dxf_layer_get_color | ( | DxfLayer * | layer | ) |
Get the color from a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
Definition at line 743 of file layer.c.
References _, dxf_layer_struct::color, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_layer_write().
Set the color for a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
color | the color to be set for the entity. |
Definition at line 777 of file layer.c.
References _, dxf_layer_struct::color, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_layer_init().
int dxf_layer_is_off | ( | DxfLayer * | layer | ) |
Test if layer is off.
TRUE
when layer is off, or FALSE
when layer is on, or (-1) when an error occurred. layer | DXF LAYER table. |
Definition at line 817 of file layer.c.
References _, dxf_layer_struct::color, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and FALSE.
int dxf_layer_get_flag | ( | DxfLayer * | layer | ) |
Get the flag
from a DXF LAYER
entity.
flag
. layer | a pointer to a DXF LAYER entity. |
Definition at line 850 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::flag.
Referenced by dxf_layer_write().
Set the flag
for a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
flag | a flag value for the entity. |
Definition at line 885 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::flag.
Referenced by dxf_layer_init().
int dxf_layer_is_frozen | ( | DxfLayer * | layer | ) |
Test if layer is frozen.
TRUE
when layer is frozen, or FALSE
when layer is thawed, or (-1) when an error occurred. layer | DXF LAYER table. |
Definition at line 926 of file layer.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, FALSE, and dxf_layer_struct::flag.
int dxf_layer_is_locked | ( | DxfLayer * | layer | ) |
Test if layer is locked.
TRUE
when layer is locked, or FALSE
when layer is not locked, or (-1) when an error occurred. layer | DXF LAYER table. |
Definition at line 961 of file layer.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, FALSE, and dxf_layer_struct::flag.
int dxf_layer_is_xreferenced | ( | DxfLayer * | layer | ) |
Test if layer is externally dependent on an xref.
TRUE
when layer is externally dependent on an xref, or FALSE
when layer is not externally dependent on an xref, or (-1) when an error occurred. layer | DXF LAYER table. |
Definition at line 996 of file layer.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, FALSE, and dxf_layer_struct::flag.
int dxf_layer_is_xresolved | ( | DxfLayer * | layer | ) |
Test if layer is externally dependent on a xref and has been successfully resolved.
TRUE
when layer is externally dependent on a xref and has been successfully resolved, or FALSE
when layer is not externally dependent on a xref and has not been successfully resolved, or (-1) when an error occurred. layer | DXF LAYER table. |
Definition at line 1033 of file layer.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, FALSE, and dxf_layer_struct::flag.
int dxf_layer_is_referenced | ( | DxfLayer * | layer | ) |
Test if layer is internally referenced by an entity.
TRUE
when layer is internally referenced by an entity, or FALSE
when layer is not internally referenced by an entity, or (-1) when an error occurred. layer | DXF LAYER table. |
Definition at line 1069 of file layer.c.
References _, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, DXF_DEBUG_END, FALSE, and dxf_layer_struct::flag.
int dxf_layer_get_plotting_flag | ( | DxfLayer * | layer | ) |
Get the plotting_flag
from a DXF LAYER
entity.
flag
. layer | a pointer to a DXF LAYER entity. |
Definition at line 1102 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::plotting_flag.
Referenced by dxf_layer_write().
Set the plotting_flag
for a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
plotting_flag | a plotting_flag value for the entity. |
Definition at line 1137 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::plotting_flag.
Referenced by dxf_layer_init().
char* dxf_layer_get_dictionary_owner_soft | ( | DxfLayer * | layer | ) |
Get the soft pointer to the dictionary owner from a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
Definition at line 1180 of file layer.c.
References _, dxf_layer_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_layer_free(), and dxf_layer_write().
Set the pointer to the dictionary_owner_soft for a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
dictionary_owner_soft | a string containing the pointer to the dictionary_owner_soft for the entity. |
Definition at line 1216 of file layer.c.
References _, dxf_layer_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_layer_init().
char* dxf_layer_get_material | ( | DxfLayer * | layer | ) |
Get the pointer to the material
from a DXF LAYER
entity.
material
when successful, or NULL
when an error occurred.layer | a pointer to a DXF LAYER entity. |
Definition at line 1260 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::material.
Referenced by dxf_layer_free(), and dxf_layer_write().
Set the pointer to the material
for a DXF LAYER
entity.
layer
when successful, or NULL
when an error occurred. layer | a pointer to a DXF LAYER entity. |
material | a string containing the pointer to the material for the entity. |
Definition at line 1298 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::material.
Referenced by dxf_layer_init().
char* dxf_layer_get_dictionary_owner_hard | ( | DxfLayer * | layer | ) |
Get the hard pointer to the dictionary owner from a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
Definition at line 1342 of file layer.c.
References _, dxf_layer_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_layer_free().
Set the pointer to the dictionary_owner_hard for a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
dictionary_owner_hard | a string containing the pointer to the dictionary_owner_hard for the entity. |
Definition at line 1378 of file layer.c.
References _, dxf_layer_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_layer_init().
int16_t dxf_layer_get_lineweight | ( | DxfLayer * | layer | ) |
Get the lineweight
from a DXF LAYER
entity.
lineweight
when successful, or EXIT_FAILURE
when an error occurred. layer | a pointer to a DXF LAYER entity. |
Definition at line 1420 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::lineweight.
Referenced by dxf_layer_write().
Set the lineweight
for a DXF LAYER
entity.
layer
when successful, or NULL
when an error occurred. layer | a pointer to a DXF LAYER entity. |
lineweight | the lineweight to be set for the entity. |
Definition at line 1451 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::lineweight.
Referenced by dxf_layer_init().
char* dxf_layer_get_plot_style_name | ( | DxfLayer * | layer | ) |
Get the plot_style_name
from a DXF LAYER
entity.
plot_style_name
when sucessful, or NULL
when an error occurred. layer | a pointer to a DXF LAYER entity. |
Definition at line 1485 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::plot_style_name.
Referenced by dxf_layer_free(), and dxf_layer_write().
Set the plot_style_name
for a DXF LAYER
entity.
layer
when successful, or NULL
when an error occurred. layer | a pointer to a DXF LAYER entity. |
plot_style_name | a string containing the plot_style_name for the entity. |
Definition at line 1523 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::plot_style_name.
Referenced by dxf_layer_init().
Get the pointer to the next LAYER
entity from a DXF LAYER
entity.
LAYER
entity.layer | a pointer to a DXF LAYER entity. |
Definition at line 1567 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::next.
Set the pointer to the next LAYER
for a DXF LAYER
entity.
layer | a pointer to a DXF LAYER entity. |
next | a pointer to the next LAYER for the entity. |
Definition at line 1603 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::next.
Referenced by dxf_layer_init().
Get the pointer to the last LAYER
entity from a linked list of DXF LAYER
entities.
LAYER
entity.layer | a pointer to a DXF LAYER entity. |
Definition at line 1646 of file layer.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_layer_struct::next.