Public Types | Protected Member Functions | Static Protected Member Functions | List of all members
STLCore Class Reference

Core routines used when reading/writing STL files. More...

Inheritance diagram for STLCore:
Inheritance graph
[legend]

Public Types

enum  STLFormat { ASCII, BINARY, UNKNOWN }
 

Protected Member Functions

 STLCore ()=default
 

Static Protected Member Functions

static bool isBinaryName (const fileName &filename, const STLFormat format)
 
static int detectBinaryHeader (const fileName &filename)
 
static std::unique_ptr< std::istream > readBinaryHeader (const fileName &filename, label &nTrisEstimated)
 
static void writeBinaryHeader (ostream &os, uint32_t nTris)
 

Detailed Description

Core routines used when reading/writing STL files.

Source files

Definition at line 50 of file STLCore.H.

Member Enumeration Documentation

◆ STLFormat

enum STLFormat
Enumerator
ASCII 

ASCII.

BINARY 

BINARY.

UNKNOWN 

Detect based on (input) content or (output) extension.

Definition at line 57 of file STLCore.H.

Constructor & Destructor Documentation

◆ STLCore()

STLCore ( )
protecteddefault

Member Function Documentation

◆ isBinaryName()

bool isBinaryName ( const fileName filename,
const STLFormat  format 
)
staticprotected

Definition at line 60 of file STLCore.C.

References format(), and fileName::hasExt().

Here is the call graph for this function:

◆ detectBinaryHeader()

int detectBinaryHeader ( const fileName filename)
staticprotected

Definition at line 81 of file STLCore.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::fileSize(), startsWithSolid(), STLHeaderSize, and ifstreamPointer::whichCompression().

Here is the call graph for this function:

◆ readBinaryHeader()

std::unique_ptr< std::istream > readBinaryHeader ( const fileName filename,
label &  nTrisEstimated 
)
staticprotected

Definition at line 141 of file STLCore.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::fileSize(), ifstreamPointer::release(), STLHeaderSize, and ifstreamPointer::whichCompression().

Here is the call graph for this function:

◆ writeBinaryHeader()

void writeBinaryHeader ( ostream &  os,
uint32_t  nTris 
)
staticprotected

Definition at line 220 of file STLCore.C.

References os(), and STLHeaderSize.

Here is the call graph for this function:

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