Workspace 6.21.5
Public Member Functions | Static Public Member Functions | List of all members
NodeList Class Reference

Class for storing a list of nodes. More...

#include <Mesh/DataStructures/nodelist.h>

Inheritance diagram for NodeList:
[legend]

Public Member Functions

 NodeList ()
 
 NodeList (const NodeList &nodes)
 
void absorb (NodeList &otherList)
 
NodeaddNode (const Vector3d &v)
 
NodeaddNode (long IDnum, const Vector3d &v)
 
void expandBoundingBox (const Node &node)
 
double findMaxNodeSeparation () const
 
const BoundingBoxgetBoundingBox () const
 
NodeListoperator= (const NodeList &nodes)
 
void recalculateBoundingBox ()
 
void removeNode (Node &node)
 
void removeNodeFromList (NodeList::iterator nIter)
 
void setBoundingBox (const Vector3d &v)
 
iterator transferNode (iterator nIter, NodeList &fromList)
 
- Public Member Functions inherited from NumberedObjectList< Node >
 NumberedObjectList ()
 Create an empty list with the largest ID set to zero.
 
virtual ~NumberedObjectList ()=0
 
Nodeadd (Node &obj)
 
void addIndexChangeRecipient (IndexChangeRecipient &observer)
 
void clearList ()
 
size_type computeValidObjectsCount () const
 
void emptyTrash ()
 
void emptyTrash (iterator startFrom)
 
long getLargestID () const
 
void killBack ()
 
void killList ()
 
void reindex (iterator beginIter, iterator endIter, long start=0)
 
void reindex (long start=0)
 
void remove (Node &obj)
 This only marks obj for removal. It is not actually removed until EmptyTrash is called.
 
void removeFromList (iterator objIter)
 
void removeIndexChangeRecipient (IndexChangeRecipient &observer)
 
void renumber (long start=1, long incr=1)
 
void setLargestIDToAtLeast (long ID)
 
void updateLargestID ()
 
NodeAdd (Node &obj)
 
void Remove (Node &obj)
 
void RemoveFromList (iterator objIter)
 
void ClearList ()
 
void KillBack ()
 
void EmptyTrash ()
 
void EmptyTrash (iterator startFrom)
 
void KillList ()
 
long GetLargestID () const
 
void UpdateLargestID ()
 
void SetLargestIDToAtLeast (long ID)
 
void Renumber (long start=1, long incr=1)
 
void Reindex (long start=0)
 
void Reindex (iterator beginIter, iterator endIter, long start=0)
 
iterator begin ()
 STL container function.
 
const_iterator begin () const
 STL container function.
 
iterator end ()
 STL container function.
 
const_iterator end () const
 STL container function.
 
reverse_iterator rbegin ()
 STL container function.
 
const_reverse_iterator rbegin () const
 STL container function.
 
reverse_iterator rend ()
 STL container function.
 
const_reverse_iterator rend () const
 STL container function.
 
reference front ()
 STL container function.
 
const_reference front () const
 STL container function.
 
reference back ()
 STL container function.
 
const_reference back () const
 STL container function.
 
bool empty () const
 STL container function.
 
size_type size () const
 STL container function.
 
size_type max_size () const
 STL container function.
 
- Public Member Functions inherited from StateControl
 StateControl ()
 
virtual ~StateControl ()=default
 
void addIntegerState (const QString &name, long defaultVal=0)
 
void AddIntegerState (const QString &name, long defaultVal=0)
 
void addScalarState (const QString &name, double defaultVal=0)
 
void AddScalarState (const QString &name, double defaultVal=0)
 
void addVectorState (const QString &name, const Vector3d &defaultVal=Vector3d())
 
void AddVectorState (const QString &name, const Vector3d &defaultVal=Vector3d())
 
void assignDefaultState (State &object) const
 
void AssignDefaultState (State &object) const
 
void copyOnReallocateOff ()
 
void CopyOnReallocateOff ()
 
void copyOnReallocateOn ()
 
void CopyOnReallocateOn ()
 
void CopyWholeState (const State &object0, State &object1) const
 
void copyWholeState (const State &stateFrom, State &stateTo) const
 
void EnsureAllStatesSupported (const StateInfoArray &stateNames)
 
void ensureAllStatesSupported (const StateInfoArray &states)
 
StateInfoArray getAllStateInfo () const
 
StateInfoArray GetAllStateInfo () const
 
bool getInitStates () const
 
bool GetInitStates () const
 
int getStateIndex (const QString &stateName) const
 
int GetStateIndex (const QString &stateName) const
 
NameIndexMap getStateIndices () const
 
NameIndexMap GetStateIndices () const
 
void getStateIndices (NameIndexMap &stateIndices) const
 
void GetStateIndices (NameIndexMap &stateIndices) const
 
StateInfo getStateInfo (const QString &stateName) const
 
StateInfo GetStateInfo (const QString &stateName) const
 
bool haveState (const QString &name) const
 
bool HaveState (const QString &name) const
 
void InterpolateWholeState (const State &object0, const State &object1, State &interpObject, double p) const
 
void interpolateWholeState (const State &state0, const State &state1, const State &state2, const State &state3, State &interpState) const
 
void interpolateWholeState (const State &state0, const State &state1, State &interpState, double p) const
 
void makeStatesCompatible (const StateControl &states)
 
void reallocate ()
 
void Reallocate ()
 
void reallocationOff ()
 
void ReallocationOff ()
 
void reallocationOn ()
 
void ReallocationOn ()
 
void removeAllStates ()
 
void RemoveAllStates ()
 
void removeState (const QString &name)
 
void RemoveState (const QString &name)
 
bool renameState (const QString &from, const QString &to)
 
bool RenameState (const QString &from, const QString &to)
 
void setInitStates (bool b)
 
void SetInitStates (bool b)
 
void setInitStatesOff ()
 
void SetInitStatesOff ()
 
void setInitStatesOn ()
 
void SetInitStatesOn ()
 

Static Public Member Functions

static void removeNodeAttachments (Node &node, MeshModel &model)
 

Additional Inherited Members

- Public Types inherited from NumberedObjectList< Node >
typedef Node BaseItemType
 Allow the object type to be queried by other templates.
 
using container_type = std::list< Node * >
 STL container typedef.
 
using value_type = typename container_type::value_type
 STL container typedef.
 
using size_type = typename container_type::size_type
 STL container typedef.
 
using difference_type = typename container_type::difference_type
 STL container typedef.
 
using reference = typename container_type::reference
 STL container typedef.
 
using const_reference = typename container_type::const_reference
 STL container typedef.
 
using iterator = typename container_type::iterator
 STL container typedef.
 
using const_iterator = typename container_type::const_iterator
 STL container typedef.
 
using reverse_iterator = typename container_type::reverse_iterator
 STL container typedef.
 
using const_reverse_iterator = typename container_type::const_reverse_iterator
 STL container typedef.
 
- Protected Member Functions inherited from StateControl
unsigned getDoublesStateSize () const
 
unsigned getIntegerStateSize () const
 
virtual void resizeDoubles (const IndexMappings &mappings, const StateInfoArray &updatedStates, unsigned updatedDoublesStateSize)=0
 
template<typename IteratorT >
void resizeDoublesStates (IteratorT iterBegin, IteratorT iterEnd, const IndexMappings &mappings, const StateInfoArray &updatedStates, unsigned updatedDoublesStateSize)
 
virtual void resizeIntegers (const IndexMappings &mappings, const StateInfoArray &updatedStates, unsigned updatedIntegerStateSize)=0
 
template<typename IteratorT >
void resizeIntegerStates (IteratorT iterBegin, IteratorT iterEnd, const IndexMappings &mappings, const StateInfoArray &updatedStates, unsigned updatedIntegerStateSize)
 
- Protected Attributes inherited from StateControl
bool initStates_
 

Detailed Description

This class mostly provides member functions for adding/removing nodes. It also maintains a basic (conservative) measure of the bounding box around all the nodes in the list. Note, however, that this bounding box is only set by when nodes are added to the list, so the bounding box may be wrong if nodes are moved around.

Constructor & Destructor Documentation

◆ NodeList() [1/2]

NodeList ( )
default

Constructs an empty list.

◆ NodeList() [2/2]

NodeList ( const NodeList nodes)

The copy constructor can be expensive, since it has to create copies of each node in the list. The indexes of the new nodes won't match those in nodes unless nodes was reindexed starting from zero prior to calling this constructor. Node state data is also copied.

Member Function Documentation

◆ absorb()

void absorb ( NodeList otherList)

◆ addNode() [1/2]

Node & addNode ( const Vector3d v)

Create a node with the next highest unique ID and add it to the list. State arrays will be allocated.

◆ addNode() [2/2]

Node & addNode ( long  IDnum,
const Vector3d v 
)

Create a node and add it to the list. State arrays will be allocated.

◆ expandBoundingBox()

void expandBoundingBox ( const Node node)
Parameters
nodeEnsure the axis-aligned bounding box contains this node.

The function will check the current axis-aligned bounding box and ensure that node is not outside it. The axis-aligned bounding box is expanded as necessary to accomodate this node, but this function will never shrink the box.

The check will only be made if node is not marked for garbage collection.

◆ findMaxNodeSeparation()

double findMaxNodeSeparation ( ) const

◆ getBoundingBox()

const BoundingBox & getBoundingBox ( ) const

◆ operator=()

NodeList & operator= ( const NodeList nodes)
Parameters
nodesThe node list to copy

The assignment operator makes a deep copy of nodes. Specifically, new nodes are created by duplicating each node in nodes.

Postcondition
The value returned from getLargestID() might not be the same as the value returned from nodes.getLargestID() after this call. The indexes in this object could also be different to those in nodes.

◆ recalculateBoundingBox()

void recalculateBoundingBox ( )

Recalculate the axis-aligned bounding box around the nodes in the list. Immediately after this function returns, the getMinPosition() and getMaxPosition() functions can be used to get the corners of the axis-aligned bounding box.

Note that this function will only consider nodes not marked for garbage collection, and every node in the list will be visited once.

◆ removeNode()

void removeNode ( Node node)
Parameters
nodeThe node to remove from the list

The node specified by node will be marked as ready for garbage collection. It will not actually be deleted until emptyTrash() is called. Note that this function makes no attempt to ensure that anything using the node is also removed. If you want to do that, call removeNodeAttachments first.

See also
emptyTrash()

◆ removeNodeAttachments()

void removeNodeAttachments ( Node node,
MeshModel model 
)
static
Parameters
nodeAll elements using this node will be removed.
modelThe model this node belongs to.

The node itself will not be removed by this call. This function exists purely to remove all things dependent on node, usually just before the node itself is removed. This function relies on the attached element lists for node holding all elements that use that node.

◆ removeNodeFromList()

void removeNodeFromList ( NodeList::iterator  nIter)

◆ setBoundingBox()

void setBoundingBox ( const Vector3d v)

◆ transferNode()

NodeList::iterator transferNode ( iterator  nIter,
NodeList fromList 
)