
Public Types | |
| enum | EEntityType { EETPolyline = 1, EETText = 2, EETPoint = 3, EETLWPolyline = 4, EETInsert = 5 } |
| Entity type. More... | |
| enum | ELineType |
| Enumeration of line types. | |
Public Member Functions | |
| virtual void | BlockEnded () |
| Called when a block has ended. | |
| virtual void | BlocksEnded () |
| Called when a block has ended. | |
| virtual void | BlocksStarted () |
| Called when a block has started. | |
| virtual void | BlockStarted () |
| Called when a block has started. | |
| DXFParser () | |
| Ctor. | |
| virtual void | EntitiesEnded () |
| Called when entities section has ended. | |
| virtual void | EntitiesStarted () |
| called when entities section has started | |
| virtual void | EntityEnded () |
| Called when an entity has ended. | |
| virtual void | EntityStarted () |
| Called when an entity has started. | |
| virtual void | HeaderEnded () |
| Called when header has ended. | |
| virtual void | HeaderStarted () |
| Called when header has started. | |
| int | Read (wxString const &filename) |
| Call this to start parsing. | |
| virtual void | TableEnded () |
| Called when a table has ended. | |
| virtual void | TablesEnded () |
| Called when table section has ended. | |
| virtual void | TablesStarted () |
| Called when table section has started. | |
| virtual void | TableStarted () |
| Called when a table has started. | |
| virtual | ~DXFParser () |
| Dtor. | |
Static Public Member Functions | |
| static void | ColorIdxToRGB (int idx, unsigned char &r, unsigned char &g, unsigned char &b) |
| Called when an INSERT has started. | |
Static Public Attributes | |
| static wxNode * | cpColorNode |
| Current color node. | |
Protected Attributes | |
| DXFBlock | cBlock |
| Last read block. | |
| EEntityType | cEntityType |
| Type of last read entity. Defines which of cPoint, cPolyline and cLWPolyline was filled last. | |
| DXFHeader * | cHeader |
| Last read header. | |
| std::list< wxString > | cLayerNames |
| List of layer names. | |
| DXFLWPolyline * | cLWPolyline |
| Last read LW polyline. | |
| DXFVertex | cPoint |
| Last read point. | |
| DXFPolyline * | cPolyline |
| Last read poly line. | |
| DXFTable * | cTable |
| Last read table. | |
Private Member Functions | |
| void | _Error (char const *pError) |
| Notify error. | |
| void | _Parse () |
| Parse the current file. | |
| void | _ParseBlock () |
| Parse all blocks. | |
| void | _ParseBlocks () |
| Parse all blocks. | |
| void | _ParseEntities () |
| Parse all blocks. | |
| void | _ParseHatch () |
| Parse HATCH. | |
| void | _ParseHeader () |
| Parses the header. | |
| void | _ParseInsert () |
| Parse insert entity. | |
| void | _ParseLayer () |
| Parse layer. | |
| void | _ParseLayerName () |
| Parse alyer name. | |
| void | _ParseLine () |
| Parse a line. | |
| void | _ParseLWPolyline () |
| Parse LW Poly line. | |
| void | _ParsePoint () |
| void | _ParsePolyline () |
| Parse a poly line. | |
| void | _ParseSection () |
| Parses a section. | |
| void | _ParseSolid () |
| Parse a solid. | |
| void | _ParseTable () |
| Parse a table. | |
| void | _ParseTables () |
| Parse tables. | |
| void | _ParseText () |
| Parse a text. | |
| void | _ParseVariable () |
| Parse some of the header variables. | |
| void | _ParseVertex () |
| Parse a vertex. | |
| void | _ReadPoint (unsigned int const &start=10) |
| Reads a 2D or 3D point. | |
| int | GetNext () |
| Reads a pair of cGroup and cValueString from the following two lines. | |
Private Attributes | |
| unsigned long | cCurrentLine |
| Current line number. | |
| unsigned int | cGroup |
| The integer group code defining how next line is interpreted. | |
| char | cGroupString [256] |
| Helper to get the cGroup. | |
| FILE * | cpFile |
| The file being read. | |
| char | cValue [256] |
| The string value, if the cGroup indicates that cValueString is of string type. | |
| char | cValueString [256] |
| The value at the line after a group code. | |
Classes | |
| class | DXFBlock |
| A DXF block. More... | |
| class | DXFHeader |
| DXF Header. More... | |
| class | DXFLayer |
| A DXF layer. More... | |
| class | DXFLayerName |
| A DXF layer name. More... | |
| class | DXFLWPolyline |
| LW (Leight weight?) poly line. More... | |
| class | DXFPoint |
| A DXF point. More... | |
| class | DXFPolyline |
| A poly line. More... | |
| class | DXFTable |
| A DXF table. More... | |
| class | DXFVertex |
| A DXF vertex. More... | |
A "SAX" class rather than "DOM" class. Nothing is saved. The class provides hooks to be implemented in sub classes to take actions when different group codes are found.
| strategis::DXFParser::DXFParser | ( | ) |
Ctor.
Sets cHeader, cTable and cPolyline to NULL.
| virtual strategis::DXFParser::~DXFParser | ( | ) | [virtual] |
Dtor.
Deltes cHeader, cTable and cPolyline.
| void strategis::DXFParser::_Parse | ( | ) | [private] |
Parse the current file.
The starting point for parsing a file. Calls _ParseSection for all "SECTION" elements in the file
| void strategis::DXFParser::_ParseBlock | ( | ) | [private] |
Parse all blocks.
| Entity found | Calls method |
|---|---|
| POLYLINE | _ParsePolyline() |
| POINT | _ParsePoint() |
| TEXT | _ParseText() |
| LWPOLYLINE | _ParseLWPolyline() |
| LINE | _ParseLine() |
| void strategis::DXFParser::_ParseBlocks | ( | ) | [private] |
Parse all blocks.
| Entity found | Calls method |
|---|---|
| POLYLINE | _ParsePolyline() |
| POINT | _ParsePoint() |
| TEXT | _ParseText() |
| LWPOLYLINE | _ParseLWPolyline() |
| LINE | _ParseLine() |
| void strategis::DXFParser::_ParseEntities | ( | ) | [private] |
Parse all blocks.
| Entity found | Calls method |
|---|---|
| POLYLINE | _ParsePolyline() |
| POINT | _ParsePoint() |
| TEXT | _ParseText() |
| LWPOLYLINE | _ParseLWPolyline() |
| LINE | _ParseLine() |
| void strategis::DXFParser::_ParseHatch | ( | ) | [private] |
| void strategis::DXFParser::_ParseHeader | ( | ) | [private] |
Parses the header.
| void strategis::DXFParser::_ParseInsert | ( | ) | [private] |
Parse insert entity.
| Group code | Action |
|---|---|
| 0 | Stop parsing. |
| 10, 20, 30 | Read X, Y, Z. |
| 2 | Set block name. |
| 8 | Set layer name |
| void strategis::DXFParser::_ParseLayer | ( | ) | [private] |
| void strategis::DXFParser::_ParseLayerName | ( | ) | [private] |
Parse alyer name.
Adds layer to DXFParser::cLayerNames if cGroup is 8 and cValue is not already added.
| void strategis::DXFParser::_ParseLine | ( | ) | [private] |
Parse a line.
| Group code | Action |
|---|---|
| 0 | Return. |
| 10 | Read first point |
| 11 | Read second point |
| 8 | Layer name |
| void strategis::DXFParser::_ParseLWPolyline | ( | ) | [private] |
Parse LW Poly line.
| Group code | Action |
|---|---|
| 0 | Call EntityEnded() and return. |
| 38 | Elevation |
| 70 | Closed/open, plinegen etc. |
| 90 | Number of points |
| 62 | Color |
| 10, 20, 30 | Point |
| 100 | 2D/3D |
| 210, 220, 230 | Extrusion direction |
| 6 | Line type |
| 8 | Layer name |
| void strategis::DXFParser::_ParsePoint | ( | ) | [private] |
Parse a point Parse a solid
| void strategis::DXFParser::_ParsePolyline | ( | ) | [private] |
Parse a poly line.
| Group code | Action |
|---|---|
| 0 | If "VERTEX", call _ParseVertex(). If "SEQEND", stop. |
| 70 | Set if 2D/3D and if closed/open. |
| 62 | Set color |
| 6 | Set Continuous etc. |
| 8 | Set layer name |
| void strategis::DXFParser::_ParseSection | ( | ) | [private] |
Parses a section.
Calls the following methods:
| Section found | Calls method |
|---|---|
| HEADER | _ParseHeader() |
| TABLES | _ParseTables() |
| BLOCKS | _ParseBlocks() |
| ENTITIES | _ParseEntities() |
| void strategis::DXFParser::_ParseSolid | ( | ) | [private] |
Parse a solid.
| Group code | Action |
|---|---|
| 0 | Return. |
| 10 | Read first point |
| 11 | Read second point |
| 12 | Read third point |
| 13 | Read fourth point |
| 8 | Layer name |
| void strategis::DXFParser::_ParseTable | ( | ) | [private] |
Parse a table.
| void strategis::DXFParser::_ParseTables | ( | ) | [private] |
Parse tables.
| void strategis::DXFParser::_ParseText | ( | ) | [private] |
Parse a text.
| Group code | Action |
|---|---|
| 0 | Return. |
| 10 | Read first point |
| 1 | Read the text |
| 8 | Layer name |
| void strategis::DXFParser::_ParseVariable | ( | ) | [private] |
Parse some of the header variables.
Parses $EXTMIN, $EXTMAX,$LIMMIN, $LIMMAX, $UCSORG
| void strategis::DXFParser::_ParseVertex | ( | ) | [private] |
Parse a vertex.
| Group code | Action |
|---|---|
| 0 | Return. |
| 10 | Read point |
| 8 | Layer name |
| void strategis::DXFParser::_ReadPoint | ( | unsigned int const & | start = 10 |
) | [private] |
Reads a 2D or 3D point.
Reads X at start, Y at start+1, and Z at start+2. Result is stored in DXFParser::cPoint.
| start | Points start at multiples of 10, e.g. 10, 20, 30 etc. This varaible stated the start of the point to read |
| static void strategis::DXFParser::ColorIdxToRGB | ( | int | idx, | |
| unsigned char & | r, | |||
| unsigned char & | g, | |||
| unsigned char & | b | |||
| ) | [static] |
Called when an INSERT has started.
Called when an INSERT has ended Convert color index to RGB
| virtual void strategis::DXFParser::EntitiesEnded | ( | ) | [inline, virtual] |
Called when entities section has ended.
The last read entity is stored in internal member for the type
| virtual void strategis::DXFParser::EntitiesStarted | ( | ) | [inline, virtual] |
| virtual void strategis::DXFParser::EntityEnded | ( | ) | [inline, virtual] |
Called when an entity has ended.
Last entity is found in DXFParser::cPoint, DXFParser::cPolyline, or DXFParser::cLWPolyline depending on DXFParser::cEntityType.
Reimplemented in strategis::DXFLoadGraphics, and strategis::DXF2Arcgen.
| virtual void strategis::DXFParser::EntityStarted | ( | ) | [inline, virtual] |
| virtual void strategis::DXFParser::HeaderEnded | ( | ) | [inline, virtual] |
Called when header has ended.
The last read header is stored in DXFParser::cHeader
Reimplemented in strategis::DXFLoadGraphics.
| int strategis::DXFParser::Read | ( | wxString const & | filename | ) |
| virtual void strategis::DXFParser::TablesEnded | ( | ) | [inline, virtual] |
Called when table section has ended.
The last read table is stored in DXFParser::cTable
| virtual void strategis::DXFParser::TablesStarted | ( | ) | [inline, virtual] |
| virtual void strategis::DXFParser::TableStarted | ( | ) | [inline, virtual] |