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

tolerance.c File Reference

Functions for a DXF tolerance entity (TOLERANCE). More...

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

Go to the source code of this file.

Functions

DxfTolerancedxf_tolerance_new ()
 Allocate memory for a DXF TOLERANCE.
DxfTolerancedxf_tolerance_init (DxfTolerance *tolerance)
 Allocate memory and initialize data fields in a DXF TOLERANCE entity.
DxfTolerancedxf_tolerance_read (DxfFile *fp, DxfTolerance *tolerance)
 Read data from a DXF file into a DXF TOLERANCE entity.
int dxf_tolerance_write (DxfFile *fp, DxfTolerance *tolerance)
 Write DXF output for a DXF TOLERANCE entity.
int dxf_tolerance_free (DxfTolerance *tolerance)
 Free the allocated memory for a DXF TOLERANCE and all it's data fields.
void dxf_tolerance_free_chain (DxfTolerance *tolerances)
 Free the allocated memory for a chain of DXF TOLERANCE entities and all their data fields.

Detailed Description

Functions for a DXF tolerance entity (TOLERANCE).

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


Function Documentation

DxfTolerance* dxf_tolerance_new ( )

Allocate memory for a DXF TOLERANCE.

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

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_tolerance_init(), and dxf_tolerance_read().

DxfTolerance* dxf_tolerance_init ( DxfTolerance tolerance)

Allocate memory and initialize data fields in a DXF TOLERANCE 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:
tolerancea pointer to the DXF TOLERANCE entity.

Definition at line 97 of file tolerance.c.

References _, dxf_tolerance::color, dxf_tolerance::dictionary_owner_hard, dxf_tolerance::dictionary_owner_soft, dxf_tolerance::dimstyle_name, 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_tolerance_new(), dxf_tolerance::elevation, dxf_tolerance::extr_x0, dxf_tolerance::extr_y0, dxf_tolerance::extr_z0, dxf_tolerance::id_code, dxf_tolerance::layer, dxf_tolerance::linetype, dxf_tolerance::linetype_scale, dxf_tolerance::next, dxf_tolerance::paperspace, dxf_tolerance::thickness, dxf_tolerance::visibility, dxf_tolerance::x0, dxf_tolerance::x1, dxf_tolerance::y0, dxf_tolerance::y1, dxf_tolerance::z0, and dxf_tolerance::z1.

Referenced by dxf_tolerance_read().

Here is the call graph for this function:

DxfTolerance* dxf_tolerance_read ( DxfFile fp,
DxfTolerance tolerance 
)

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

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

Returns:
a pointer to tolerance, NULL if 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:
fpDXF file pointer to an input file (or device).
tolerancea pointer to the DXF TOLERANCE entity.

Definition at line 168 of file tolerance.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_11, AutoCAD_13, dxf_tolerance::color, dxf_tolerance::dictionary_owner_hard, dxf_tolerance::dictionary_owner_soft, dxf_tolerance::dimstyle_name, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, dxf_tolerance_init(), dxf_tolerance_new(), dxf_tolerance::elevation, dxf_tolerance::extr_x0, dxf_tolerance::extr_y0, dxf_tolerance::extr_z0, dxf_file_struct::filename, dxf_file_struct::fp, dxf_tolerance::id_code, dxf_tolerance::layer, dxf_file_struct::line_number, dxf_tolerance::linetype, dxf_tolerance::linetype_scale, dxf_tolerance::paperspace, dxf_tolerance::thickness, dxf_tolerance::visibility, dxf_tolerance::x0, dxf_tolerance::x1, dxf_tolerance::y0, dxf_tolerance::y1, dxf_tolerance::z0, and dxf_tolerance::z1.

Here is the call graph for this function:

int dxf_tolerance_write ( DxfFile fp,
DxfTolerance tolerance 
)

Write DXF output for a DXF TOLERANCE entity.

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.

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).
tolerancea pointer to the DXF TOLERANCE entity.

Definition at line 424 of file tolerance.c.

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

int dxf_tolerance_free ( DxfTolerance tolerance)

Free the allocated memory for a DXF TOLERANCE 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:
tolerancea pointer to the memory occupied by the DXF TOLERANCE entity.

Definition at line 594 of file tolerance.c.

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

Referenced by dxf_tolerance_free_chain().

void dxf_tolerance_free_chain ( DxfTolerance tolerances)

Free the allocated memory for a chain of DXF TOLERANCE 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:
tolerancesa pointer to the chain of DXF TOLERANCE entities.

Definition at line 644 of file tolerance.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_tolerance_free(), and dxf_tolerance::next.

Here is the call graph for this function: