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

object.h File Reference

Header file for a DXF object entity functions. More...

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

Go to the source code of this file.

Data Structures

struct  dxf_object_struct
 DXF definition of an object. More...

Typedefs

typedef struct dxf_object_struct DxfObject
 DXF definition of an object.

Functions

DxfObjectdxf_object_new ()
 Allocate memory for a DXF object.
DxfObjectdxf_object_init (DxfObject *object)
 Allocate memory and initialize data fields in a DXF OBJECT entity.
int dxf_object_write_objects (DxfFile *fp, DxfObject *dxf_objects_list)
 Write DXF output to a file for a table of objects.
int dxf_object_free (DxfObject *object)
 Free the allocated memory for a DXF object and all it's data fields.
void dxf_object_free_chain (DxfObject *objects)
 Free the allocated memory for a chain of DXF objects and all their data fields.
DxfEntityTypedxf_object_get_entity_type (DxfObject *object)
 Get the entity_type from a DXF OBJECT entity.
DxfObjectdxf_object_set_entity_type (DxfObject *object, DxfEntityType entity_type)
 Set the entity_type to the DXF OBJECT entity.
DxfObjectdxf_object_get_next (DxfObject *object)
 Get the pointer to the next OBJECT entity from a DXF OBJECT entity.
DxfObjectdxf_object_set_next (DxfObject *object, DxfObject *next)
 Set the pointer to the next OBJECT for a DXF OBJECT entity.
DxfObjectdxf_object_get_last (DxfObject *object)
 Get the pointer to the last OBJECT entity from a linked list of DXF OBJECT entities.

Detailed Description

Header file for a DXF object entity functions.

Author:
Copyright (C) 2008, 2009, 2010, 2012, 2014, 2015, 2016, 2017 by Bert Timmerman <bert.timmerman@xs4all.nl>.
Copyright (C) 2010 by Luis Matos <gass@otiliamatos.ath.cx>.

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 object.h.


Typedef Documentation

typedef struct dxf_object_struct DxfObject

DXF definition of an object.


Function Documentation

DxfObject* dxf_object_new ( )

Allocate memory for a DXF object.

Fill the memory contents with zeros.

Definition at line 45 of file object.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_object_init().

DxfObject* dxf_object_init ( DxfObject object)

Allocate memory and initialize data fields in a DXF OBJECT entity.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.

Todo:
Add code for initialising a DxfParam.

Parameters:
objectDXF object entity.

Definition at line 83 of file object.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_MAX_PARAM, dxf_object_new(), and UNKNOWN_ENTITY.

Referenced by dxf_drawing_init().

Here is the call graph for this function:

int dxf_object_write_objects ( DxfFile fp,
DxfObject dxf_objects_list 
)

Write DXF output to a file for a table of objects.

Appears only in TABLES section.

Todo:
Add code here.

Parameters:
fpDXF file pointer to an output file (or device).
dxf_objects_listPointer to a list of DXF objects.

Definition at line 128 of file object.c.

References DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_object_free ( DxfObject object)

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

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Parameters:
objectPointer to the memory occupied by the DXF object entity.

Definition at line 155 of file object.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_object_struct::next.

Referenced by dxf_object_free_chain().

void dxf_object_free_chain ( DxfObject objects)

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

Parameters:
objectsa pointer to the chain of DXF objects.

Definition at line 195 of file object.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_object_free(), and dxf_object_struct::next.

Referenced by dxf_drawing_free().

Here is the call graph for this function:

DxfEntityType* dxf_object_get_entity_type ( DxfObject object)

Get the entity_type from a DXF OBJECT entity.

Returns:
entity_type.
Warning:
No checks are performed on the returned pointer.
Parameters:
objecta pointer to a DXF OBJECT entity.

Definition at line 230 of file object.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_object_struct::entity_type.

DxfObject* dxf_object_set_entity_type ( DxfObject object,
DxfEntityType  entity_type 
)

Set the entity_type to the DXF OBJECT entity.

Parameters:
objectan DXF OBJECT entity.
entity_typea pointer to the entity_type for the DXF OBJECT entity.

Definition at line 264 of file object.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_object_struct::entity_type.

DxfObject* dxf_object_get_next ( DxfObject object)

Get the pointer to the next OBJECT entity from a DXF OBJECT entity.

Returns:
pointer to the next OBJECT entity.
Warning:
No checks are performed on the returned pointer.
Parameters:
objecta pointer to a DXF OBJECT entity.

Definition at line 308 of file object.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_object_struct::next.

DxfObject* dxf_object_set_next ( DxfObject object,
DxfObject next 
)

Set the pointer to the next OBJECT for a DXF OBJECT entity.

Parameters:
objecta pointer to a DXF OBJECT entity.
nexta pointer to the next OBJECT for the entity.

Definition at line 344 of file object.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfObject* dxf_object_get_last ( DxfObject object)

Get the pointer to the last OBJECT entity from a linked list of DXF OBJECT entities.

Returns:
pointer to the last OBJECT entity.
Warning:
No checks are performed on the returned pointer.
Parameters:
objecta pointer to a DXF OBJECT entity.

Definition at line 387 of file object.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_object_struct::next.