TRIReader Class Reference

TRI (triangle) file reader. More...

Inheritance diagram for TRIReader:
Collaboration diagram for TRIReader:

Public Member Functions

 TRIReader (const fileName &filename)
 Read from file, filling in the information. More...
 
 ~TRIReader ()=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 in sorted order. More...
 
List< STLpoint > & points () noexcept
 Return full access to the points. More...
 
List< label > & zoneIds () noexcept
 Return full access to the zones. 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 zone sizes in the order of their first appearance. More...
 
- Public Member Functions inherited from surfaceFormatsCore
 surfaceFormatsCore ()=default
 Default construct. More...
 
virtual ~surfaceFormatsCore ()=default
 Destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from surfaceFormatsCore
static bool checkSupport (const wordHashSet &available, const word &fileType, const bool verbose=false, const char *functionName=nullptr)
 Verbose checking of fileType in the list of available types. More...
 
static fileName findFile (const IOobject &io, const bool isGlobal=true)
 Use IOobject information to resolve file to load from, or empty if the file does not exist. More...
 
static fileName findFile (const IOobject &io, const dictionary &dict, const bool isGlobal=true)
 Use IOobject information to resolve file to load from, or empty if the file does not exist. More...
 
- Static Public Attributes inherited from surfaceFormatsCore
static word nativeExt
 The file extension corresponding to 'native' surface format. More...
 
- Static Protected Member Functions inherited from surfaceFormatsCore
static string getLineNoComment (ISstream &is, const char comment='#')
 Read non-empty and non-comment line. More...
 
template<class Container >
static List< surfZoneoneZone (const Container &container, const word &name="zone0")
 Return a surfZone list with a single entry, the size of which corresponds to that of the container. More...
 
static labelList getSelectedPatches (const surfZoneList &patches, const wordRes &allow, const wordRes &deny=wordRes())
 Return ids for zone/patch that match by name. More...
 
static fileName relativeFilePath (const IOobject &io, const fileName &f, const bool isGlobal=true)
 Return fileName. More...
 
static fileName checkFile (const IOobject &io, const bool isGlobal=true)
 Return fileName to load IOobject from. More...
 
static fileName checkFile (const IOobject &io, const dictionary &dict, const bool isGlobal=true)
 Return fileName to load IOobject from. More...
 

Detailed Description

TRI (triangle) file reader.

For TRI format (eg, AC3D). Each input line has 9 floats (3 points, each 3 floats) followed by hex colour. The colour is used to build regions numbered from 0 upwards.

Reading and stitching similar to the STLReader.

Source files

Definition at line 57 of file TRIReader.H.

Constructor & Destructor Documentation

◆ TRIReader()

TRIReader ( const fileName filename)
explicit

Read from file, filling in the information.

Definition at line 161 of file TRIReader.C.

◆ ~TRIReader()

~TRIReader ( )
default

Destructor.

Member Function Documentation

◆ clear()

void clear ( )

Flush all values.

Definition at line 177 of file TRIReader.C.

◆ mergePointsMap() [1/2]

Foam::label mergePointsMap ( labelList pointMap) const

Calculate merge points mapping, return old to new pointMap.

Use merge tolerance as per STL ascii

Returns
number of unique points

Definition at line 188 of file TRIReader.C.

References Foam::doubleScalarSMALL.

Referenced by TRIsurfaceFormat< 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 202 of file TRIReader.C.

References Foam::mergePoints().

Here is the call graph for this function:

◆ is_sorted()

bool is_sorted ( ) const
inlinenoexcept

File read was already in sorted order.

Definition at line 133 of file TRIReader.H.

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

Here is the caller graph for this function:

◆ points()

List<STLpoint>& points ( )
inlinenoexcept

Return full access to the points.

Definition at line 138 of file TRIReader.H.

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

Here is the caller graph for this function:

◆ zoneIds()

List<label>& zoneIds ( )
inlinenoexcept

Return full access to the zones.

Definition at line 143 of file TRIReader.H.

Referenced by TRIsurfaceFormat< 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 148 of file TRIReader.H.

◆ sizes()

List<label>& sizes ( )
inlinenoexcept

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

Definition at line 153 of file TRIReader.H.

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

Here is the caller graph for this function:

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