Workspace 6.21.5
|
Base class from which all file readers that import meshes must inherit. More...
#include <Mesh/FileIO/Readers/meshreader.h>
Public Member Functions | |
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) |
Protected Member Functions | |
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 &) | |
Additional Inherited Members | |
Public Types inherited from Logger | |
enum | Styles { Warning , Error , Preformat } |
Protected Attributes inherited from BaseReader | |
std::string | baseName |
std::string | baseNameSuffix |
iautogzstream | inFile |
int | progress_ |
bool | terminateExecution_ |
Readers must obey some basic rules (and clients should be able to rely on these):
MeshReader | ( | const std::string & | fName | ) |
fName | Defines the base file name for the reader. The file name extension can be omitted if it matches the return value of GetFormatExtension(). |
By default, readers are allowed to create degenerate elements. This can be changed by a call to DisallowDegenerateElements().
|
overridedefault |
Add a copy of node to model.
|
protected |
Add a copy of the shell element elem to model. Node ID lookup makes the computational cost of this function non-trivial for a large number of calls.
|
protected |
Add a copy of the segment elem to model. Node ID lookup makes the computational cost of this function non-trivial for a large number of calls.
void AllowDegenerateElements | ( | ) |
When an element is created, don't warn or fail with an error if it is degenerate. Currently, this is only relevent for shell elements.
void DisallowDegenerateElements | ( | ) |
When an element is created, warn or fail with an error if it is degenerate. Currently, this is only relevent for shell elements.
State * GetNodeState | ( | long | nodeID | ) |
|
inlinevirtual |
|
inlinevirtual |
bool Read | ( | MeshModel & | model, |
bool | shouldOverwrite = false |
||
) |
model | The model to read data into. |
shouldOverwrite | If true, then any nodes or elements read in with an ID the same as an existing one will replace it. If false, all nodes and elements read in will be created as new ones. |
This function calls ReadImpl as the last thing it does. Subclasses are responsible for implementing that function to do the actual reading.
|
virtual |
Analyse the file currently open to determine what state data it contains. By default, this function simply returns false, meaning no state data will be read. Some file formats don't support state data, hence this default behaviour. Those readers that are capable of providing state data will over-ride this function and therefore provide some meaningful state info. In this case, they should return true to indicate they support reading states.
|
protected |
Reassign a new ID newNodeID to the node currently mapped as oldNodeID. The node affected will still retain its oldNodeID within the reader's ID map so that it can still be referenced by it after returning from this call. The ID associated with the node in the model itself is what gets updated. Note that this ID will still get offset by nodeIDoffset_
if that is non-zero.
|
inlineprotected |