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

block.h File Reference

Header file for a DXF block entity (BLOCK). More...

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

Go to the source code of this file.

Data Structures

struct  dxf_block_struct
 DXF definition of an AutoCAD block entity. More...

Typedefs

typedef struct dxf_block_struct DxfBlock
 DXF definition of an AutoCAD block entity.

Functions

DxfBlockdxf_block_new ()
 Allocate memory for a DxfBlock (a DXF BLOCK entity).
DxfBlockdxf_block_init (DxfBlock *block)
 Allocate memory and initialize data fields in a DxfBlock (a DXF BLOCK entity).
DxfBlockdxf_block_read (DxfFile *fp, DxfBlock *block)
 Read data from a DXF file into a DxfBlock (a DXF BLOCK entity).
int dxf_block_write (DxfFile *fp, DxfBlock *block)
 Write DXF output for a DXF BLOCK entity.
int dxf_block_write_endblk (DxfFile *fp)
int dxf_block_write_table (DxfFile *fp, DxfBlock *blocks_list)
 Write DXF output to a file for a list of block definitions.
int dxf_block_free (DxfBlock *block)
 Free the allocated memory for a DxfBlock (a BLOCK entity) and all it's data fields.
void dxf_block_free_chain (DxfBlock *blocks)
 Free the allocated memory for a chain of DXF BLOCK entities and all their data fields.
char * dxf_block_get_xref_name (DxfBlock *block)
 Get the xref name from a DXF BLOCK entity.
DxfBlockdxf_block_set_xref_name (DxfBlock *block, char *xref_name)
 Set the xref name for a DXF BLOCK entity.
char * dxf_block_get_block_name (DxfBlock *block)
 Get the block name from a DXF BLOCK entity.
DxfBlockdxf_block_set_block_name (DxfBlock *block, char *block_name)
 Set the block name for a DXF BLOCK entity.
char * dxf_block_get_block_name_additional (DxfBlock *block)
 Get the additional block name from a DXF BLOCK entity.
DxfBlockdxf_block_set_block_name_additional (DxfBlock *block, char *block_name_additional)
 Set the additional block name for a DXF BLOCK entity.
char * dxf_block_get_description (DxfBlock *block)
 Get the description from a DXF BLOCK entity.
DxfBlockdxf_block_set_description (DxfBlock *block, char *description)
 Set the description for a DXF BLOCK entity.
int dxf_block_get_id_code (DxfBlock *block)
 Get the ID code from a DXF BLOCK entity.
DxfBlockdxf_block_set_id_code (DxfBlock *block, int id_code)
 Set the ID code for a DXF BLOCK entity.
char * dxf_block_get_layer (DxfBlock *block)
 Get the layer from a DXF BLOCK entity.
DxfBlockdxf_block_set_layer (DxfBlock *block, char *layer)
 Set the layer for a DXF BLOCK entity.
DxfPointdxf_block_get_p0 (DxfBlock *block)
 Get the base point of a DXF BLOCK entity.
DxfBlockdxf_block_set_p0 (DxfBlock *block, DxfPoint *p0)
 Set the base point of a DXF BLOCK entity.
double dxf_block_get_x0 (DxfBlock *block)
 Get the X-value of the base point x0 of a DXF BLOCK entity.
DxfBlockdxf_block_set_x0 (DxfBlock *block, double x0)
 Set the X-value of the base point x0 of a DXF BLOCK entity.
double dxf_block_get_y0 (DxfBlock *block)
 Get the Y-value of the base point y0 of a DXF BLOCK entity.
DxfBlockdxf_block_set_y0 (DxfBlock *block, double y0)
 Set the Y-value of the base point y0 of a DXF BLOCK entity.
double dxf_block_get_z0 (DxfBlock *block)
 Get the Z-value of the base point z0 of a DXF BLOCK entity.
DxfBlockdxf_block_set_z0 (DxfBlock *block, double z0)
 Set the Z-value of the base point z0 of a DXF BLOCK entity.
int dxf_block_get_block_type (DxfBlock *block)
 Get the block type from a DXF BLOCK entity.
DxfBlockdxf_block_set_block_type (DxfBlock *block, int block_type)
 Set the blcok type for a DXF BLOCK entity.
int dxf_block_is_anonymous (DxfBlock *block)
 Test if this block is anonymous.
int dxf_block_has_attributes (DxfBlock *block)
 Test if this block has attributes.
int dxf_block_is_xreferenced (DxfBlock *block)
 Test if this DXF BLOCK is an external refence (Xref).
int dxf_block_is_xdependent (DxfBlock *block)
 Test if this DXF BLOCK is externally dependent on an xref.
int dxf_block_is_xresolved (DxfBlock *block)
 Test if this DXF BLOCK is a resolved external reference, or dependent of an external reference.
int dxf_block_is_referenced (DxfBlock *block)
 Test if this DXF BLOCK is referenced.
double dxf_block_get_extr_x0 (DxfBlock *block)
 Get the X-value of the extrusion vector extr_x0 of a DXF BLOCK entity.
DxfBlockdxf_block_set_extr_x0 (DxfBlock *block, double extr_x0)
 Set the X-value of the extrusion vector extr_x0 of a DXF BLOCK entity.
double dxf_block_get_extr_y0 (DxfBlock *block)
 Get the Y-value of the extrusion vector extr_y0 of a DXF BLOCK entity.
DxfBlockdxf_block_set_extr_y0 (DxfBlock *block, double extr_y0)
 Set the Y-value of the extrusion vector extr_y0 of a DXF BLOCK entity.
double dxf_block_get_extr_z0 (DxfBlock *block)
 Get the Z-value of the extrusion vector extr_z0 of a DXF BLOCK entity.
DxfBlockdxf_block_set_extr_z0 (DxfBlock *block, double extr_z0)
 Set the Z-value of the extrusion vector extr_z0 of a DXF BLOCK entity.
DxfPointdxf_block_get_extrusion_vector_as_point (DxfBlock *block)
 Get the extrusion vector as a DXF POINT entity from a DXF BLOCK entity.
DxfBlockdxf_block_set_extrusion_vector (DxfBlock *block, double extr_x0, double extr_y0, double extr_z0)
 Set the extrusion vector for a DXF BLOCK entity.
char * dxf_block_get_dictionary_owner_soft (DxfBlock *block)
 Get the soft pointer to the dictionary owner from a DXF BLOCK entity.
DxfBlockdxf_block_set_dictionary_owner_soft (DxfBlock *block, char *dictionary_owner_soft)
 Set the pointer to the dictionary_owner_soft for a DXF BLOCK entity.
struct DxfEndblkdxf_block_get_endblk (DxfBlock *block)
 Get the pointer to the DXF ENDBLK (end of block) marker from a DXF BLOCK entity.
DxfBlockdxf_block_set_endblk (DxfBlock *block, struct DxfEndblk *endblk)
 Set the pointer to the DXF ENDBLK (end of block) marker for a DXF BLOCK entity.
DxfBlockdxf_block_get_next (DxfBlock *block)
 Get the pointer to the next DXF BLOCK entity from a DXF BLOCK entity.
DxfBlockdxf_block_set_next (DxfBlock *block, DxfBlock *next)
 Set the pointer to the next DXF BLOCK for a DXF BLOCK entity.
DxfBlockdxf_block_get_last (DxfBlock *block)
 Get the pointer to the last DXF BLOCK entity from a linked list of DXF BLOCK entities.

Detailed Description

Header file for a DXF block entity (BLOCK).

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>.
Version:
According to DXF R10.
According to DXF R11.
According to DXF R12.
According to DXF R13.
According to DXF R14.

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


Typedef Documentation

typedef struct dxf_block_struct DxfBlock

DXF definition of an AutoCAD block entity.

The Blocks section of the DXF file contains all the Block Definitions.
This section contains the entities that make up the Blocks used in the drawing, including anonymous Blocks generated by the HATCH command and by associative dimensioning.
The format of the entities in this section is identical to those in the Entities section described later, so see that section for details.
All entities in the Blocks section appear between Block and Endblk entities.
Block and Endblk entities appear only in the Blocks section.
Block definitions are never nested (that is, no Block or Endblk entity ever appears within another Block-Endblk pair), although a Block definition can contain an INSERT entity.

External References are written in the DXF file as any Block Definition, except they also include a text string (group code 1) of the path and filename of the External Reference.


Function Documentation

DxfBlock* dxf_block_new ( )

Allocate memory for a DxfBlock (a DXF BLOCK entity).

Fill the memory contents with zeros.

Definition at line 54 of file block.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_block_init(), and dxf_block_read().

DxfBlock* dxf_block_init ( DxfBlock block)
DxfBlock* dxf_block_read ( DxfFile fp,
DxfBlock block 
)

Read data from a DXF file into a DxfBlock (a DXF BLOCK entity).

The last line read from file contained the string "BLOCK".
Now follows some data for the BLOCK, 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 dxf_block.

Returns:
a pointer to block.
Todo:
After reading information from the BLOCK entity up until the closing Group code 0, the pointer to the following ENDBLK entity needs to be stored in the current (last) DxfBlock struct member endblk.

Todo:
Resolve this quick hack for preventing an empty block name string in a more elegant manner.

Parameters:
fpDXF file handle of input file (or device).
blockDXF block entity.

Definition at line 159 of file block.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_11, AutoCAD_13, dxf_block_struct::block_name, dxf_block_struct::block_name_additional, dxf_block_struct::block_type, dxf_block_struct::description, dxf_block_struct::dictionary_owner_soft, dxf_block_get_block_name(), dxf_block_get_block_type(), dxf_block_get_layer(), dxf_block_init(), dxf_block_new(), dxf_block_set_block_type(), dxf_block_set_layer(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, dxf_block_struct::extr_x0, dxf_block_struct::extr_y0, dxf_block_struct::extr_z0, dxf_file_struct::filename, dxf_file_struct::fp, dxf_block_struct::id_code, dxf_block_struct::layer, dxf_file_struct::line_number, dxf_block_struct::p0, dxf_point_struct::x0, dxf_block_struct::xref_name, dxf_point_struct::y0, and dxf_point_struct::z0.

Here is the call graph for this function:

int dxf_block_write ( DxfFile fp,
DxfBlock block 
)

Write DXF output for a DXF BLOCK entity.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.

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).
blockDXF block entity

Definition at line 359 of file block.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_13, AutoCAD_14, AutoCAD_2000, dxf_block_get_block_name(), dxf_block_get_block_type(), dxf_block_get_description(), dxf_block_get_dictionary_owner_soft(), dxf_block_get_endblk(), dxf_block_get_id_code(), dxf_block_get_layer(), dxf_block_get_x0(), dxf_block_get_xref_name(), dxf_block_get_y0(), dxf_block_get_z0(), dxf_block_set_description(), dxf_block_set_dictionary_owner_soft(), dxf_block_set_layer(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, dxf_endblk_write(), and dxf_file_struct::fp.

Here is the call graph for this function:

int dxf_block_write_endblk ( DxfFile fp)
int dxf_block_write_table ( DxfFile fp,
DxfBlock blocks_list 
)

Write DXF output to a file for a list of block definitions.

Appears only in the BLOCKS section.

Todo:
Add code here.

Parameters:
fpDXF file pointer to an output file (or device).
blocks_listPointer to a list of block definitions.

Definition at line 523 of file block.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_block_free ( DxfBlock block)

Free the allocated memory for a DxfBlock (a BLOCK entity) and all it's data fields.

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

Definition at line 559 of file block.c.

References _, dxf_block_struct::block_name, dxf_block_struct::block_name_additional, dxf_block_struct::description, dxf_block_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_block_struct::layer, dxf_block_struct::next, and dxf_block_struct::xref_name.

Referenced by dxf_block_free_chain().

void dxf_block_free_chain ( DxfBlock blocks)

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

Parameters:
blockspointer to the chain of DXF BLOCK entities.

Definition at line 603 of file block.c.

References _, dxf_block_free(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::next.

Referenced by dxf_drawing_free().

Here is the call graph for this function:

char* dxf_block_get_xref_name ( DxfBlock block)

Get the xref name from a DXF BLOCK entity.

Returns:
xref name.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 638 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::xref_name.

Referenced by dxf_block_write().

DxfBlock* dxf_block_set_xref_name ( DxfBlock block,
char *  xref_name 
)

Set the xref name for a DXF BLOCK entity.

Parameters:
blocka pointer to a DXF BLOCK entity.
xref_namea string containing the xref name for the entity.

Definition at line 673 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::xref_name.

Referenced by dxf_block_init().

char* dxf_block_get_block_name ( DxfBlock block)

Get the block name from a DXF BLOCK entity.

Returns:
block name.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 716 of file block.c.

References _, dxf_block_struct::block_name, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_block_read(), and dxf_block_write().

DxfBlock* dxf_block_set_block_name ( DxfBlock block,
char *  block_name 
)

Set the block name for a DXF BLOCK entity.

Parameters:
blocka pointer to a DXF BLOCK entity.
block_namea string containing the block name for the entity.

Definition at line 751 of file block.c.

References _, dxf_block_struct::block_name, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_block_init().

char* dxf_block_get_block_name_additional ( DxfBlock block)

Get the additional block name from a DXF BLOCK entity.

Returns:
additional block name.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 794 of file block.c.

References _, dxf_block_struct::block_name_additional, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfBlock* dxf_block_set_block_name_additional ( DxfBlock block,
char *  block_name_additional 
)

Set the additional block name for a DXF BLOCK entity.

Parameters:
blocka pointer to a DXF BLOCK entity.
block_name_additionala string containing the additional block name for the entity.

Definition at line 829 of file block.c.

References _, dxf_block_struct::block_name_additional, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_block_init().

char* dxf_block_get_description ( DxfBlock block)

Get the description from a DXF BLOCK entity.

Returns:
description.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 872 of file block.c.

References _, dxf_block_struct::description, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_block_write().

DxfBlock* dxf_block_set_description ( DxfBlock block,
char *  description 
)

Set the description for a DXF BLOCK entity.

Parameters:
blocka pointer to a DXF BLOCK entity.
descriptiona string containing the description for the entity.

Definition at line 907 of file block.c.

References _, dxf_block_struct::description, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_block_init(), and dxf_block_write().

int dxf_block_get_id_code ( DxfBlock block)

Get the ID code from a DXF BLOCK entity.

Returns:
ID code.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 948 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::id_code.

Referenced by dxf_block_write().

DxfBlock* dxf_block_set_id_code ( DxfBlock block,
int  id_code 
)

Set the ID code for a DXF BLOCK entity.

Parameters:
blocka pointer to a DXF BLOCK entity.
id_codeIdentification number for the entity.
This is to be an unique (sequential) number in the DXF file.

Definition at line 983 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::id_code.

Referenced by dxf_block_init().

char* dxf_block_get_layer ( DxfBlock block)

Get the layer from a DXF BLOCK entity.

Returns:
layer when sucessful, NULL when an error occurred.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 1025 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::layer.

Referenced by dxf_block_read(), and dxf_block_write().

DxfBlock* dxf_block_set_layer ( DxfBlock block,
char *  layer 
)

Set the layer for a DXF BLOCK entity.

Parameters:
blocka pointer to a DXF BLOCK entity.
layera string containing the layer for the entity.

Definition at line 1060 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::layer.

Referenced by dxf_block_init(), dxf_block_read(), and dxf_block_write().

DxfPoint* dxf_block_get_p0 ( DxfBlock block)

Get the base point of a DXF BLOCK entity.

Returns:
the base point.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 1100 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::p0.

Referenced by dxf_block_init().

DxfBlock* dxf_block_set_p0 ( DxfBlock block,
DxfPoint p0 
)

Set the base point of a DXF BLOCK entity.

Returns:
a pointer to a DXF BLOCK entity.
Parameters:
blocka pointer to a DXF BLOCK entity.
p0a pointer to a DXF POINT entity.

Definition at line 1137 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::p0.

Referenced by dxf_block_init().

double dxf_block_get_x0 ( DxfBlock block)

Get the X-value of the base point x0 of a DXF BLOCK entity.

Returns:
the X-value of the base point x0.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 1178 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_block_struct::p0, and dxf_point_struct::x0.

Referenced by dxf_block_write().

DxfBlock* dxf_block_set_x0 ( DxfBlock block,
double  x0 
)

Set the X-value of the base point x0 of a DXF BLOCK entity.

Returns:
a pointer to block when successful, or NULL when an error occurred.
Parameters:
blocka pointer to a DXF BLOCK entity.
x0the X-value of the base point x0 of a DXF ARC entity.

Definition at line 1218 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_block_struct::p0, and dxf_point_struct::x0.

Referenced by dxf_block_init().

double dxf_block_get_y0 ( DxfBlock block)

Get the Y-value of the base point y0 of a DXF BLOCK entity.

Returns:
the Y-value of the base point y0.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 1260 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_block_struct::p0, and dxf_point_struct::y0.

Referenced by dxf_block_write().

DxfBlock* dxf_block_set_y0 ( DxfBlock block,
double  y0 
)

Set the Y-value of the base point y0 of a DXF BLOCK entity.

Returns:
a pointer to block when successful, or NULL when an error occurred.
Parameters:
blocka pointer to a DXF BLOCK entity.
y0the Y-value of the base point y0 of a DXF BLOCK entity.

Definition at line 1300 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_block_struct::p0, and dxf_point_struct::y0.

Referenced by dxf_block_init().

double dxf_block_get_z0 ( DxfBlock block)

Get the Z-value of the base point z0 of a DXF BLOCK entity.

Returns:
the Z-value of the base point z0.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 1342 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_block_struct::p0, and dxf_point_struct::z0.

Referenced by dxf_block_write().

DxfBlock* dxf_block_set_z0 ( DxfBlock block,
double  z0 
)

Set the Z-value of the base point z0 of a DXF BLOCK entity.

Returns:
a pointer to block when successful, or NULL when an error occurred.
Parameters:
blocka pointer to a DXF BLOCK entity.
z0the Z-value of the base point z0 of a DXF BLOCK entity.

Definition at line 1382 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_block_struct::p0, and dxf_point_struct::z0.

Referenced by dxf_block_init().

int dxf_block_get_block_type ( DxfBlock block)

Get the block type from a DXF BLOCK entity.

Returns:
block type.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 1423 of file block.c.

References _, dxf_block_struct::block_type, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_block_read(), and dxf_block_write().

DxfBlock* dxf_block_set_block_type ( DxfBlock block,
int  block_type 
)

Set the blcok type for a DXF BLOCK entity.

Parameters:
blocka pointer to a DXF BLOCK entity.
block_typeblock type for the entity.

Definition at line 1457 of file block.c.

References _, dxf_block_struct::block_type, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_block_init(), and dxf_block_read().

int dxf_block_is_anonymous ( DxfBlock block)

Test if this block is anonymous.

Returns:
TRUE when this block is anonymous, or FALSE when this block is not anonymous.
Parameters:
blockDXF BLOCK entity.

Definition at line 1498 of file block.c.

References _, dxf_block_struct::block_type, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_block_has_attributes ( DxfBlock block)

Test if this block has attributes.

Returns:
TRUE when this block has attributes, or FALSE when this block has no attributes.
Parameters:
blockDXF BLOCK entity.

Definition at line 1529 of file block.c.

References _, dxf_block_struct::block_type, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_block_is_xreferenced ( DxfBlock block)

Test if this DXF BLOCK is an external refence (Xref).

Returns:
TRUE when BLOCK is an external refence, or FALSE when BLOCK is not an external refence.
Parameters:
blockDXF BLOCK entity.

Definition at line 1560 of file block.c.

References _, dxf_block_struct::block_type, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_block_is_xdependent ( DxfBlock block)

Test if this DXF BLOCK is externally dependent on an xref.

Returns:
TRUE when BLOCK is externally dependent on an xref, or FALSE when BLOCK is not externally dependent on an xref.
Parameters:
blockDXF BLOCK entity.

Definition at line 1591 of file block.c.

References _, dxf_block_struct::block_type, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_block_is_xresolved ( DxfBlock block)

Test if this DXF BLOCK is a resolved external reference, or dependent of an external reference.

Returns:
TRUE when BLOCK is a resolved xref, or FALSE when BLOCK is not a resolved xref.
Parameters:
blockDXF BLOCK entity.

Definition at line 1623 of file block.c.

References _, dxf_block_struct::block_type, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_block_is_referenced ( DxfBlock block)

Test if this DXF BLOCK is referenced.

Returns:
TRUE when BLOCK is referenced, or FALSE when BLOCK is not referenced.
Parameters:
blockDXF BLOCK entity.

Definition at line 1654 of file block.c.

References _, dxf_block_struct::block_type, DXF_CHECK_BIT, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

double dxf_block_get_extr_x0 ( DxfBlock block)

Get the X-value of the extrusion vector extr_x0 of a DXF BLOCK entity.

Returns:
the X-value of the extrusion vector extr_x0.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 1685 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::extr_x0.

DxfBlock* dxf_block_set_extr_x0 ( DxfBlock block,
double  extr_x0 
)

Set the X-value of the extrusion vector extr_x0 of a DXF BLOCK entity.

Returns:
a pointer to block when successful, or NULL when an error occurred.
Parameters:
blocka pointer to a DXF BLOCK entity.
extr_x0the X-value of the extrusion vector extr_x0 of a DXF BLOCK entity.

Definition at line 1718 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::extr_x0.

Referenced by dxf_block_init().

double dxf_block_get_extr_y0 ( DxfBlock block)

Get the Y-value of the extrusion vector extr_y0 of a DXF BLOCK entity.

Returns:
the Y-value of the extrusion vector extr_y0.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 1753 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::extr_y0.

DxfBlock* dxf_block_set_extr_y0 ( DxfBlock block,
double  extr_y0 
)

Set the Y-value of the extrusion vector extr_y0 of a DXF BLOCK entity.

Returns:
a pointer to block when successful, or NULL when an error occurred.
Parameters:
blocka pointer to a DXF BLOCK entity.
extr_y0the Y-value of the extrusion vector extr_y0 of a DXF BLOCK entity.

Definition at line 1786 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::extr_y0.

Referenced by dxf_block_init().

double dxf_block_get_extr_z0 ( DxfBlock block)

Get the Z-value of the extrusion vector extr_z0 of a DXF BLOCK entity.

Returns:
the Z-value of the extrusion vector extr_z0.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 1821 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::extr_z0.

DxfBlock* dxf_block_set_extr_z0 ( DxfBlock block,
double  extr_z0 
)

Set the Z-value of the extrusion vector extr_z0 of a DXF BLOCK entity.

Returns:
a pointer to block when successful, or NULL when an error occurred.
Parameters:
blocka pointer to a DXF BLOCK entity.
extr_z0the Z-value of the extrusion vector extr_z0 of a DXF BLOCK entity.

Definition at line 1854 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::extr_z0.

Referenced by dxf_block_init().

DxfPoint* dxf_block_get_extrusion_vector_as_point ( DxfBlock block)

Get the extrusion vector as a DXF POINT entity from a DXF BLOCK entity.

Returns:
a DXF POINT containing the extrusion coordinates.
Warning:
No other members are copied into the DXF POINT.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 1891 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_point_init(), dxf_block_struct::extr_x0, dxf_block_struct::extr_y0, and dxf_block_struct::extr_z0.

Here is the call graph for this function:

DxfBlock* dxf_block_set_extrusion_vector ( DxfBlock block,
double  extr_x0,
double  extr_y0,
double  extr_z0 
)

Set the extrusion vector for a DXF BLOCK entity.

Parameters:
blocka pointer to a DXF BLOCK entity.
extr_x0X-value of the extrusion direction.
extr_y0Y-value of the extrusion direction.
extr_z0Z-value of the extrusion direction.

Definition at line 1932 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_block_struct::extr_x0, dxf_block_struct::extr_y0, and dxf_block_struct::extr_z0.

char* dxf_block_get_dictionary_owner_soft ( DxfBlock block)

Get the soft pointer to the dictionary owner from a DXF BLOCK entity.

Returns:
soft pointer to the dictionary owner.
Warning:
No checks are performed on the returned pointer (string).
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 1974 of file block.c.

References _, dxf_block_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_block_write().

DxfBlock* dxf_block_set_dictionary_owner_soft ( DxfBlock block,
char *  dictionary_owner_soft 
)

Set the pointer to the dictionary_owner_soft for a DXF BLOCK entity.

Parameters:
blocka pointer to a DXF BLOCK entity.
dictionary_owner_softa string containing the pointer to the dictionary_owner_soft for the entity.

Definition at line 2010 of file block.c.

References _, dxf_block_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_block_init(), and dxf_block_write().

struct DxfEndblk* dxf_block_get_endblk ( DxfBlock block) [read]

Get the pointer to the DXF ENDBLK (end of block) marker from a DXF BLOCK entity.

Returns:
pointer to the DXF ENDBLK (end of block) marker.
Warning:
No checks are performed on the returned pointer.
Parameters:
blocka pointer to a DXF BLOCK entity.

Definition at line 2054 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::endblk.

Referenced by dxf_block_write().

DxfBlock* dxf_block_set_endblk ( DxfBlock block,
struct DxfEndblk endblk 
)

Set the pointer to the DXF ENDBLK (end of block) marker for a DXF BLOCK entity.

Parameters:
blocka pointer to a DXF BLOCK entity.
endblka pointerto the DXF ENDBLK (end of block) marker for the entity.

Definition at line 2090 of file block.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_block_struct::endblk.

Referenced by dxf_block_init().

DxfBlock* dxf_block_get_next ( DxfBlock block)

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

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

Definition at line 2134 of file block.c.

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

DxfBlock* dxf_block_set_next ( DxfBlock block,
DxfBlock next 
)

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

Parameters:
blocka pointer to a DXF BLOCK entity.
nexta pointer to the next DXF BLOCK for the entity.

Definition at line 2170 of file block.c.

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

Referenced by dxf_block_init().

DxfBlock* dxf_block_get_last ( DxfBlock block)

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

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

Definition at line 2213 of file block.c.

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