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

xline.c File Reference

Functions for a DXF xline entity (XLINE). More...

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

Go to the source code of this file.

Functions

DxfXLinedxf_xline_new ()
 Allocate memory for a DxfXLine.
DxfXLinedxf_xline_init (DxfXLine *xline)
 Allocate memory and initialize data fields in an XLINE entity.
DxfXLinedxf_xline_read (DxfFile *fp, DxfXLine *xline)
 Read data from a DXF file into a DXF XLINE entity.
int dxf_xline_write (DxfFile *fp, DxfXLine *xline)
 Write DXF output to fp for a DXF XLINE entity.
int dxf_xline_free (DxfXLine *xline)
 Free the allocated memory for a DXF XLINE and all it's data fields.
void dxf_xline_free_chain (DxfXLine *xlines)
 Free the allocated memory for a chain of DXF XLINE entities and all their data fields.

Detailed Description

Functions for a DXF xline entity (XLINE).

Author:
Copyright (C) 2015, 2017 by Bert Timmerman <bert.timmerman@xs4all.nl>.

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


Function Documentation

DxfXLine* dxf_xline_new ( )

Allocate memory for a DxfXLine.

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 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13.
According to DXF R14.

Definition at line 53 of file xline.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_xline_init(), and dxf_xline_read().

DxfXLine* dxf_xline_init ( DxfXLine xline)

Allocate memory and initialize data fields in an XLINE entity.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13.
According to DXF R14.
Parameters:
xlinea pointer to the DXF XLINE entity.

Definition at line 96 of file xline.c.

References _, dxf_xline::color, dxf_xline::dictionary_owner_hard, dxf_xline::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_xline_new(), dxf_xline::elevation, dxf_xline::id_code, dxf_xline::layer, dxf_xline::linetype, dxf_xline::linetype_scale, dxf_xline::next, dxf_xline::paperspace, dxf_xline::thickness, dxf_xline::visibility, dxf_xline::x0, dxf_xline::x1, dxf_xline::y0, dxf_xline::y1, dxf_xline::z0, and dxf_xline::z1.

Referenced by dxf_xline_read().

Here is the call graph for this function:

DxfXLine* dxf_xline_read ( DxfFile fp,
DxfXLine xline 
)

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

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

Returns:
a pointer to xline.
Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13.
According to DXF R14.
Parameters:
fpDXF file pointer to an input file (or device).
xlinea pointer to the DXF XLINE entity.

Definition at line 163 of file xline.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_11, AutoCAD_13, dxf_xline::color, dxf_xline::dictionary_owner_hard, dxf_xline::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, dxf_xline_init(), dxf_xline_new(), dxf_xline::elevation, dxf_file_struct::filename, dxf_file_struct::fp, dxf_xline::id_code, dxf_xline::layer, dxf_file_struct::line_number, dxf_xline::linetype, dxf_xline::linetype_scale, dxf_xline::paperspace, dxf_xline::thickness, dxf_xline::visibility, dxf_xline::x0, dxf_xline::x1, dxf_xline::y0, dxf_xline::y1, dxf_xline::z0, and dxf_xline::z1.

Here is the call graph for this function:

int dxf_xline_write ( DxfFile fp,
DxfXLine xline 
)

Write DXF output to fp for a DXF XLINE entity.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occured.
Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
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).
xlinea pointer to the DXF XLINE entity.

Definition at line 387 of file xline.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_11, AutoCAD_13, AutoCAD_14, dxf_xline::color, dxf_xline::dictionary_owner_hard, dxf_xline::dictionary_owner_soft, DXF_COLOR_BYLAYER, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, dxf_entity_skip(), DXF_FLATLAND, DXF_PAPERSPACE, dxf_xline::elevation, dxf_file_struct::fp, dxf_xline::id_code, dxf_xline::layer, dxf_xline::linetype, dxf_xline::linetype_scale, dxf_xline::paperspace, dxf_xline::thickness, dxf_xline::visibility, dxf_xline::x0, dxf_xline::x1, dxf_xline::y0, dxf_xline::y1, dxf_xline::z0, and dxf_xline::z1.

Here is the call graph for this function:

int dxf_xline_free ( DxfXLine xline)

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

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13.
According to DXF R14.
Parameters:
xlinea pointer to the memory occupied by the DXF XLINE entity.

Definition at line 539 of file xline.c.

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

Referenced by dxf_xline_free_chain().

void dxf_xline_free_chain ( DxfXLine xlines)

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

Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13.
According to DXF R14.
Parameters:
xlinesa pointer to the chain of DXF XLINE entities.

Definition at line 588 of file xline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_xline_free(), and dxf_xline::next.

Here is the call graph for this function: