STLReader Class Reference

Internal class used by the STLsurfaceFormat and triSurface. More...

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

Public Member Functions

 STLReader (const fileName &filename)
 Read from file, filling in the information. More...
 
 STLReader (const fileName &filename, const STLFormat format)
 Read from file, filling in the information. More...
 
 ~STLReader ()=default
 Destructor. More...
 
void clear ()
 Flush all values. More...
 
label mergePointsMap (labelList &pointMap) const
 Calculate merge points mapping, return old to new pointMap. More...
 
label mergePointsMap (const scalar mergeTol, labelList &pointMap) const
 Calculate merge points mapping, return old to new pointMap. More...
 
bool sorted () const
 File read was already sorted? More...
 
List< STLpoint > & points ()
 Return full access to the points. More...
 
List< label > & zoneIds ()
 Return full access to the zoneIds. More...
 
List< word > & names ()
 The list of solid names in the order of their first appearance. More...
 
List< label > & sizes ()
 The list of solid sizes in the order of their first appearance. More...
 
enum STLFormat stlFormat () const
 The STL format used (ASCII or BINARY) More...
 

Static Public Attributes

static int parserType
 ASCII parser types (0=Flex, 1=Ragel, 2=Manual) More...
 

Additional Inherited Members

- Public Types inherited from STLCore
enum  STLFormat { ASCII , BINARY , UNKNOWN }
 Enumeration for the format of data in the stream. More...
 
- Protected Member Functions inherited from STLCore
 STLCore ()=default
 Default construct. More...
 
- Static Protected Member Functions inherited from STLCore
static bool isBinaryName (const fileName &filename, const STLFormat format)
 Detect 'stlb' extension as binary when format = UNKNOWN. More...
 
static int detectBinaryHeader (const fileName &filename)
 Check contents to detect if the file is a binary STL. More...
 
static std::unique_ptr< std::istream > readBinaryHeader (const fileName &filename, label &nTrisEstimated)
 Read STL binary file header. More...
 
static void writeBinaryHeader (ostream &os, uint32_t nTris)
 Write STL binary file and number of triangles to stream. More...
 

Detailed Description

Internal class used by the STLsurfaceFormat and triSurface.

Source files

Definition at line 67 of file STLReader.H.

Constructor & Destructor Documentation

◆ STLReader() [1/2]

STLReader ( const fileName filename)

Read from file, filling in the information.

Auto-detect ASCII/BINARY format.

Definition at line 207 of file STLReader.C.

References STLCore::UNKNOWN.

◆ STLReader() [2/2]

STLReader ( const fileName filename,
const STLFormat  format 
)

Read from file, filling in the information.

Manually selected choice of ASCII/BINARY/UNKNOWN(detect) formats.

Definition at line 224 of file STLReader.C.

References format().

Here is the call graph for this function:

◆ ~STLReader()

~STLReader ( )
default

Destructor.

Member Function Documentation

◆ clear()

void clear ( )

Flush all values.

Definition at line 244 of file STLReader.C.

◆ mergePointsMap() [1/2]

Foam::label mergePointsMap ( labelList pointMap) const

Calculate merge points mapping, return old to new pointMap.

The merge tolerance based on ASCII or BINARY input format.

Returns
number of unique points

Definition at line 255 of file STLReader.C.

References Foam::doubleScalarSMALL.

Referenced by STLsurfaceFormat< Face >::read().

Here is the caller graph for this function:

◆ mergePointsMap() [2/2]

Foam::label mergePointsMap ( const scalar  mergeTol,
labelList pointMap 
) const

Calculate merge points mapping, return old to new pointMap.

Returns
number of unique points

Definition at line 273 of file STLReader.C.

References Foam::mergePoints().

Here is the call graph for this function:

◆ sorted()

bool sorted ( ) const
inline

File read was already sorted?

Definition at line 160 of file STLReader.H.

Referenced by STLsurfaceFormat< Face >::read().

Here is the caller graph for this function:

◆ points()

List< STLpoint > & points ( )
inline

Return full access to the points.

Definition at line 166 of file STLReader.H.

Referenced by STLsurfaceFormat< Face >::read().

Here is the caller graph for this function:

◆ zoneIds()

List< label > & zoneIds ( )
inline

Return full access to the zoneIds.

Definition at line 172 of file STLReader.H.

Referenced by STLsurfaceFormat< Face >::read().

Here is the caller graph for this function:

◆ names()

List< word > & names ( )
inline

The list of solid names in the order of their first appearance.

Definition at line 178 of file STLReader.H.

Referenced by STLsurfaceFormat< Face >::read().

Here is the caller graph for this function:

◆ sizes()

List< label > & sizes ( )
inline

The list of solid sizes in the order of their first appearance.

Definition at line 184 of file STLReader.H.

Referenced by STLsurfaceFormat< Face >::read().

Here is the caller graph for this function:

◆ stlFormat()

enum STLFormat stlFormat ( ) const
inline

The STL format used (ASCII or BINARY)

Definition at line 190 of file STLReader.H.

Member Data Documentation

◆ parserType

int parserType
static

ASCII parser types (0=Flex, 1=Ragel, 2=Manual)

Definition at line 127 of file STLReader.H.


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