libDXF 0.0.1
A library with DXF related functions written in C.
Data Structures | Typedefs | Functions

vport.h File Reference

Header file for a DXF Viewport symbol table entry (VPORT). More...

#include "global.h"
Include dependency graph for vport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dxf_vport
 DXF definition of an AutoCAD viewport entity. More...

Typedefs

typedef struct dxf_vport DxfVPort
 DXF definition of an AutoCAD viewport entity.

Functions

DxfVPortdxf_vport_new ()
 Allocate memory for a DXF VPORT entity.
DxfVPortdxf_vport_init (DxfVPort *vport)
 Allocate memory and initialize data fields in a DXF VPORT entity.
DxfVPortdxf_vport_read (DxfFile *fp, DxfVPort *vport)
 Read data from a DXF file into an VPORT symbol table entry.
int dxf_vport_write (DxfFile *fp, DxfVPort *vport)
 Write DXF output to a file for a DXF VPORT symbol table entry.
int dxf_vport_free (DxfVPort *vport)
 Free the allocated memory for a DXF VPORT and all it's data fields.
void dxf_vport_free_chain (DxfVPort *vports)
 Free the allocated memory for a chain of DXF VPORT symbol table and all their data fields.

Detailed Description

Header file for a DXF Viewport symbol table entry (VPORT).

Author:
Copyright (C) 2008, 2012, 2014, 2015, 2016, 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 vport.h.


Typedef Documentation

typedef struct dxf_vport DxfVPort

DXF definition of an AutoCAD viewport entity.

The VPORT table is unique in that it may contain several entries with the same name (indicating a multiple-viewport configuration).
The entries corresponding to the active viewport configuration all have the name *ACTIVE.
The first such entry describes the current viewport.

Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.

Function Documentation

DxfVPort* dxf_vport_new ( )

Allocate memory for a DXF VPORT entity.

Fill the memory contents with zeros.

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

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_vport_init(), and dxf_vport_read().

DxfVPort* dxf_vport_init ( DxfVPort vport)

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

Definition at line 100 of file vport.c.

References _, dxf_vport::back_plane_offset, dxf_vport::circle_zoom_percent, dxf_vport::dictionary_owner_hard, dxf_vport::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_vport_new(), dxf_vport::fast_zoom_setting, dxf_vport::front_plane_offset, dxf_vport::grid_on, dxf_vport::id, dxf_vport::id_code, dxf_vport::lens_length, dxf_vport::next, dxf_vport::snap_isopair, dxf_vport::snap_on, dxf_vport::snap_rotation_angle, dxf_vport::snap_style, dxf_vport::standard_flag, dxf_vport::status_field, dxf_vport::UCSICON_setting, dxf_vport::view_height, dxf_vport::view_mode, dxf_vport::view_twist_angle, dxf_vport::viewport_aspect_ratio, dxf_vport::viewport_name, dxf_vport::x_center, dxf_vport::x_direction, dxf_vport::x_grid_spacing, dxf_vport::x_max, dxf_vport::x_min, dxf_vport::x_snap_base, dxf_vport::x_snap_spacing, dxf_vport::x_target, dxf_vport::y_center, dxf_vport::y_direction, dxf_vport::y_grid_spacing, dxf_vport::y_max, dxf_vport::y_min, dxf_vport::y_snap_base, dxf_vport::y_snap_spacing, dxf_vport::y_target, dxf_vport::z_direction, and dxf_vport::z_target.

Referenced by dxf_vport_read().

Here is the call graph for this function:

DxfVPort* dxf_vport_read ( DxfFile fp,
DxfVPort vport 
)

Read data from a DXF file into an VPORT symbol table entry.

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

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:
fpDXF file pointer to an input file (or device).
vporta pointer to the DXF VPORT symbol table entry.

Definition at line 191 of file vport.c.

References _, dxf_vport::back_plane_offset, dxf_vport::circle_zoom_percent, dxf_vport::dictionary_owner_hard, dxf_vport::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_vport_init(), dxf_vport_new(), dxf_vport::fast_zoom_setting, dxf_file_struct::filename, dxf_file_struct::fp, dxf_vport::front_plane_offset, dxf_vport::grid_on, dxf_vport::id, dxf_vport::id_code, dxf_file_struct::line_number, dxf_vport::snap_isopair, dxf_vport::snap_on, dxf_vport::snap_rotation_angle, dxf_vport::snap_style, dxf_vport::standard_flag, dxf_vport::status_field, dxf_vport::UCSICON_setting, dxf_vport::view_height, dxf_vport::view_mode, dxf_vport::view_twist_angle, dxf_vport::viewport_aspect_ratio, dxf_vport::viewport_name, dxf_vport::x_center, dxf_vport::x_direction, dxf_vport::x_grid_spacing, dxf_vport::x_max, dxf_vport::x_min, dxf_vport::x_snap_base, dxf_vport::x_snap_spacing, dxf_vport::x_target, dxf_vport::y_center, dxf_vport::y_direction, dxf_vport::y_grid_spacing, dxf_vport::y_max, dxf_vport::y_min, dxf_vport::y_snap_base, dxf_vport::y_snap_spacing, dxf_vport::y_target, dxf_vport::z_direction, and dxf_vport::z_target.

Here is the call graph for this function:

int dxf_vport_write ( DxfFile fp,
DxfVPort vport 
)

Write DXF output to a file for a DXF VPORT symbol table entry.

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).
vporta pointer to the DXF VPORT symbol table entry.

Definition at line 554 of file vport.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, dxf_vport::back_plane_offset, dxf_vport::circle_zoom_percent, dxf_vport::dictionary_owner_hard, dxf_vport::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_vport::fast_zoom_setting, dxf_file_struct::fp, dxf_vport::front_plane_offset, dxf_vport::grid_on, dxf_vport::id_code, dxf_vport::lens_length, dxf_vport::snap_isopair, dxf_vport::snap_on, dxf_vport::snap_rotation_angle, dxf_vport::snap_style, dxf_vport::standard_flag, dxf_vport::UCSICON_setting, dxf_vport::view_height, dxf_vport::view_mode, dxf_vport::view_twist_angle, dxf_vport::viewport_aspect_ratio, dxf_vport::viewport_name, dxf_vport::x_center, dxf_vport::x_direction, dxf_vport::x_grid_spacing, dxf_vport::x_max, dxf_vport::x_min, dxf_vport::x_snap_base, dxf_vport::x_snap_spacing, dxf_vport::x_target, dxf_vport::y_center, dxf_vport::y_direction, dxf_vport::y_grid_spacing, dxf_vport::y_max, dxf_vport::y_min, dxf_vport::y_snap_base, dxf_vport::y_snap_spacing, dxf_vport::y_target, dxf_vport::z_direction, and dxf_vport::z_target.

int dxf_vport_free ( DxfVPort vport)

Free the allocated memory for a DXF VPORT 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:
vporta pointer to the memory occupied by the DXF VPORT symbol table entry.

Definition at line 694 of file vport.c.

References _, dxf_vport::dictionary_owner_hard, dxf_vport::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_vport::next, and dxf_vport::viewport_name.

Referenced by dxf_vport_free_chain().

void dxf_vport_free_chain ( DxfVPort vports)

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

Definition at line 742 of file vport.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_vport_free(), and dxf_vport::next.

Here is the call graph for this function: