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

drawing.h File Reference

Prototypes for a libDXF drawing. More...

#include "global.h"
#include "header.h"
#include "class.h"
#include "tables.h"
#include "block.h"
#include "entities.h"
#include "object.h"
#include "thumbnail.h"
Include dependency graph for drawing.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dxf_drawing_struct
 Definition of a DXF drawing. More...

Typedefs

typedef struct dxf_drawing_struct DxfDrawing
 Definition of a DXF drawing.

Functions

DxfDrawingdxf_drawing_new ()
 Allocate memory for a libDXF drawing.
DxfDrawingdxf_drawing_init (DxfDrawing *drawing, int acad_version_number)
 Allocate memory and initialize data fields in a libDXF drawing.
int dxf_drawing_free (DxfDrawing *drawing)
 Free the allocated memory for a libDXF drawing and all it's data fields.
DxfHeaderdxf_drawing_get_header (DxfDrawing *drawing)
 Get the header from a libDXF drawing.
DxfDrawingdxf_drawing_set_header (DxfDrawing *drawing, DxfHeader *header)
 Set the header for a libDXF drawing.
DxfClassdxf_drawing_get_class_list (DxfDrawing *drawing)
 Get the first entry to the Classes list from a libDXF drawing.
DxfDrawingdxf_drawing_set_class_list (DxfDrawing *drawing, DxfClass *class_list)
 Set the first entry to the Classes list for a libDXF drawing.
DxfTablesdxf_drawing_get_tables_list (DxfDrawing *drawing)
 Get the first entry to the Tables list from a libDXF drawing.
DxfDrawingdxf_drawing_set_tables_list (DxfDrawing *drawing, DxfTables *tables_list)
 Set the first entry to the Tables list for a libDXF drawing.
DxfBlockdxf_drawing_get_block_list (DxfDrawing *drawing)
 Get the first entry to the Block list from a libDXF drawing.
DxfDrawingdxf_drawing_set_block_list (DxfDrawing *drawing, DxfBlock *block_list)
 Set the first entry to the Block list for a libDXF drawing.
DxfEntitiesdxf_drawing_get_entities_list (DxfDrawing *drawing)
 Get the first entry to the Entities list from a libDXF drawing.
DxfDrawingdxf_drawing_set_entities_list (DxfDrawing *drawing, DxfEntities *entities_list)
 Set the first entry to the Entities list for a libDXF drawing.
DxfObjectdxf_drawing_get_object_list (DxfDrawing *drawing)
 Get the first entry to the Object list from a libDXF drawing.
DxfDrawingdxf_drawing_set_object_list (DxfDrawing *drawing, DxfObject *object_list)
 Set the first entry to the Object list for a libDXF drawing.
DxfThumbnaildxf_drawing_get_thumbnail (DxfDrawing *drawing)
 Get the thumbnail from a libDXF drawing.
DxfDrawingdxf_drawing_set_thumbnail (DxfDrawing *drawing, DxfThumbnail *thumbnail)
 Set the thumbnail for a libDXF drawing.

Detailed Description

Prototypes for a libDXF drawing.

Author:
Copyright (C) 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 drawing.h.


Typedef Documentation

Definition of a DXF drawing.


Function Documentation

DxfDrawing* dxf_drawing_new ( )

Allocate memory for a libDXF drawing.

Fill the memory contents with zeros.

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

Definition at line 47 of file drawing.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_drawing_init().

DxfDrawing* dxf_drawing_init ( DxfDrawing drawing,
int  acad_version_number 
)

Allocate memory and initialize data fields in a libDXF drawing.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Parameters:
drawinga pointer to the libDXF drawing.
acad_version_numberAutoCAD version number.

Definition at line 84 of file drawing.c.

References _, dxf_drawing_struct::block_list, dxf_drawing_struct::class_list, dxf_block_init(), dxf_class_init(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_drawing_new(), dxf_header_init(), dxf_object_init(), dxf_thumbnail_init(), dxf_drawing_struct::header, dxf_drawing_struct::object_list, and dxf_drawing_struct::thumbnail.

Here is the call graph for this function:

int dxf_drawing_free ( DxfDrawing drawing)

Free the allocated memory for a libDXF drawing and all it's data fields.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.
Parameters:
drawinga pointer to the memory occupied by the libDXF drawing.

Definition at line 131 of file drawing.c.

References _, dxf_drawing_struct::block_list, dxf_drawing_struct::class_list, dxf_block_free_chain(), dxf_class_free_chain(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_header_free(), dxf_object_free_chain(), dxf_thumbnail_free(), dxf_drawing_struct::header, dxf_drawing_struct::object_list, and dxf_drawing_struct::thumbnail.

Here is the call graph for this function:

DxfHeader* dxf_drawing_get_header ( DxfDrawing drawing)

Get the header from a libDXF drawing.

Returns:
header when successful, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.

Definition at line 170 of file drawing.c.

References _, DEBUG, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_drawing_struct::header.

DxfDrawing* dxf_drawing_set_header ( DxfDrawing drawing,
DxfHeader header 
)

Set the header for a libDXF drawing.

Returns:
a pointer to the libDXF drawing when OK, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.
headera string containing the header for the libDXF drawing.

Definition at line 211 of file drawing.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_drawing_struct::header.

DxfClass* dxf_drawing_get_class_list ( DxfDrawing drawing)

Get the first entry to the Classes list from a libDXF drawing.

Returns:
class_list when sucessful, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.

Definition at line 252 of file drawing.c.

References _, dxf_drawing_struct::class_list, DEBUG, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfDrawing* dxf_drawing_set_class_list ( DxfDrawing drawing,
DxfClass class_list 
)

Set the first entry to the Classes list for a libDXF drawing.

Returns:
a pointer to the libDXF drawing when OK, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.
class_lista pointer containing the first entry to the Classes list for the libDXF drawing.

Definition at line 293 of file drawing.c.

References _, dxf_drawing_struct::class_list, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfTables* dxf_drawing_get_tables_list ( DxfDrawing drawing)

Get the first entry to the Tables list from a libDXF drawing.

Returns:
tables_list when sucessful, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.

Definition at line 334 of file drawing.c.

References _, DEBUG, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_drawing_struct::tables_list.

DxfDrawing* dxf_drawing_set_tables_list ( DxfDrawing drawing,
DxfTables tables_list 
)

Set the first entry to the Tables list for a libDXF drawing.

Returns:
a pointer to the libDXF drawing when OK, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.
tables_lista pointer containing the first entry to the Tables list for the libDXF drawing.

Definition at line 375 of file drawing.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_drawing_struct::tables_list.

DxfBlock* dxf_drawing_get_block_list ( DxfDrawing drawing)

Get the first entry to the Block list from a libDXF drawing.

Returns:
block_list when sucessful, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.

Definition at line 416 of file drawing.c.

References _, dxf_drawing_struct::block_list, DEBUG, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfDrawing* dxf_drawing_set_block_list ( DxfDrawing drawing,
DxfBlock block_list 
)

Set the first entry to the Block list for a libDXF drawing.

Returns:
a pointer to the libDXF drawing when OK, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.
block_lista pointer containing the first entry to the Block list for the libDXF drawing.

Definition at line 457 of file drawing.c.

References _, dxf_drawing_struct::block_list, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfEntities* dxf_drawing_get_entities_list ( DxfDrawing drawing)

Get the first entry to the Entities list from a libDXF drawing.

Returns:
entities_list when sucessful, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.

Definition at line 499 of file drawing.c.

References _, DEBUG, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_drawing_struct::entities_list.

DxfDrawing* dxf_drawing_set_entities_list ( DxfDrawing drawing,
DxfEntities entities_list 
)

Set the first entry to the Entities list for a libDXF drawing.

Returns:
a pointer to the libDXF drawing when OK, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.
entities_lista pointer containing the first entry to the Entities list for the libDXF drawing.

Definition at line 540 of file drawing.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_drawing_struct::entities_list.

DxfObject* dxf_drawing_get_object_list ( DxfDrawing drawing)

Get the first entry to the Object list from a libDXF drawing.

Returns:
object_list when sucessful, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.

Definition at line 582 of file drawing.c.

References _, DEBUG, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_drawing_struct::object_list.

DxfDrawing* dxf_drawing_set_object_list ( DxfDrawing drawing,
DxfObject object_list 
)

Set the first entry to the Object list for a libDXF drawing.

Returns:
a pointer to the libDXF drawing when OK, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.
object_lista pointer containing the first entry to the Object list for the libDXF drawing.

Definition at line 623 of file drawing.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_drawing_struct::object_list.

DxfThumbnail* dxf_drawing_get_thumbnail ( DxfDrawing drawing)

Get the thumbnail from a libDXF drawing.

Returns:
thumbnail when sucessful, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.

Definition at line 664 of file drawing.c.

References _, DEBUG, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_drawing_struct::thumbnail.

DxfDrawing* dxf_drawing_set_thumbnail ( DxfDrawing drawing,
DxfThumbnail thumbnail 
)

Set the thumbnail for a libDXF drawing.

Returns:
a pointer to the libDXF drawing when OK, NULL when an error occurred.
Parameters:
drawinga pointer to a libDXF drawing.
thumbnaila pointer containing the thumbnail for the libDXF drawing.

Definition at line 705 of file drawing.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_drawing_struct::thumbnail.