libDXF 0.0.1
A library with DXF related functions written in C.
|
Header file for a DXF viewport entity (VIEWPORT
).
More...
#include "global.h"
Go to the source code of this file.
Data Structures | |
struct | dxf_viewport |
DXF definition of an AutoCAD viewport entity (VIEWPORT ). More... | |
Typedefs | |
typedef struct dxf_viewport | DxfViewport |
DXF definition of an AutoCAD viewport entity (VIEWPORT ). | |
Functions | |
DxfViewport * | dxf_viewport_new () |
Allocate memory for a DxfViewport . | |
DxfViewport * | dxf_viewport_init (DxfViewport *viewport) |
Allocate memory and initialize data fields in a VIEWPORT entity. | |
DxfViewport * | dxf_viewport_read (DxfFile *fp, DxfViewport *viewport) |
Read data from a DXF file into an VIEWPORT entity. | |
int | dxf_viewport_write (DxfFile *fp, DxfViewport *viewport) |
Write DXF output for a viewport entity ( VIEWPORT ). | |
int | dxf_viewport_free (DxfViewport *viewport) |
Free the allocated memory for a DXF VIEWPORT and all it's data fields. | |
void | dxf_viewport_free_chain (DxfViewport *viewports) |
Free the allocated memory for a chain of DXF VIEWPORT entities and all their data fields. |
Header file for a DXF viewport entity (VIEWPORT
).
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 viewport.h.
typedef struct dxf_viewport DxfViewport |
DXF definition of an AutoCAD viewport entity (VIEWPORT
).
In addition, the extended entity data groups in the following struct apply to viewports.
DxfViewport* dxf_viewport_new | ( | ) |
Allocate memory for a DxfViewport
.
Fill the memory contents with zeros.
Definition at line 50 of file viewport.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_viewport_init(), and dxf_viewport_read().
DxfViewport* dxf_viewport_init | ( | DxfViewport * | viewport | ) |
Allocate memory and initialize data fields in a VIEWPORT
entity.
NULL
when no memory was allocated, a pointer to the allocated memory when succesful.viewport | a pointer to the DXF VIEWPORT entity. |
Definition at line 94 of file viewport.c.
References _, dxf_viewport::app_name, dxf_viewport::back_plane_offset, dxf_viewport::circle_zoom_percent, dxf_viewport::color, dxf_viewport::dictionary_owner_hard, dxf_viewport::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_MAX_LAYERS, DXF_PAPERSPACE, dxf_viewport_new(), dxf_viewport::elevation, dxf_viewport::extended_entity_data_version, dxf_viewport::fast_zoom_setting, dxf_viewport::front_plane_offset, dxf_viewport::frozen_layer_list_begin, dxf_viewport::frozen_layer_list_end, dxf_viewport::frozen_layers, dxf_viewport::grid_on, dxf_viewport::height, dxf_viewport::id, dxf_viewport::id_code, dxf_viewport::layer, dxf_viewport::linetype, dxf_viewport::linetype_scale, dxf_viewport::next, dxf_viewport::paperspace, dxf_viewport::perspective_lens_length, dxf_viewport::plot_flag, dxf_viewport::snap_isopair, dxf_viewport::snap_on, dxf_viewport::snap_rotation_angle, dxf_viewport::snap_style, dxf_viewport::status, dxf_viewport::thickness, dxf_viewport::UCSICON_setting, dxf_viewport::view_height, dxf_viewport::view_mode, dxf_viewport::view_twist_angle, dxf_viewport::viewport_data, dxf_viewport::visibility, dxf_viewport::width, dxf_viewport::window_descriptor_begin, dxf_viewport::window_descriptor_end, dxf_viewport::x0, dxf_viewport::x_center, dxf_viewport::x_direction, dxf_viewport::x_grid_spacing, dxf_viewport::x_snap_base, dxf_viewport::x_snap_spacing, dxf_viewport::x_target, dxf_viewport::y0, dxf_viewport::y_center, dxf_viewport::y_direction, dxf_viewport::y_grid_spacing, dxf_viewport::y_snap_base, dxf_viewport::y_snap_spacing, dxf_viewport::y_target, dxf_viewport::z0, dxf_viewport::z_direction, and dxf_viewport::z_target.
Referenced by dxf_viewport_read().
DxfViewport* dxf_viewport_read | ( | DxfFile * | fp, |
DxfViewport * | viewport | ||
) |
Read data from a DXF file into an VIEWPORT
entity.
The last line read from file contained the string "VIEWPORT".
Now follows some data for the VIEWPORT
, 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 viewport
.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred.fp | DXF file pointer to an input file (or device). |
viewport | a pointer to the DXF VIEWPORT entity. |
Definition at line 212 of file viewport.c.
References _, dxf_file_struct::acad_version_number, dxf_viewport::app_name, AutoCAD_11, dxf_viewport::back_plane_offset, dxf_viewport::circle_zoom_percent, dxf_viewport::color, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, DXF_MAX_LAYERS, dxf_viewport_init(), dxf_viewport_new(), dxf_viewport::extended_entity_data_version, dxf_viewport::fast_zoom_setting, dxf_file_struct::filename, dxf_file_struct::fp, dxf_viewport::front_plane_offset, dxf_viewport::frozen_layer_list_begin, dxf_viewport::frozen_layer_list_end, dxf_viewport::frozen_layers, dxf_viewport::grid_on, dxf_viewport::height, dxf_viewport::id, dxf_viewport::id_code, dxf_viewport::layer, dxf_file_struct::line_number, dxf_viewport::linetype, dxf_viewport::linetype_scale, dxf_viewport::paperspace, dxf_viewport::perspective_lens_length, dxf_viewport::plot_flag, dxf_viewport::snap_isopair, dxf_viewport::snap_on, dxf_viewport::snap_rotation_angle, dxf_viewport::snap_style, dxf_viewport::status, dxf_viewport::thickness, dxf_viewport::UCSICON_setting, dxf_viewport::view_height, dxf_viewport::view_mode, dxf_viewport::view_twist_angle, dxf_viewport::viewport_data, dxf_viewport::visibility, dxf_viewport::width, dxf_viewport::window_descriptor_begin, dxf_viewport::window_descriptor_end, dxf_viewport::x0, dxf_viewport::x_center, dxf_viewport::x_direction, dxf_viewport::x_snap_base, dxf_viewport::x_snap_spacing, dxf_viewport::x_target, dxf_viewport::y0, dxf_viewport::y_center, dxf_viewport::y_direction, dxf_viewport::y_snap_base, dxf_viewport::y_snap_spacing, dxf_viewport::y_target, dxf_viewport::z0, dxf_viewport::z_direction, and dxf_viewport::z_target.
int dxf_viewport_write | ( | DxfFile * | fp, |
DxfViewport * | viewport | ||
) |
Write DXF output for a viewport entity ( VIEWPORT
).
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred.fp | DXF file pointer to an output file (or device). |
viewport | a pointer to the DXF VIEWPORT entity. |
Definition at line 1033 of file viewport.c.
References _, dxf_file_struct::acad_version_number, AutoCAD_11, AutoCAD_13, AutoCAD_14, dxf_viewport::back_plane_offset, dxf_viewport::circle_zoom_percent, dxf_viewport::color, dxf_viewport::dictionary_owner_hard, dxf_viewport::dictionary_owner_soft, DXF_COLOR_BYLAYER, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, DXF_FLATLAND, DXF_MAX_LAYERS, DXF_PAPERSPACE, DXF_VIEWPORT_APP_NAME, DXF_VIEWPORT_DATA, DXF_VIEWPORT_FROZEN_LAYER_LIST_BEGIN, DXF_VIEWPORT_FROZEN_LAYER_LIST_END, DXF_VIEWPORT_WINDOW_BEGIN, DXF_VIEWPORT_WINDOW_END, dxf_viewport::elevation, dxf_viewport::extended_entity_data_version, dxf_viewport::fast_zoom_setting, dxf_file_struct::fp, dxf_viewport::front_plane_offset, dxf_viewport::frozen_layers, dxf_viewport::grid_on, dxf_viewport::height, dxf_viewport::id, dxf_viewport::id_code, dxf_viewport::layer, dxf_viewport::linetype, dxf_viewport::linetype_scale, dxf_viewport::paperspace, dxf_viewport::perspective_lens_length, dxf_viewport::plot_flag, dxf_viewport::snap_isopair, dxf_viewport::snap_on, dxf_viewport::snap_rotation_angle, dxf_viewport::snap_style, dxf_viewport::status, dxf_viewport::thickness, dxf_viewport::UCSICON_setting, dxf_viewport::view_height, dxf_viewport::view_mode, dxf_viewport::view_twist_angle, dxf_viewport::visibility, dxf_viewport::width, dxf_viewport::x0, dxf_viewport::x_center, dxf_viewport::x_direction, dxf_viewport::x_grid_spacing, dxf_viewport::x_snap_base, dxf_viewport::x_snap_spacing, dxf_viewport::x_target, dxf_viewport::y0, dxf_viewport::y_center, dxf_viewport::y_direction, dxf_viewport::y_grid_spacing, dxf_viewport::y_snap_base, dxf_viewport::y_snap_spacing, dxf_viewport::y_target, dxf_viewport::z0, dxf_viewport::z_direction, and dxf_viewport::z_target.
int dxf_viewport_free | ( | DxfViewport * | viewport | ) |
Free the allocated memory for a DXF VIEWPORT
and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred.viewport | a pointer to the memory occupied by the DXF VIEWPORT entity. |
Definition at line 1227 of file viewport.c.
References _, dxf_viewport::app_name, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_MAX_LAYERS, dxf_viewport::frozen_layer_list_begin, dxf_viewport::frozen_layer_list_end, dxf_viewport::frozen_layers, dxf_viewport::layer, dxf_viewport::linetype, dxf_viewport::next, dxf_viewport::viewport_data, dxf_viewport::window_descriptor_begin, and dxf_viewport::window_descriptor_end.
Referenced by dxf_viewport_free_chain().
void dxf_viewport_free_chain | ( | DxfViewport * | viewports | ) |
Free the allocated memory for a chain of DXF VIEWPORT
entities and all their data fields.
viewports | a pointer to the chain of DXF VIEWPORT entities. |
Definition at line 1289 of file viewport.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_viewport_free(), and dxf_viewport::next.