Workspace 6.21.5
|
Mesh model class to provide node and element lists.
#include <Mesh/DataStructures/meshmodel.h>
Public Types | |
enum | ListType { Nodes , Elements } |
Used to choose betwee nodes or elements. Usually used in relation to states. More... | |
Public Types inherited from NumberedObject | |
enum | { flag0 , flag1 , flag2 , flag3 , flag4 , flag5 , flag6 , flag7 , flag8 , flag9 , flag10 , flag11 , flag12 , flag13 , flag14 , flag15 } |
Public Member Functions | |
MeshModel (const MeshModel &model) | |
MeshModel (long modelID=1, long compID=1) | |
~MeshModel () override | |
void | absorb (MeshModel &otherModel) |
void | addElementIntegerState (const QString &name, long defaultVal=0) |
void | addElementScalarState (const QString &name, double defaultVal=0) |
void | addElementVectorState (const QString &name, const Vector3d &defaultVal=Vector3d()) |
void | addNodeIntegerState (const QString &name, long defaultVal=0) |
void | addNodeScalarState (const QString &name, double defaultVal=0) |
void | addNodeVectorState (const QString &name, const Vector3d &defaultVal=Vector3d()) |
bool | checkModelIntegrity () const |
void | clearModel () override |
MeshModelInterface * | createInterfaceFromModel (bool takeOwnership=false) |
void | emptyTrashAll () override |
MeshModel & | fastAssign (MeshModel &model) |
unsigned | getElementCount () const |
NodeList & | getNodes () |
const NodeList & | getNodes () const |
SegmentList & | getSegments () |
const SegmentList & | getSegments () const |
ShellElementList & | getShells () |
const ShellElementList & | getShells () const |
VolumeElementList & | getVolumes () |
const VolumeElementList & | getVolumes () const |
void | killFreeNodes () |
void | killSegments () |
void | killShellElements () |
void | killVolumeElements () |
MeshModel & | operator= (const MeshModel &model) |
void | removeAllStates () |
Deprecated functions | |
NodeList & | GetNodes () |
const NodeList & | GetNodes () const |
SegmentList & | GetSegments () |
const SegmentList & | GetSegments () const |
ShellElementList & | GetShells () |
const ShellElementList & | GetShells () const |
VolumeElementList & | GetVolumes () |
const VolumeElementList & | GetVolumes () const |
unsigned | GetElementCount () const |
Public Member Functions inherited from BaseModel | |
virtual | ~BaseModel ()=default |
virtual void | clearModel ()=0 |
Erases everything from the model (eg nodes, elements, etc). | |
virtual void | emptyTrashAll ()=0 |
Garbage collects everything in the model (eg nodes, elements, etc.). | |
const QString & | getName () const |
bool | operator== (const BaseModel &model) const |
void | setName (const QString &name) |
Set the name of the model to name. | |
void | SetName (const QString &name) |
const QString & | GetName () const |
void | EmptyTrashAll () |
void | ClearModel () |
Public Member Functions inherited from Entity | |
long | getCompID () const |
Get the ID of the component this entity belongs to. | |
void | setCompID (long compID) |
void | SetCompID (long compID) |
long | GetCompID () const |
Public Member Functions inherited from NumberedObject | |
NumberedObject (long ID) | |
Create an object with the specified ID and all flags except isValid not set. | |
void | clearFlag (unsigned flag) |
Clear flag. Do not use this to manipulate the isValid flag, since list managers are responsible for that. | |
void | copyFlags (const NumberedObject &t) |
long | getID () const |
long | getIndex () const |
bool | isFlagSet (unsigned flag) const |
bool | isValid () const |
void | setFlag (unsigned flag, bool b=true) |
Set flag to b. Do not use this to manipulate the isValid flag, since list managers are responsible for that. | |
void | setID (long ID) |
void | setIndex (long i) |
void | SetID (long ID) |
long | GetID () const |
void | SetIndex (long i) |
long | GetIndex () const |
bool | IsFlagSet (unsigned flag) const |
void | ClearFlag (unsigned flag) |
void | SetFlag (unsigned flag) |
void | setFlagTo (unsigned flag, bool b=true) |
void | SetFlagTo (unsigned flag, bool b=true) |
bool | IsValid () const |
Public Member Functions inherited from Observable | |
virtual | ~Observable () |
void | attachObserver (Observer &observer) |
void | destroy () |
void | detachObserver (Observer &observer) |
void | notifyEvent (const ObservableEvent &event) |
Static Public Member Functions | |
static const MeshModel * | accessModelFromInterface (const MeshModelInterface &meshInterface) |
static MeshModel * | accessModelFromInterface (MeshModelInterface &meshInterface) |
static bool | refreshInterfaceAroundModel (MeshModelInterface &meshInterface) |
static MeshModel * | setInterfaceDataObjectToMeshModel (DataExecution::DataObject &dataObj) |
Additional Inherited Members | |
Protected Member Functions inherited from BaseModel | |
BaseModel (long modelID=1, long compID=1) | |
Protected Member Functions inherited from Entity | |
Entity (long id, long compID) | |
Protected Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Related Functions inherited from NumberedObject | |
int | bitMask (unsigned pos) |
enum ListType |
MeshModel | ( | long | modelID = 1 , |
long | compID = 1 |
||
) |
modelID | To support collections of models, each individual model has its own ID associated with it. |
compID | The collection itself also has an ID. |
model | The source model to copy. |
|
override |
void absorb | ( | MeshModel & | otherModel | ) |
otherModel | The model to absorb into this one. |
This function is equivalent to calling absorb() on each of the various lists the model maintains (ie nodes and elements). It is advisable to call the MeshModel class' absorb() function in preference to manually calling each of the lists' own absorb() functions separately.
|
static |
WARNING: Any further changes made directly to the MeshModel may not be reflected through the interface until a call to refreshInterfaceAroundModel()
|
static |
WARNING: Any further changes made directly to the MeshModel may not be reflected through the interface until a call to refreshInterfaceAroundModel()
void addElementIntegerState | ( | const QString & | name, |
long | defaultVal = 0 |
||
) |
name | The name of the state to add or modify. |
defaultVal | The value to assign to this part of the state for any new stateful object. |
This function adds the specified state to all element lists, i.e. segments, shells and volume elements with exactly the same functionality.
void addElementScalarState | ( | const QString & | name, |
double | defaultVal = 0 |
||
) |
name | The name of the state to add or modify. |
defaultVal | The value to assign to this part of the state for any new stateful object. |
This function adds the specified state to all element lists, i.e. segments, shells and volume elements with exactly the same functionality.
name | The name of the state to add or modify. |
defaultVal | The value to assign to this part of the state for any new stateful object. |
This function adds the specified state to all element lists, i.e. segments, shells and volume elements with exactly the same functionality.
void addNodeIntegerState | ( | const QString & | name, |
long | defaultVal = 0 |
||
) |
name | The name of the state to add or modify. |
defaultVal | The value to assign to this part of the state for any new stateful object. |
Equivalent to the corresponding add state operation on getNodes().
void addNodeScalarState | ( | const QString & | name, |
double | defaultVal = 0 |
||
) |
name | The name of the state to add or modify. |
defaultVal | The value to assign to this part of the state for any new stateful object. |
Equivalent to the corresponding add state operation on getNodes().
name | The name of the state to add or modify. |
defaultVal | The value to assign to this part of the state for any new stateful object. |
Equivalent to the corresponding add state operation on getNodes().
bool checkModelIntegrity | ( | ) | const |
This function should only be used during debugging, as it is relatively expensive. It performs a number of integrity checks on the model, covering things like node and element attachment lists, duplicate elements and so on. Nodes marked for deletion will not be checked, so it is not necessary to call emptyTrashAll() before calling this function.
If any test fails, a message is logged to standard output and the function returns immediately. Thus, only the first error encountered will be reported. The message will generally include an index of a node involved in the failed test to allow you to find the failed region of the model.
|
overridevirtual |
This function simply calls the node and element lists' KillList() functions. At exit, this model will have no nodes or elements, but the states supported by the node and element lists remains unchanged.
Implements BaseModel.
MeshModelInterface * createInterfaceFromModel | ( | bool | takeOwnership = false | ) |
Create a new MeshModelInterface for this model. Calling code is responsible for deleting the new object.
takeOwnership | if true the MeshModelInterface will call delete on this MeshModel when the MeshModelInterface is destroyed. |
WARNING: Any further changes made directly to the MeshModel may not be reflected through the interface until a call to refreshInterfaceAroundModel()
|
overridevirtual |
This function simply calls the node and element lists' EmptyTrash() functions.
Implements BaseModel.
model | The source model to assign from. |
Make this model become a copy of model. New nodes and elements will be created and any old nodes or elements will be discarded. State info is also copied. The only change made to model during this process is a reindexing of its nodes.
unsigned getElementCount | ( | ) | const |
|
inline |
NodeList & getNodes | ( | ) |
|
inline |
const NodeList & getNodes | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
SegmentList & getSegments | ( | ) |
|
inline |
const SegmentList & getSegments | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
ShellElementList & getShells | ( | ) |
|
inline |
const ShellElementList & getShells | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
VolumeElementList & getVolumes | ( | ) |
|
inline |
const VolumeElementList & getVolumes | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
void killFreeNodes | ( | ) |
void killSegments | ( | ) |
void killShellElements | ( | ) |
void killVolumeElements | ( | ) |
model | The source model to assign from. |
Make this model become a copy of model. New nodes and elements will be created and any old nodes or elements will be discarded. State info is also copied.
This assignment operator takes a const
model, which means its nodes are not allowed to be re-indexed and we cannot assume that they already are correctly indexed. Therefore, a different method is used for node lookups compared to fastAssign(), but this is considerably slower than what fastAssign() does since the lookup has logarithmic complexity instead of constant time.
|
static |
If the supplied interface is a wrapper around a MeshModel then the MeshModelInterface is updated to ensure it reflects any changes made directly to the MeshModel.
void removeAllStates | ( | ) |
Discard all state information in the model and reset all node and element lists to supporting no states.
|
static |
Populates a MeshModelInterface data object with a wrapped MeshModel and returns that internal MeshModel This allows legacy code still using MeshModel to work with a MeshModelInterface DataObjects.
WARNING: Any further changes made directly to the MeshModel may not be reflected through the interface until a call to refreshInterfaceAroundModel()