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

view.c File Reference

Functions for a DXF View symbol table entry (VIEW). More...

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

Go to the source code of this file.

Functions

DxfViewdxf_view_new ()
 Allocate memory for a DXF VIEW.
DxfViewdxf_view_init (DxfView *view)
 Allocate memory and initialize data fields in a DXF VIEW entity.
DxfViewdxf_view_read (DxfFile *fp, DxfView *view)
 Read data from a DXF file into a DXF VIEW entity.
int dxf_view_write (DxfFile *fp, DxfView *view)
 Write DXF output to a file for a DXF VIEW entity.
int dxf_view_free (DxfView *view)
 Free the allocated memory for a DXF VIEW and all it's data fields.
void dxf_view_free_chain (DxfView *views)
 Free the allocated memory for a chain of DXF VIEW symbol table and all their data fields.

Detailed Description

Functions for a DXF View symbol table entry (VIEW).

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


Function Documentation

DxfView* dxf_view_new ( )

Allocate memory for a DXF VIEW.

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 53 of file view.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_view_init(), and dxf_view_read().

DxfView* dxf_view_init ( DxfView view)

Allocate memory and initialize data fields in a DXF VIEW 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:
viewa pointer to the DXF VIEW symbol table entry.

Definition at line 97 of file view.c.

References _, dxf_view::back_plane_offset, dxf_view::dictionary_owner_hard, dxf_view::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_view_new(), dxf_view::flag, dxf_view::front_plane_offset, dxf_view::id_code, dxf_view::lens_length, dxf_view::next, dxf_view::view_height, dxf_view::view_mode, dxf_view::view_name, dxf_view::view_twist_angle, dxf_view::view_width, dxf_view::x_direction, dxf_view::x_target, dxf_view::x_view, dxf_view::y_direction, dxf_view::y_target, dxf_view::y_view, dxf_view::z_direction, and dxf_view::z_target.

Referenced by dxf_view_read().

Here is the call graph for this function:

DxfView* dxf_view_read ( DxfFile fp,
DxfView view 
)

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

The last line read from file contained the string "VIEW".
Now follows some data for the VIEW, to be terminated with a " 0" string announcing the following table record, or the end of the TABLE section marker ENDTAB.
While parsing the DXF file store data in view.

Returns:
a pointer to view.
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).
viewa pointer to the DXF VIEW symbol table entry.

Definition at line 167 of file view.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_13, dxf_view::back_plane_offset, dxf_view::dictionary_owner_hard, dxf_view::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_view_init(), dxf_view_new(), dxf_file_struct::filename, dxf_view::flag, dxf_file_struct::fp, dxf_view::front_plane_offset, dxf_view::id_code, dxf_view::lens_length, dxf_file_struct::line_number, dxf_view::view_height, dxf_view::view_mode, dxf_view::view_name, dxf_view::view_twist_angle, dxf_view::view_width, dxf_view::x_direction, dxf_view::x_target, dxf_view::x_view, dxf_view::y_direction, dxf_view::y_target, dxf_view::y_view, dxf_view::z_direction, and dxf_view::z_target.

Here is the call graph for this function:

int dxf_view_write ( DxfFile fp,
DxfView view 
)

Write DXF output to a file for a DXF VIEW 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).
viewa pointer to the DXF VIEW symbol table entry.

Definition at line 406 of file view.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, dxf_view::back_plane_offset, dxf_view::dictionary_owner_hard, dxf_view::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_view::flag, dxf_file_struct::fp, dxf_view::front_plane_offset, dxf_view::id_code, dxf_view::lens_length, dxf_view::view_height, dxf_view::view_mode, dxf_view::view_name, dxf_view::view_twist_angle, dxf_view::view_width, dxf_view::x_direction, dxf_view::x_target, dxf_view::x_view, dxf_view::y_direction, dxf_view::y_target, dxf_view::y_view, dxf_view::z_direction, and dxf_view::z_target.

int dxf_view_free ( DxfView view)

Free the allocated memory for a DXF VIEW 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:
viewa pointer to the DXF VIEW symbol table entry.

Definition at line 526 of file view.c.

References _, dxf_view::dictionary_owner_hard, dxf_view::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_view::next, and dxf_view::view_name.

Referenced by dxf_view_free_chain().

void dxf_view_free_chain ( DxfView views)

Free the allocated memory for a chain of DXF VIEW symbol table 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:
viewsa pointer to the chain of DXF VIEW symbol table entries.

Definition at line 573 of file view.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_view_free(), and dxf_view::next.

Here is the call graph for this function: