Workspace 6.21.5
|
Reads models in STL format (ASCII only). More...
#include <Mesh/FileIO/Readers/stlreader.h>
Public Member Functions | |
STLReader (const std::string &fName, double nodeMergeTol, double smallElementSize) | |
STLReader (const std::string &fName="") | |
long | GetDefaultCompID () const |
std::string | GetFormatExtension () const override |
std::string | GetFormatName () const override |
double | GetNodeMergeTol () const |
double | GetSmallElementSize () const |
void | SetDefaultCompID (long id) |
void | SetNodeMergeTol (double nodeMergeTol) |
void | SetSmallElementSize (double smallElementSize) |
Public Member Functions inherited from MeshReader | |
MeshReader (const std::string &fName) | |
~MeshReader () override=default | |
void | AllowDegenerateElements () |
void | DisallowDegenerateElements () |
State * | GetNodeState (long nodeID) |
virtual void | GetTransform (ObjectTransforms &trans) |
virtual bool | HasTransformData () const |
bool | Read (MeshModel &model, bool shouldOverwrite=false) |
virtual bool | ReadStateInfo (StateInfoArray &nodeStates, StateInfoArray &elementStates) |
Public Member Functions inherited from BaseReader | |
BaseReader (const std::string &fName) | |
~BaseReader () override=default | |
Have virtual functions, so also have a virtual destructor. | |
virtual void | Close () |
std::string | ExtractBaseName (const std::string &fileName) |
int | FileLength () |
int | FilePosition () |
void | Flush () |
std::string | GetBaseName () const |
std::string | GetBaseNameSuffix () const |
std::string | GetFileName () const |
virtual std::string | GetFormatExtension () const =0 |
virtual std::string | GetFormatName () const =0 |
bool | GetTerminateExecution () const |
bool | IsOpen () const |
bool | IsReady () const |
virtual std::string | Open () |
void | SetBaseName (const std::string &base) |
void | SetBaseNameSuffix (const std::string &suffix) |
void | SetBaseNameSuffix (double caseNum, const std::string &caseLabel="_") |
void | SetBaseNameSuffix (int caseNum, const std::string &caseLabel="_") |
template<typename T > | |
void | SetBaseNameSuffix (T caseNum, const std::string &caseLabel="_") |
void | SetFileName (const std::string &fileName) |
virtual void | SetProgress (int progress) |
void | SetTerminateExecution (bool b) |
Public Member Functions inherited from Logger | |
Logger () | |
The default constructor logs to standard output with a plain text log mode. | |
Logger (const Logger &logger) | |
virtual | ~Logger () |
We own the log mode, so delete it. | |
std::string | ErrorOff () const |
std::string | ErrorOn () const |
std::ostream & | GetLog () const |
const LogMode & | GetLogMode () const |
void | SetLog (std::ostream &log) |
void | SetLogMode (const LogMode &logMode) |
void | SetLogModeHTML () |
void | SetLogModePlainText () |
Set log mode to plain text output. | |
template<Styles s> | |
void | StyleOff () const |
template<Styles s> | |
void | StyleOn () const |
std::string | WarningOff () const |
std::string | WarningOn () const |
Public Member Functions inherited from Observable | |
virtual | ~Observable () |
void | attachObserver (Observer &observer) |
void | destroy () |
void | detachObserver (Observer &observer) |
void | notifyEvent (const ObservableEvent &event) |
Additional Inherited Members | |
Public Types inherited from Logger | |
enum | Styles { Warning , Error , Preformat } |
Protected Member Functions inherited from MeshReader | |
Node * | addNode (MeshModel &model, const Node &node) |
PointMass * | addPointMass (MeshModel &model, const PointMass &mass) |
Segment * | addSegment (MeshModel &model, const Segment &elem) |
ShellElement * | addShellElement (MeshModel &model, const ShellElement &elem) |
VolumeElement * | addVolumeElement (MeshModel &model, const VolumeElement &elem) |
bool | SetNodeID (long oldNodeID, long newNodeID) |
bool | WillAllowDegenerateElements () const |
Protected Member Functions inherited from BaseReader | |
bool | GetNextNonBlankLine (std::string &inputLine) |
virtual void | postFileNameChanged () |
Protected Member Functions inherited from Logger | |
virtual void | LogChanged () |
virtual void | LogModeChanged () |
Protected Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Protected Attributes inherited from BaseReader | |
std::string | baseName |
std::string | baseNameSuffix |
iautogzstream | inFile |
int | progress_ |
bool | terminateExecution_ |
Note that this is only a basic STL reader. It should not be relied upon to read complex files or to keep up to date with any extensions to the file format.
STLReader | ( | const std::string & | fName, |
double | nodeMergeTol, | ||
double | smallElementSize | ||
) |
fName | Defines the base file name for the reader. |
nodeMergeTol | Nodes closer than this distance will be merged. |
smallElementSize | This determines the cell size to use when searching for nodes to merge. It is typically set to about half the smallest reasonable element edge length. If set too low, too many cells may be needed for the search and numerical overflow will result. If set too big, the search will be very slow. |
STLReader | ( | const std::string & | fName = "" | ) |
fName | Defines the base file name for the reader. |
This constructor specifies that no node merging will be done by default. This is useful if you have no idea what sort of scale the model is. Note, however, that there will be a lot of duplicate nodes using this approach, since no element will be connected to any other element (i.e. all elements create three new nodes each).
|
inline |
|
inlineoverridevirtual |
Implements BaseReader.
|
inlineoverridevirtual |
Implements BaseReader.
double GetNodeMergeTol | ( | ) | const |
double GetSmallElementSize | ( | ) | const |
Node merges will only be performed if the node merge tolerance has also been set.
|
inline |
id | The default ID to use for elements. |
void SetNodeMergeTol | ( | double | nodeMergeTol | ) |
nodeMergeTol | The node merge tolerance to use. |
Node merges will only be performed if the small element size has also been set.
void SetSmallElementSize | ( | double | smallElementSize | ) |
smallElementSize | The distance signifying a small element edge. This is used only to determine cell spacing when searching for nodes to merge. The actual tolerance controlling whether two nodes will be merged is set by SetNodeMergeTol. |