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

trace.c File Reference

DXF trace entity (TRACE). More...

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

Go to the source code of this file.

Functions

DxfTracedxf_trace_new ()
 Allocate memory for a DXF TRACE.
DxfTracedxf_trace_init (DxfTrace *trace)
 Allocate memory and initialize data fields in a DXF TRACE entity.
DxfTracedxf_trace_read (DxfFile *fp, DxfTrace *trace)
 Read data from a DXF file into a DXF TRACE entity.
int dxf_trace_write (DxfFile *fp, DxfTrace *trace)
 Write DXF output to fp for a DCF TRACE entity.
int dxf_trace_free (DxfTrace *trace)
 Free the allocated memory for a DXF TRACE and all it's data fields.
void dxf_trace_free_chain (DxfTrace *traces)
 Free the allocated memory for a chain of DXF TRACE entities and all their data fields.

Detailed Description

DXF trace entity (TRACE).

Author:
Copyright (C) 2008, 2012, 2014, 2015, 2017 by Bert Timmerman <bert.timmerman@xs4all.nl>.
Copyright (C) 2010 by Luis Matos <gass@otiliamatos.ath.cx>.

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 trace.c.


Function Documentation

DxfTrace* dxf_trace_new ( )

Allocate memory for a DXF TRACE.

Fill the memory contents with zeros.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.

Definition at line 56 of file trace.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_trace_init(), and dxf_trace_read().

DxfTrace* dxf_trace_init ( DxfTrace trace)

Allocate memory and initialize data fields in a DXF TRACE entity.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.
Parameters:
tracea pointer to the DXF TRACE entity.

Definition at line 100 of file trace.c.

References _, dxf_trace::color, dxf_trace::dictionary_owner_hard, dxf_trace::dictionary_owner_soft, 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_trace_new(), dxf_trace::elevation, dxf_trace::extr_x0, dxf_trace::extr_y0, dxf_trace::extr_z0, dxf_trace::id_code, dxf_trace::layer, dxf_trace::linetype, dxf_trace::linetype_scale, dxf_trace::next, dxf_trace::paperspace, dxf_trace::thickness, dxf_trace::visibility, dxf_trace::x0, dxf_trace::x1, dxf_trace::x2, dxf_trace::x3, dxf_trace::y0, dxf_trace::y1, dxf_trace::y2, dxf_trace::y3, dxf_trace::z0, dxf_trace::z1, dxf_trace::z2, and dxf_trace::z3.

Referenced by dxf_trace_read().

Here is the call graph for this function:

DxfTrace* dxf_trace_read ( DxfFile fp,
DxfTrace trace 
)

Read data from a DXF file into a DXF TRACE entity.

The last line read from file contained the string "TRACE".
Now follows some data for the TRACE, 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 trace.

Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.
Parameters:
fpDXF file pointer to an input file (or device).
tracea pointer to the DXF TRACE entity.

Definition at line 174 of file trace.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_11, AutoCAD_13, dxf_trace::color, dxf_trace::dictionary_owner_hard, dxf_trace::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, dxf_trace_init(), dxf_trace_new(), dxf_trace::elevation, dxf_trace::extr_x0, dxf_trace::extr_y0, dxf_trace::extr_z0, dxf_file_struct::filename, dxf_file_struct::fp, dxf_trace::id_code, dxf_trace::layer, dxf_file_struct::line_number, dxf_trace::linetype, dxf_trace::linetype_scale, dxf_trace::paperspace, dxf_trace::thickness, dxf_trace::visibility, dxf_trace::x0, dxf_trace::x1, dxf_trace::x2, dxf_trace::x3, dxf_trace::y0, dxf_trace::y1, dxf_trace::y2, dxf_trace::y3, dxf_trace::z0, dxf_trace::z1, dxf_trace::z2, and dxf_trace::z3.

Here is the call graph for this function:

int dxf_trace_write ( DxfFile fp,
DxfTrace trace 
)

Write DXF output to fp for a DCF TRACE entity.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.

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).
tracea pointer to the DXF TRACE entity.

Definition at line 462 of file trace.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_11, AutoCAD_12, AutoCAD_13, AutoCAD_14, dxf_trace::color, dxf_trace::dictionary_owner_hard, dxf_trace::dictionary_owner_soft, DXF_COLOR_BYLAYER, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, DXF_FLATLAND, DXF_PAPERSPACE, dxf_trace::elevation, dxf_trace::extr_x0, dxf_trace::extr_y0, dxf_trace::extr_z0, dxf_file_struct::fp, dxf_trace::id_code, dxf_trace::layer, dxf_trace::linetype, dxf_trace::linetype_scale, dxf_trace::paperspace, dxf_trace::thickness, dxf_trace::visibility, dxf_trace::x0, dxf_trace::x1, dxf_trace::x2, dxf_trace::x3, dxf_trace::y0, dxf_trace::y1, dxf_trace::y2, dxf_trace::y3, dxf_trace::z0, dxf_trace::z1, dxf_trace::z2, and dxf_trace::z3.

int dxf_trace_free ( DxfTrace trace)

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

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.
Parameters:
tracea pointer to the memory occupied by the DXF TRACE entity.

Definition at line 627 of file trace.c.

References _, dxf_trace::dictionary_owner_hard, dxf_trace::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_trace::layer, dxf_trace::linetype, and dxf_trace::next.

Referenced by dxf_trace_free_chain().

void dxf_trace_free_chain ( DxfTrace traces)

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

Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.
Parameters:
tracesa pointer to the chain of DXF TRACE entities.

Definition at line 676 of file trace.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_trace_free(), and dxf_trace::next.

Here is the call graph for this function: