Workspace 6.21.5
Public Member Functions | Protected Member Functions | List of all members
LodMeshNodesInterface Class Reference

#include <Mesh/DataStructures/MeshModelInterface/lodmeshnodesinterface.h>

Inheritance diagram for LodMeshNodesInterface:
[legend]

Public Member Functions

 LodMeshNodesInterface (const LodMeshNodesInterface &other, LodMeshModelInterface &model)
 
 LodMeshNodesInterface (LodMeshModelInterface &model)
 
NodeHandle add (const Vector3d &position) override
 
void clear () override
 
bool empty () const override
 
iterator erase (const iterator &position) override
 
Vector3d getPosition (const NodeHandle &nodeHandle) const override
 
bool getState (const NodeHandle &nodeHandle, const NodeStateHandle &state, double &result) const override
 
bool getState (const NodeHandle &nodeHandle, const NodeStateHandle &state, int_type &result) const override
 
bool getState (const NodeHandle &nodeHandle, const NodeStateHandle &state, Vector3d &result) const override
 
size_type highestNodeIndex () const override
 
bool isStateTypeSupported (const DataExecution::DataFactory &dataFactory) const override
 
LodMeshNodesInterfaceoperator= (const LodMeshNodesInterface &)
 
void remove (const NodeHandle &nodeHandle) override
 
void reserve (size_type n) override
 
void setPosition (const NodeHandle &nodeHandle, const Vector3d &position) override
 
bool setState (const NodeHandle &nodeHandle, const NodeStateHandle &state, const DataExecution::DataObject &value) override
 
bool setState (const NodeHandle &nodeHandle, const NodeStateHandle &state, const Vector3d &value) override
 
bool setState (const NodeHandle &nodeHandle, const NodeStateHandle &state, double value) override
 
bool setState (const NodeHandle &nodeHandle, const NodeStateHandle &state, int_type value) override
 
size_type size () const override
 
- Public Member Functions inherited from MeshNodesInterface
virtual NodeHandle add (const Vector3d &position)=0
 
const NodeStateHandleaddState (const QString &name, const DataExecution::DataObject &defaultValue)
 
template<typename T >
const NodeStateHandleaddState (const QString &name, const T &defaultValue)
 
iterator begin ()
 
const_iterator begin () const
 
virtual BoundingBoxMinimal calculateBoundingBox () const
 
virtual bool canAddState (const DataExecution::DataObject &defaultValue)
 
virtual bool canRemoveState (const NodeStateHandle &state)
 
virtual void clear ()=0
 
virtual bool digestContiguousFloatStateData (const NodeStateHandle &state, std::function< bool(size_type numNodes, size_type componentsPerNode, size_type stride, const double *data)> digestFunc) const
 
virtual bool digestContiguousIntegerStateData (const NodeStateHandle &state, std::function< bool(size_type numNodes, size_type componentsPerNode, size_type stride, const int_type *data)> digestFunc) const
 
virtual bool digestContiguousPositionData (std::function< bool(size_type numNodes, size_type stride, const double *data)> digestFunc) const
 
virtual bool digestContiguousUInt16StateData (const NodeStateHandle &state, std::function< bool(size_type numNodes, size_type componentsPerNode, size_type stride, const quint16 *data)> digestFunc) const
 
virtual bool digestContiguousUInt8StateData (const NodeStateHandle &state, std::function< bool(size_type numNodes, size_type componentsPerNode, size_type stride, const quint8 *data)> digestFunc) const
 
virtual bool empty () const
 
iterator end ()
 
const_iterator end () const
 
bool ensureAllStatesSupported (const NodeStateHandleList &states)
 
virtual iterator erase (const iterator &position)=0
 
NodeStateHandleList getAllStateHandles () const
 
virtual ContiguousDataAccessType getContiguousDataAccessType () const
 
virtual Vector3d getPosition (const NodeHandle &nodeHandle) const =0
 
bool getState (const NodeHandle &nodeHandle, const NodeStateHandle &state, DataExecution::DataObject &result)
 
bool getState (const NodeHandle &nodeHandle, const NodeStateHandle &state, DataExecution::DataObject &result) const
 
virtual bool getState (const NodeHandle &nodeHandle, const NodeStateHandle &state, double &result) const
 
virtual bool getState (const NodeHandle &nodeHandle, const NodeStateHandle &state, int_type &result) const
 
virtual bool getState (const NodeHandle &nodeHandle, const NodeStateHandle &state, quint16 &result) const
 
virtual bool getState (const NodeHandle &nodeHandle, const NodeStateHandle &state, quint8 &result) const
 
virtual bool getState (const NodeHandle &nodeHandle, const NodeStateHandle &state, Vector3d &result) const
 
const NodeStateHandlegetStateHandle (const QString &name) const
 
bool hasState (const QString &name) const
 
virtual size_t height () const
 
virtual size_type highestNodeIndex () const =0
 
virtual bool isDense () const
 
virtual bool isStateTypeSupported (const DataExecution::DataFactory &dataFactory) const =0
 
virtual bool load (MeshSerializer &serializer)
 
virtual void remove (const NodeHandle &nodeHandle)=0
 
bool removeAllStates ()
 
bool removeState (const NodeStateHandle &state)
 
bool removeState (const QString &name)
 
bool renameState (const QString &from, const QString &to)
 
virtual void reserve (size_type n)
 
virtual bool save (MeshSerializer &serializer, NodeHandleIndexHash &nodeIds) const
 
virtual void setPosition (const NodeHandle &nodeHandle, const Vector3d &position)=0
 
virtual bool setState (const NodeHandle &nodeHandle, const NodeStateHandle &state, const DataExecution::DataObject &value)=0
 
virtual bool setState (const NodeHandle &nodeHandle, const NodeStateHandle &state, const Vector3d &value)
 
virtual bool setState (const NodeHandle &nodeHandle, const NodeStateHandle &state, double value)
 
virtual bool setState (const NodeHandle &nodeHandle, const NodeStateHandle &state, int_type value)
 
virtual bool setState (const NodeHandle &nodeHandle, const NodeStateHandle &state, quint16 value)
 
virtual bool setState (const NodeHandle &nodeHandle, const NodeStateHandle &state, quint8 value)
 
virtual size_type size () const =0
 
virtual size_t width () const
 

Protected Member Functions

NodeStateHandleaddStateToImplementation (const QString &name, const DataExecution::DataObject &defaultValue) override
 
NodeHandle advance (const NodeHandle &nodeHandle, size_type n) const override
 
NodeHandle beginHandle () const override
 
NodeHandle endHandle () const override
 
bool getStateImpl (const NodeHandle &nodeHandle, const NodeStateHandle &state, DataExecution::DataObject &result) const override
 
bool getStateImpl (const NodeHandle &nodeHandle, const NodeStateHandle &state, DataExecution::DataObject &result) override
 
bool removeStateFromImplementation (const NodeStateHandle &state) override
 
- Protected Member Functions inherited from MeshNodesInterface
 MeshNodesInterface ()
 
 MeshNodesInterface (const MeshNodesInterface &)
 
virtual ~MeshNodesInterface ()
 
virtual NodeStateHandleaddStateToImplementation (const QString &name, const DataExecution::DataObject &defaultValue)=0
 
virtual NodeHandle advance (const NodeHandle &nodeHandle, size_type n) const =0
 
virtual NodeHandle beginHandle () const
 
iterator createIterator (const NodeHandle &handle) const
 
virtual NodeHandle endHandle () const
 
virtual bool getStateImpl (const NodeHandle &nodeHandle, const NodeStateHandle &state, DataExecution::DataObject &result) const =0
 
virtual bool getStateImpl (const NodeHandle &nodeHandle, const NodeStateHandle &state, DataExecution::DataObject &result)=0
 
MeshNodesInterfaceoperator= (const MeshNodesInterface &)
 
bool registerExistingState (MeshModelInterface::size_type index, const QString &name, const DataExecution::DataObject &defaultValue)
 
virtual bool removeStateFromImplementation (const NodeStateHandle &state)=0
 
virtual bool stateBeingRenamed (const NodeStateHandle &state, const QString &to)
 

Additional Inherited Members

- Public Types inherited from MeshNodesInterface
enum  ContiguousDataAccessType { DirectBufferAccess , CopiedBufferAccess }
 The type of access that a particular implementation provides to contiguous data. More...
 
using int_type = MeshModelInterface::int_type
 
using ItemHandleListType = NodeHandleList
 
using ItemHandleType = NodeHandle
 
using size_type = MeshModelInterface::size_type
 
using StateHandleListType = NodeStateHandleList
 
using StateHandleType = NodeStateHandle
 

Constructor & Destructor Documentation

◆ LodMeshNodesInterface() [1/2]

◆ LodMeshNodesInterface() [2/2]

Member Function Documentation

◆ add()

NodeHandle add ( const Vector3d position)
overridevirtual
Postcondition
LodMeshModelInterface::updateModel() needs to be called after adding nodes

Implements MeshNodesInterface.

◆ addStateToImplementation()

NodeStateHandle * addStateToImplementation ( const QString &  name,
const DataExecution::DataObject defaultValue 
)
overrideprotectedvirtual
Parameters
nameName of the state
defaultValueA default value of for this state

Derived classes must implement this method, returning a NodeStateHandle with the index they will use to refer to this state along with the name and default value passed as parameters.

Returns
A NodeStateHandle with the index the implementation has associated with this state. The caller will take ownership of this newed object. The indices assigned to states by the derived class do not have to be unique across all states but must be unique amongst all states of a given type. Hence the DataFactory and handle together form the unique ID. If the state could not be added a NULL pointer should be returned.
See also
isStateTypeSupported

Implements MeshNodesInterface.

◆ advance()

NodeHandle advance ( const NodeHandle nodeHandle,
size_type  n 
) const
overrideprotectedvirtual
Returns
A NodeHandle n nodes past nodeHandle or endHandle() if it's past the last node.
See also
endHandle

Implements MeshNodesInterface.

◆ beginHandle()

NodeHandle beginHandle ( ) const
overrideprotectedvirtual
Returns
A handle that represents the first node or endHandle() if there are no nodes.
See also
begin

Reimplemented from MeshNodesInterface.

◆ clear()

void clear ( )
overridevirtual

Clears all node data. Defined states must be removed separately via removeAllStates.

See also
removeAllStates

Implements MeshNodesInterface.

◆ empty()

bool empty ( ) const
overridevirtual

Default implmentation simply checks size(), derived classes should override if something more efficient is possible.

Reimplemented from MeshNodesInterface.

◆ endHandle()

CSIRO::Mesh::NodeHandle endHandle ( ) const
overrideprotectedvirtual
Returns
A handle that represents the node "one past the end". Ie. An index analogous to std::container::end()
See also
end

Reimplemented from MeshNodesInterface.

◆ erase()

LodMeshNodesInterface::iterator erase ( const iterator position)
overridevirtual

NOT SUPPORTED: LOD Interface is designed to be populated and LODed but does not support removing elements again. You'll need to copy to/from a different MeshModelInterface type to achieve this.

Implements MeshNodesInterface.

◆ getPosition()

Vector3d getPosition ( const NodeHandle nodeHandle) const
overridevirtual
Parameters
nodeHandleThe node we're requesting the position of
Precondition
nodeHandle must be a valid handle or the result is undefined

Implements MeshNodesInterface.

◆ getState() [1/3]

bool getState ( const NodeHandle nodeHandle,
const NodeStateHandle state,
double &  result 
) const
overridevirtual

Convenience function for common type that avoids client needing to use a DataObject. This method still uses an internal TypedObject to call the implementations corresponding method unless the implementation overrides this virtual method and handles this type directly.

Reimplemented from MeshNodesInterface.

◆ getState() [2/3]

bool getState ( const NodeHandle nodeHandle,
const NodeStateHandle state,
int_type result 
) const
overridevirtual

Convenience function for common type that avoids client needing to use a DataObject. This method still uses an internal TypedObject to call the implementations corresponding method unless the implementation overrides this virtual method and handles this type directly.

Reimplemented from MeshNodesInterface.

◆ getState() [3/3]

bool getState ( const NodeHandle nodeHandle,
const NodeStateHandle state,
Vector3d result 
) const
overridevirtual

Convenience function for common type that avoids client needing to use a DataObject. This method still uses an internal TypedObject to call the implementations corresponding method unless the implementation overrides this virtual method and handles this type directly.

Reimplemented from MeshNodesInterface.

◆ getStateImpl() [1/2]

bool getStateImpl ( const NodeHandle nodeHandle,
const NodeStateHandle state,
DataExecution::DataObject result 
) const
overrideprotectedvirtual
Parameters
nodeHandleThe node we're requesting the state of
stateThe state we're requesting
resultA DataObject to store the result in (must be of type state.getDataObject() unless the implementation can convert)

This method is free to return shared data in result as it is only ever called by the public const getState method which will clone any shared data. As this is the case derived class should be able to implement the non-const getState() pure virtual as a simple call to this method as long as the only non-const thing this method does is return shared data.

See also
getState

Implements MeshNodesInterface.

◆ getStateImpl() [2/2]

bool getStateImpl ( const NodeHandle nodeHandle,
const NodeStateHandle state,
DataExecution::DataObject result 
)
overrideprotectedvirtual
Parameters
nodeHandleThe node we're requesting the state of
stateThe state we're requesting
resultA DataObject to store the result in (must be of type state.getDataObject() unless the implementation can convert)
See also
getState

Implements MeshNodesInterface.

◆ highestNodeIndex()

MeshNodesInterface::size_type highestNodeIndex ( ) const
overridevirtual
Returns
highest index used by a valid NodeHandle (may be higher than size() if implementation is sparse or has invalid nodes internally)

Implements MeshNodesInterface.

◆ isStateTypeSupported()

bool isStateTypeSupported ( const DataExecution::DataFactory dataFactory) const
overridevirtual
Parameters
dataFactoryThe DataFactory for the type of state we're checking support for
Returns
Whether the implementation supports node states of this type
See also
addState(const QString& name, const T& defaultValue)

Implements MeshNodesInterface.

◆ operator=()

LodMeshNodesInterface & operator= ( const LodMeshNodesInterface other)

◆ remove()

void remove ( const NodeHandle nodeHandle)
overridevirtual

NOT SUPPORTED: LOD Interface is designed to be populated and LODed but does not support removing elements again. You'll need to copy to/from a different MeshModelInterface type to achieve this.

Implements MeshNodesInterface.

◆ removeStateFromImplementation()

bool removeStateFromImplementation ( const NodeStateHandle state)
overrideprotectedvirtual

Derived classes must implement this method, deleting the state.

Returns
true if the state was removed or false if there was an error.

Implements MeshNodesInterface.

◆ reserve()

void reserve ( size_type  n)
overridevirtual

Default implementation does nothing

Reimplemented from MeshNodesInterface.

◆ setPosition()

void setPosition ( const NodeHandle nodeHandle,
const Vector3d position 
)
overridevirtual
Postcondition
LodMeshModelInterface::updateModel() needs to be called after moving nodes

Implements MeshNodesInterface.

◆ setState() [1/4]

bool setState ( const NodeHandle nodeHandle,
const NodeStateHandle state,
const DataExecution::DataObject value 
)
overridevirtual
Parameters
nodeHandleThe node we're setting the state of
stateThe state we're setting
valueA DataObject containing the data to set (must be of type state.getDataObject() unless the implementation can convert)

Implements MeshNodesInterface.

◆ setState() [2/4]

bool setState ( const NodeHandle nodeHandle,
const NodeStateHandle state,
const Vector3d value 
)
overridevirtual

Convenience function for common type that avoids client needing to use a DataObject. This method still uses an internal TypedObject to call the implementations corresponding method unless the implementation overrides this virtual method and handles this type directly.

Reimplemented from MeshNodesInterface.

◆ setState() [3/4]

bool setState ( const NodeHandle nodeHandle,
const NodeStateHandle state,
double  value 
)
overridevirtual

Convenience function for common type that avoids client needing to use a DataObject. This method still uses an internal TypedObject to call the implementations corresponding method unless the implementation overrides this virtual method and handles this type directly.

Reimplemented from MeshNodesInterface.

◆ setState() [4/4]

bool setState ( const NodeHandle nodeHandle,
const NodeStateHandle state,
int_type  value 
)
overridevirtual

Convenience function for common type that avoids client needing to use a DataObject. This method still uses an internal TypedObject to call the implementations corresponding method unless the implementation overrides this virtual method and handles this type directly.

Reimplemented from MeshNodesInterface.

◆ size()

MeshNodesInterface::size_type size ( ) const
overridevirtual
Returns
total number of valid nodes

Implements MeshNodesInterface.