STLAsciiParse Class Reference

Internal class used when parsing STL ASCII format. More...

Inheritance diagram for STLAsciiParse:
[legend]
Collaboration diagram for STLAsciiParse:
[legend]

Public Member Functions

 STLAsciiParse (const label approxNpoints)
 From input stream and the approximate number of vertices in the STL. More...
 
void clear ()
 Reset stored values. More...
 
bool sorted () const
 Do all the solid groups appear in order? More...
 
DynamicList< STLpoint > & points ()
 A list of unstitched triangle points. More...
 
DynamicList< label > & facets ()
 
DynamicList< word > & names ()
 Solid names in the order of their appearance. More...
 
DynamicList< label > & sizes ()
 Solid sizes in the order of their appearance. More...
 

Protected Member Functions

void beginSolid (word solidName)
 Action when entering 'solid'. More...
 
void beginFacet ()
 Action when entering 'facet'. More...
 
void resetVertex ()
 Reset vertex component to zero. More...
 
bool addVertexComponent (float val)
 Add next vertex component. On each third call, adds the point. More...
 
bool addVertexComponent (const char *text)
 Add next vertex component. On each third call, adds the point. More...
 
void endFacet ()
 Action on 'endfacet'. More...
 
 STLAsciiParse (const STLAsciiParse &)=delete
 No copy construct. More...
 
void operator= (const STLAsciiParse &)=delete
 No copy assignment. More...
 

Protected Attributes

bool sorted_
 
label groupId_
 
label lineNum_
 
int nFacetPoints_
 The number of local points on the current facet. More...
 
int nVertexCmpt_
 Current vertex component when reading 'vertex'. More...
 
STLpoint currVertex_
 Scratch space for reading 'vertex'. More...
 
DynamicList< STLpointpoints_
 
DynamicList< label > facets_
 
DynamicList< wordnames_
 
DynamicList< label > sizes_
 
HashTable< label > nameLookup_
 

Detailed Description

Internal class used when parsing STL ASCII format.

Source files

Definition at line 54 of file STLAsciiParse.H.

Constructor & Destructor Documentation

◆ STLAsciiParse() [1/2]

STLAsciiParse ( const STLAsciiParse )
protecteddelete

No copy construct.

◆ STLAsciiParse() [2/2]

STLAsciiParse ( const label  approxNpoints)
inline

From input stream and the approximate number of vertices in the STL.

Definition at line 133 of file STLAsciiParseI.H.

Member Function Documentation

◆ beginSolid()

void beginSolid ( word  solidName)
inlineprotected

Action when entering 'solid'.

Definition at line 30 of file STLAsciiParseI.H.

References DynamicList< T, SizeMin >::append(), HashTable< T, Key, Hash >::cfind(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, STLAsciiParse::groupId_, HashTable< T, Key, Hash >::insert(), STLAsciiParse::nameLookup_, STLAsciiParse::names_, UList< T >::size(), STLAsciiParse::sizes_, and STLAsciiParse::sorted_.

Referenced by STLAsciiParseManual::execute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ beginFacet()

void beginFacet ( )
inlineprotected

Action when entering 'facet'.

Definition at line 63 of file STLAsciiParseI.H.

Referenced by STLAsciiParseManual::execute().

Here is the caller graph for this function:

◆ resetVertex()

void resetVertex ( )
inlineprotected

Reset vertex component to zero.

Definition at line 70 of file STLAsciiParseI.H.

◆ addVertexComponent() [1/2]

bool addVertexComponent ( float  val)
inlineprotected

Add next vertex component. On each third call, adds the point.

Returns
true when point has been added (on the last component)

Definition at line 76 of file STLAsciiParseI.H.

Referenced by STLAsciiParseManual::execute().

Here is the caller graph for this function:

◆ addVertexComponent() [2/2]

bool addVertexComponent ( const char *  text)
inlineprotected

Add next vertex component. On each third call, adds the point.

Returns
true when point has been added (on the last component)

> safer, but slower: readFloat(text, currVertex_[nVertexCmpt_]);

Definition at line 91 of file STLAsciiParseI.H.

◆ endFacet()

void endFacet ( )
inlineprotected

Action on 'endfacet'.

Definition at line 107 of file STLAsciiParseI.H.

Referenced by STLAsciiParseManual::execute().

Here is the caller graph for this function:

◆ operator=()

void operator= ( const STLAsciiParse )
protecteddelete

No copy assignment.

◆ clear()

void clear ( )
inline

Reset stored values.

Definition at line 147 of file STLAsciiParseI.H.

◆ sorted()

bool sorted ( ) const
inline

Do all the solid groups appear in order?

Definition at line 164 of file STLAsciiParseI.H.

◆ points()

Foam::DynamicList< Foam::STLpoint > & points ( )
inline

A list of unstitched triangle points.

Definition at line 170 of file STLAsciiParseI.H.

◆ facets()

Foam::DynamicList< Foam::label > & facets ( )
inline

A list of facet IDs (group IDs) corresponds to the number of triangles

Definition at line 176 of file STLAsciiParseI.H.

◆ names()

Foam::DynamicList< Foam::word > & names ( )
inline

Solid names in the order of their appearance.

Definition at line 182 of file STLAsciiParseI.H.

◆ sizes()

Foam::DynamicList< Foam::label > & sizes ( )
inline

Solid sizes in the order of their appearance.

Definition at line 188 of file STLAsciiParseI.H.

Member Data Documentation

◆ sorted_

bool sorted_
protected

Definition at line 60 of file STLAsciiParse.H.

Referenced by STLAsciiParse::beginSolid().

◆ groupId_

label groupId_
protected

Definition at line 61 of file STLAsciiParse.H.

Referenced by STLAsciiParse::beginSolid().

◆ lineNum_

label lineNum_
protected

Definition at line 62 of file STLAsciiParse.H.

Referenced by STLAsciiParseManual::execute().

◆ nFacetPoints_

int nFacetPoints_
protected

The number of local points on the current facet.

Definition at line 65 of file STLAsciiParse.H.

◆ nVertexCmpt_

int nVertexCmpt_
protected

Current vertex component when reading 'vertex'.

Definition at line 68 of file STLAsciiParse.H.

◆ currVertex_

STLpoint currVertex_
protected

Scratch space for reading 'vertex'.

Definition at line 71 of file STLAsciiParse.H.

◆ points_

DynamicList<STLpoint> points_
protected

Definition at line 73 of file STLAsciiParse.H.

◆ facets_

DynamicList<label> facets_
protected

Definition at line 74 of file STLAsciiParse.H.

◆ names_

DynamicList<word> names_
protected

Definition at line 75 of file STLAsciiParse.H.

Referenced by STLAsciiParse::beginSolid().

◆ sizes_

DynamicList<label> sizes_
protected

Definition at line 76 of file STLAsciiParse.H.

Referenced by STLAsciiParse::beginSolid().

◆ nameLookup_

HashTable<label> nameLookup_
protected

Definition at line 77 of file STLAsciiParse.H.

Referenced by STLAsciiParse::beginSolid().


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