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

Provides node and element filtering to a MeshModelInterface.

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

Inheritance diagram for FilteredMeshElementsInterface:
[legend]

Public Member Functions

 FilteredMeshElementsInterface (MeshElementsInterface &interface, const FilteredMeshNodesInterface &nodes)
 
 ~FilteredMeshElementsInterface () override
 
ElementHandle add (const NodeHandleList &nodes) override
 
void addFilter (const MeshModelFilter &filter)
 
void clear () override
 
void clearFilters ()
 
iterator erase (const iterator &position) override
 
bool filterElement (const ElementHandle &element) const
 
const MeshModelFilterListgetFilters () const
 
NodeHandle getNode (const ElementHandle &element, size_type index) const override
 
bool getNodes (const ElementHandle &element, NodeHandleList &nodes) const override
 
bool isStateTypeSupported (const DataExecution::DataFactory &dataFactory) const override
 
void remove (const ElementHandle &elementHandle) override
 
bool setNode (const ElementHandle &element, const NodeHandle &node, size_type index) override
 
bool setNodes (const ElementHandle &element, const NodeHandleList &nodes) override
 
bool setState (const ElementHandle &elementHandle, const ElementStateHandle &state, const DataExecution::DataObject &value) override
 
size_type size () const override
 
- Public Member Functions inherited from MeshElementsInterface
ElementHandle add (const NodeHandle &node0, const NodeHandle &node1)
 
ElementHandle add (const NodeHandle &node0, const NodeHandle &node1, const NodeHandle &node2)
 
ElementHandle add (const NodeHandle &node0, const NodeHandle &node1, const NodeHandle &node2, const NodeHandle &node3)
 
ElementHandle add (const NodeHandle &node0, const NodeHandle &node1, const NodeHandle &node2, const NodeHandle &node3, const NodeHandle &node4, const NodeHandle &node5, const NodeHandle &node6, const NodeHandle &node7)
 
virtual ElementHandle add (const NodeHandleList &nodes)=0
 
const ElementStateHandleaddState (const QString &name, const DataExecution::DataObject &defaultValue)
 
template<typename T >
const ElementStateHandleaddState (const QString &name, const T &defaultValue)
 
iterator begin ()
 
const_iterator begin () const
 
virtual bool canAddState (const DataExecution::DataObject &defaultValue)
 
virtual bool canRemoveState (const ElementStateHandle &state)
 
virtual void clear ()=0
 
virtual bool digestContiguousFloatStateData (const ElementStateHandle &state, std::function< bool(size_type numElems, size_type nodesPerElem, size_type stride, const double *data)> digestFunc) const
 
virtual bool digestContiguousIntegerStateData (const ElementStateHandle &state, std::function< bool(size_type numElems, size_type nodesPerElem, size_type stride, const int_type *data)> digestFunc) const
 
virtual bool digestContiguousNodeIndexData (std::function< bool(size_type numElems, size_type nodesPerElem, size_type stride, const ItemHandle::size_type *data)> digestFunc) const
 
virtual bool digestContiguousUInt16StateData (const ElementStateHandle &state, std::function< bool(size_type numElems, size_type nodesPerElem, size_type stride, const quint16 *data)> digestFunc) const
 
virtual bool digestContiguousUInt8StateData (const ElementStateHandle &state, std::function< bool(size_type numElems, size_type nodesPerElem, size_type stride, const quint8 *data)> digestFunc) const
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
bool ensureAllStatesSupported (const ElementStateHandleList &states)
 
virtual iterator erase (const iterator &position)=0
 
ElementStateHandleList getAllStateHandles () const
 
virtual ContiguousDataAccessType getContiguousDataAccessType () const
 
const ElementType::TypegetElementType () const
 
virtual NodeHandle getNode (const ElementHandle &element, size_type index) const =0
 
virtual int getNodeIndex (const ElementHandle &element, const NodeHandle &node) const
 
virtual bool getNodes (const ElementHandle &element, NodeHandleList &nodes) const =0
 
bool getState (const ElementHandle &elementHandle, const ElementStateHandle &state, DataExecution::DataObject &result)
 
bool getState (const ElementHandle &elementHandle, const ElementStateHandle &state, DataExecution::DataObject &result) const
 
virtual bool getState (const ElementHandle &elementHandle, const ElementStateHandle &state, double &result) const
 
virtual bool getState (const ElementHandle &elementHandle, const ElementStateHandle &state, int_type &result) const
 
virtual bool getState (const ElementHandle &elementHandle, const ElementStateHandle &state, quint16 &result) const
 
virtual bool getState (const ElementHandle &elementHandle, const ElementStateHandle &state, quint8 &result) const
 
virtual bool getState (const ElementHandle &elementHandle, const ElementStateHandle &state, Vector3d &result) const
 
const ElementStateHandlegetStateHandle (const QString &name) const
 
bool hasState (const QString &name) const
 
virtual bool isAttached (const ElementHandle &element, const NodeHandle &node) const
 
virtual bool isStateTypeSupported (const DataExecution::DataFactory &dataFactory) const =0
 
virtual bool isValid () const
 
virtual bool load (MeshSerializer &serializer)
 
virtual void remove (const ElementHandle &elementHandle)=0
 
bool removeAllStates ()
 
bool removeState (const ElementStateHandle &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, const NodeHandleIndexHash &nodeIds) const
 
virtual bool setNode (const ElementHandle &element, const NodeHandle &node, size_type index)=0
 
virtual bool setNodes (const ElementHandle &element, const NodeHandleList &nodes)=0
 
virtual bool setState (const ElementHandle &elementHandle, const ElementStateHandle &state, const DataExecution::DataObject &value)=0
 
virtual bool setState (const ElementHandle &elementHandle, const ElementStateHandle &state, const Vector3d &value)
 
virtual bool setState (const ElementHandle &elementHandle, const ElementStateHandle &state, double value)
 
virtual bool setState (const ElementHandle &elementHandle, const ElementStateHandle &state, int_type value)
 
virtual bool setState (const ElementHandle &elementHandle, const ElementStateHandle &state, quint16 value)
 
virtual bool setState (const ElementHandle &elementHandle, const ElementStateHandle &state, quint8 value)
 
virtual size_type size () const =0
 

Protected Member Functions

ElementStateHandleaddStateToImplementation (const QString &name, const DataExecution::DataObject &defaultValue) override
 
ElementHandle advance (const ElementHandle &elementHandle, size_type n) const override
 
ElementHandle beginHandle () const override
 
ElementHandle endHandle () const override
 
bool getStateImpl (const ElementHandle &elementHandle, const ElementStateHandle &state, DataExecution::DataObject &result) const override
 
bool getStateImpl (const ElementHandle &elementHandle, const ElementStateHandle &state, DataExecution::DataObject &result) override
 
bool removeStateFromImplementation (const ElementStateHandle &state) override
 
- Protected Member Functions inherited from MeshElementsInterface
 MeshElementsInterface (const ElementType::Type &type)
 
 MeshElementsInterface (const MeshElementsInterface &)
 
virtual ~MeshElementsInterface ()
 
virtual ElementStateHandleaddStateToImplementation (const QString &name, const DataExecution::DataObject &defaultValue)=0
 
virtual ElementHandle advance (const ElementHandle &elementHandle, size_type n) const =0
 
virtual ElementHandle beginHandle () const
 
iterator createIterator (const ElementHandle &handle) const
 
virtual ElementHandle endHandle () const
 
virtual bool getStateImpl (const ElementHandle &elementHandle, const ElementStateHandle &state, DataExecution::DataObject &result) const =0
 
virtual bool getStateImpl (const ElementHandle &elementHandle, const ElementStateHandle &state, DataExecution::DataObject &result)=0
 
MeshElementsInterfaceoperator= (const MeshElementsInterface &)
 
bool registerExistingState (MeshModelInterface::size_type index, const QString &name, const DataExecution::DataObject &defaultValue)
 
virtual bool removeStateFromImplementation (const ElementStateHandle &state)=0
 
virtual bool stateBeingRenamed (const ElementStateHandle &state, const QString &to)
 

Additional Inherited Members

- Public Types inherited from MeshElementsInterface
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 = ElementHandleList
 
using ItemHandleType = ElementHandle
 
using size_type = MeshModelInterface::size_type
 
using StateHandleListType = ElementStateHandleList
 
using StateHandleType = ElementStateHandle
 
- Static Public Member Functions inherited from MeshElementsInterface
static MeshElementsInterfacegetNullMeshElementsInterface ()
 

Constructor & Destructor Documentation

◆ FilteredMeshElementsInterface()

◆ ~FilteredMeshElementsInterface()

Member Function Documentation

◆ add()

ElementHandle add ( const NodeHandleList &  nodes)
overridevirtual
Returns
An ElementHandle to the newly added element or an invalid ElementHandle if a new element could not be added. Subclass implementations can return an invalid handle simply by returning a default-constructed ElementHandle.

Implements MeshElementsInterface.

◆ addFilter()

void addFilter ( const MeshModelFilter filter)

◆ addStateToImplementation()

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

Derived classes must implement this method, returning the handle they will use to refer to this state. name and defaultValue are only passed to the derived class in case it also wants to do something with these parameters. The base class already stores these so most implementations will probably ignore them and simply worry about the handle.

Returns
An new ElementStateHandle with the index the implementation has associated with this state and the dataFactory of defaultValue.getDataFactory(). 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 or even all states for a particular a\ elementType but must be unquie amongst all states of a given DataFactory of a given ElementType::Type. Hence the dataFactory and ElementType together form the unique ID. If the state could not be added a NULL pointer should be returned.
See also
isStateTypeSupported

Implements MeshElementsInterface.

◆ advance()

ElementHandle advance ( const ElementHandle elementHandle,
size_type  n 
) const
overrideprotectedvirtual
Returns
An ElementHandle n elements past elementHandle or endHandle() if it's past the last element.
See also
endHandle

Implements MeshElementsInterface.

◆ beginHandle()

ElementHandle beginHandle ( ) const
overrideprotectedvirtual
Returns
A handle that represents the first element or endHandle() if there are no elements.
See also
begin()

Reimplemented from MeshElementsInterface.

◆ clear()

void clear ( )
overridevirtual

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

See also
removeAllStates

Implements MeshElementsInterface.

◆ clearFilters()

void clearFilters ( )

◆ endHandle()

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

Reimplemented from MeshElementsInterface.

◆ erase()

MeshElementsInterface::iterator erase ( const iterator position)
overridevirtual
Returns
An iterator for the next element or end() if the erased element was at the end.

Implements MeshElementsInterface.

◆ filterElement()

bool filterElement ( const ElementHandle element) const
Returns
true if the element should be filtered out, otherwise false if it should stay

◆ getFilters()

const MeshModelFilterList & getFilters ( ) const

◆ getNode()

NodeHandle getNode ( const ElementHandle element,
size_type  index 
) const
overridevirtual
Parameters
elementThe element handle we're requesting the nodes for
indexWhich node of the given element is being requested

Implements MeshElementsInterface.

◆ getNodes()

bool getNodes ( const ElementHandle element,
NodeHandleList &  nodes 
) const
overridevirtual
Parameters
elementThe element handle we're requesting the nodes for
nodesA node list to write the results to
Returns
Whether the requested nodes were retrieved

Implements MeshElementsInterface.

◆ getStateImpl() [1/2]

bool getStateImpl ( const ElementHandle elementHandle,
const ElementStateHandle state,
DataExecution::DataObject result 
) const
overrideprotectedvirtual
Parameters
elementHandleThe element 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)

Should be implmented as the const equivalent to getState()

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 MeshElementsInterface.

◆ getStateImpl() [2/2]

bool getStateImpl ( const ElementHandle elementHandle,
const ElementStateHandle state,
DataExecution::DataObject result 
)
overrideprotectedvirtual
Parameters
elementHandleThe element 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 MeshElementsInterface.

◆ 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 element states of this type for this element type.
See also
addState(const QString& name, const T& defaultValue)

Implements MeshElementsInterface.

◆ remove()

void remove ( const ElementHandle elementHandle)
overridevirtual

Implements MeshElementsInterface.

◆ removeStateFromImplementation()

bool removeStateFromImplementation ( const ElementStateHandle 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 MeshElementsInterface.

◆ setNode()

bool setNode ( const ElementHandle element,
const NodeHandle node,
size_type  index 
)
overridevirtual
Parameters
elementThe element handle we're setting the nodes for
nodeThe node to set
indexThe index to set the node for this element
Returns
Whether the requested nodes were set

Implements MeshElementsInterface.

◆ setNodes()

bool setNodes ( const ElementHandle element,
const NodeHandleList &  nodes 
)
overridevirtual
Parameters
elementThe element handle we're setting the nodes for
nodesA node list containing the nodes to set
Returns
Whether the requested nodes were set

Implements MeshElementsInterface.

◆ setState()

bool setState ( const ElementHandle elementHandle,
const ElementStateHandle state,
const DataExecution::DataObject value 
)
overridevirtual
Parameters
elementHandleThe element 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 MeshElementsInterface.

◆ size()

MeshElementsInterface::size_type size ( ) const
overridevirtual

Implements MeshElementsInterface.