STLReader Class Reference

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

Inheritance diagram for STLReader:
Collaboration diagram for STLReader:

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 is_sorted () const noexcept
 File read was already sorted? More...
 
List< STLpoint > & points () noexcept
 Return full access to the points. More...
 
List< label > & zoneIds () noexcept
 Return full access to the zoneIds. More...
 
List< word > & names () noexcept
 The list of solid names in the order of their first appearance. More...
 
List< label > & sizes () noexcept
 The list of solid sizes in the order of their first appearance. More...
 
enum STLFormat stlFormat () const noexcept
 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 63 of file STLReader.H.

Constructor & Destructor Documentation

◆ STLReader() [1/2]

STLReader ( const fileName filename)
explicit

Read from file, filling in the information.

Auto-detect ASCII/BINARY format.

Definition at line 201 of file STLReader.C.

◆ 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.

◆ ~STLReader()

~STLReader ( )
default

Destructor.

Member Function Documentation

◆ clear()

void clear ( )

Flush all values.

Definition at line 237 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 249 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 267 of file STLReader.C.

References Foam::mergePoints().

Here is the call graph for this function:

◆ is_sorted()

bool is_sorted ( ) const
inlinenoexcept

File read was already sorted?

Definition at line 204 of file STLReader.H.

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

Here is the caller graph for this function:

◆ points()

List<STLpoint>& points ( )
inlinenoexcept

Return full access to the points.

Definition at line 209 of file STLReader.H.

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

Here is the caller graph for this function:

◆ zoneIds()

List<label>& zoneIds ( )
inlinenoexcept

Return full access to the zoneIds.

Definition at line 214 of file STLReader.H.

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

Here is the caller graph for this function:

◆ names()

List<word>& names ( )
inlinenoexcept

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

Definition at line 219 of file STLReader.H.

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

Here is the caller graph for this function:

◆ sizes()

List<label>& sizes ( )
inlinenoexcept

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

Definition at line 224 of file STLReader.H.

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

Here is the caller graph for this function:

◆ stlFormat()

enum STLFormat stlFormat ( ) const
inlinenoexcept

The STL format used (ASCII or BINARY)

Definition at line 229 of file STLReader.H.

Member Data Documentation

◆ parserType

int parserType
static

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

Definition at line 153 of file STLReader.H.


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