| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes
DL_Writer Class Reference

`#include <dl_writer.h>`

Inheritance diagram for DL_Writer:

List of all members.

## Public Member Functions

| DL_Writer (DL_Codes::version version)
virtual | ~DL_Writer ()
void | section (const char *name) const
void | sectionHeader () const
void | sectionTables () const
void | sectionBlocks () const
void | sectionEntities () const
void | sectionClasses () const
void | sectionObjects () const
void | sectionEnd () const
void | table (const char *name, int num, int handle) const
void | tableLayers (int num) const
void | tableLineTypes (int num) const
void | tableAppid (int num) const
void | tableEnd () const
void | dxfEOF () const
void | comment (const char *text) const
void | entity (const char *entTypeName) const
void | entityAttributes (const DL_Attributes &attrib) const
void | subClass (const char *sub) const
void | tableLayerEntry (unsigned long int h=0) const
void | tableLineTypeEntry (unsigned long int h=0) const
void | tableAppidEntry (unsigned long int h=0) const
void | sectionBlockEntry (unsigned long int h=0) const
void | sectionBlockEntryEnd (unsigned long int h=0) const
void | color (int col=256) const
void | lineType (const char *lt) const
void | lineTypeScale (double scale) const
void | lineWeight (int lw) const
void | coord (int gc, double x, double y, double z=0) const
void | coordTriplet (int gc, const double *value) const
void | resetHandle () const
unsigned long | handle (int gc=5) const
unsigned long | getNextHandle () const
unsigned long | incHandle () const
void | setModelSpaceHandle (unsigned long h)
unsigned long | getModelSpaceHandle ()
void | setPaperSpaceHandle (unsigned long h)
unsigned long | getPaperSpaceHandle ()
void | setPaperSpace0Handle (unsigned long h)
unsigned long | getPaperSpace0Handle ()
virtual void | dxfReal (int gc, double value) const =0
virtual void | dxfInt (int gc, int value) const =0
virtual void | dxfHex (int gc, int value) const =0
virtual void | dxfString (int gc, const char *value) const =0
virtual void | dxfString (int gc, const string &value) const =0

## Protected Attributes

unsigned long | m_handle
unsigned long | modelSpaceHandle
unsigned long | paperSpaceHandle
unsigned long | paperSpace0Handle
DL_Codes::version | version

## Detailed Description

Defines interface for writing low level DXF constructs to a file. Implementation is defined in derived classes that write to binary or ASCII files.

Implements functions that write higher level constructs in terms of the low level ones.

Todo:
  Add error checking for string/entry length.

## Constructor & Destructor Documentation

DL_Writer::DL_Writer | ( | DL_Codes::version | version | ) | `[inline]`

version DXF version. Defaults to VER_2002.

virtual DL_Writer::~DL_Writer | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

void DL_Writer::color | ( | int | col = `256` | ) | const`[inline]`

void DL_Writer::comment | ( | const char * | text | ) | const`[inline]`

Comment.

      999
      text

void DL_Writer::coord | ( | int | gc,
|  | double | x,
|  | double | y,
|  | double | z = `0`
| ) |  | const`[inline]`

void DL_Writer::coordTriplet | ( | int | gc,
|  | const double * | value
| ) |  | const`[inline]`

void DL_Writer::dxfEOF | ( |  | ) | const`[inline]`

End of the DXF file.

       0
      EOF

virtual void DL_Writer::dxfHex | ( | int | gc,
|  | int | value
| ) |  | const`[pure virtual]`

Must be overwritten by the implementing class to write an int value (hex) to the file.

Parameters:

  gc | Group code.
  value | The int value.

Implemented in DL_WriterA.

virtual void DL_Writer::dxfInt | ( | int | gc,
|  | int | value
| ) |  | const`[pure virtual]`

Must be overwritten by the implementing class to write an int value to the file.

Parameters:

  gc | Group code.
  value | The int value.

Implemented in DL_WriterA.

virtual void DL_Writer::dxfReal | ( | int | gc,
|  | double | value
| ) |  | const`[pure virtual]`

Must be overwritten by the implementing class to write a real value to the file.

Parameters:

  gc | Group code.
  value | The real value.

Implemented in DL_WriterA.

virtual void DL_Writer::dxfString | ( | int | gc,
|  | const char * | value
| ) |  | const`[pure virtual]`

Must be overwritten by the implementing class to write a string to the file.

Parameters:

  gc | Group code.
  value | The string.

Implemented in DL_WriterA.

virtual void DL_Writer::dxfString | ( | int | gc,
|  | const string & | value
| ) |  | const`[pure virtual]`

Must be overwritten by the implementing class to write a string to the file.

Parameters:

  gc | Group code.
  value | The string.

Implemented in DL_WriterA.

void DL_Writer::entity | ( | const char * | entTypeName | ) | const`[inline]`

Entity.

       0
      entTypeName

Returns:
  Unique handle or 0.

void DL_Writer::entityAttributes | ( | const DL_Attributes & | attrib | ) | const`[inline]`

Attributes of an entity.

       8
      layer
      62
      color
      39
      width
       6
      linetype

unsigned long DL_Writer::getModelSpaceHandle | ( |  | ) | `[inline]`

unsigned long DL_Writer::getNextHandle | ( |  | ) | const`[inline]`

Returns:
  Next handle that will be written.

unsigned long DL_Writer::getPaperSpace0Handle | ( |  | ) | `[inline]`

unsigned long DL_Writer::getPaperSpaceHandle | ( |  | ) | `[inline]`

unsigned long DL_Writer::handle | ( | int | gc = `5` | ) | const`[inline]`

Writes a unique handle and returns it.

unsigned long DL_Writer::incHandle | ( |  | ) | const`[inline]`

Increases handle, so that the handle returned remains available.

void DL_Writer::lineType | ( | const char * | lt | ) | const`[inline]`

void DL_Writer::lineTypeScale | ( | double | scale | ) | const`[inline]`

void DL_Writer::lineWeight | ( | int | lw | ) | const`[inline]`

void DL_Writer::resetHandle | ( |  | ) | const`[inline]`

void DL_Writer::section | ( | const char * | name | ) | const`[inline]`

Generic section for section 'name'.

       0
      SECTION
       2
      name

void DL_Writer::sectionBlockEntry | ( | unsigned long int | h = `0` | ) | const`[inline]`

Block (must be in the section BLOCKS).

       0
      BLOCK

void DL_Writer::sectionBlockEntryEnd | ( | unsigned long int | h = `0` | ) | const`[inline]`

End of Block (must be in the section BLOCKS).

       0
      ENDBLK

void DL_Writer::sectionBlocks | ( |  | ) | const`[inline]`

Section BLOCKS

       0
      SECTION
       2
      BLOCKS

void DL_Writer::sectionClasses | ( |  | ) | const`[inline]`

Section CLASSES

       0
      SECTION
       2
      CLASSES

void DL_Writer::sectionEnd | ( |  | ) | const`[inline]`

End of a section.

       0
      ENDSEC

void DL_Writer::sectionEntities | ( |  | ) | const`[inline]`

Section ENTITIES

       0
      SECTION
       2
      ENTITIES

void DL_Writer::sectionHeader | ( |  | ) | const`[inline]`

Section HEADER

       0
      SECTION
       2
      HEADER

void DL_Writer::sectionObjects | ( |  | ) | const`[inline]`

Section OBJECTS

       0
      SECTION
       2
      OBJECTS

void DL_Writer::sectionTables | ( |  | ) | const`[inline]`

Section TABLES

       0
      SECTION
       2
      TABLES

void DL_Writer::setModelSpaceHandle | ( | unsigned long | h | ) | `[inline]`

Sets the handle of the model space. Entities refer to this handle.

void DL_Writer::setPaperSpace0Handle | ( | unsigned long | h | ) | `[inline]`

Sets the handle of the paper space 0. Some special blocks refer to this handle.

void DL_Writer::setPaperSpaceHandle | ( | unsigned long | h | ) | `[inline]`

Sets the handle of the paper space. Some special blocks refer to this handle.

void DL_Writer::subClass | ( | const char * | sub | ) | const`[inline]`

Subclass.

void DL_Writer::table | ( | const char * | name,
|  | int | num,
|  | int | handle
| ) |  | const`[inline]`

Generic table for table 'name' with 'num' entries:

       0
      TABLE
       2
      name
      70
       num

void DL_Writer::tableAppid | ( | int | num | ) | const`[inline]`

Table for application id.

Parameters:

  num | Number of registered applications in total.

       0
      TABLE
       2
      APPID
       70
          num

void DL_Writer::tableAppidEntry | ( | unsigned long int | h = `0` | ) | const`[inline]`

Appid (must be in the TABLES section APPID).

       0
      APPID

void DL_Writer::tableEnd | ( |  | ) | const`[inline]`

End of a table.

       0
      ENDTAB

void DL_Writer::tableLayerEntry | ( | unsigned long int | h = `0` | ) | const`[inline]`

Layer (must be in the TABLES section LAYER).

       0
      LAYER

void DL_Writer::tableLayers | ( | int | num | ) | const`[inline]`

Table for layers.

Parameters:

  num | Number of layers in total.

       0
      TABLE
       2
      LAYER
       70
          num

void DL_Writer::tableLineTypeEntry | ( | unsigned long int | h = `0` | ) | const`[inline]`

Line type (must be in the TABLES section LTYPE).

       0
      LTYPE

void DL_Writer::tableLineTypes | ( | int | num | ) | const`[inline]`

Table for line types.

Parameters:

  num | Number of line types in total.

       0
      TABLE
       2
      LTYPE
       70
          num

## Member Data Documentation

unsigned long DL_Writer::m_handle`[mutable, protected]`

unsigned long DL_Writer::modelSpaceHandle`[mutable, protected]`

unsigned long DL_Writer::paperSpace0Handle`[mutable, protected]`

unsigned long DL_Writer::paperSpaceHandle`[mutable, protected]`

DL_Codes::version DL_Writer::version`[protected]`

DXF version to be created.

The documentation for this class was generated from the following file:

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/dxflib/dl_writer.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines