Node mapper returning a particular node state as its value.
#include <Mesh/DataStructures/vectornodestatemapper.h>
◆ VectorNodeStateMapper() [1/2]
The mapper is constructed with no state name set. The vector mapping defaults to mapping the vector magnitude.
- See also
- setStateName()
◆ VectorNodeStateMapper() [2/2]
◆ ~VectorNodeStateMapper()
◆ canSerialize()
bool canSerialize |
( |
| ) |
const |
|
overridevirtual |
◆ clone()
- Returns
- A clone of this object.
- Note
- Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.
Implements VectorNodeMapper.
◆ createMementoData()
- Parameters
-
model | The model that will be used for mapping nodes to values. |
- Returns
- A memento object which client code cannot do anything useful with except pass it around. The memento is ultimately only useful to the getValue() function. It holds internal data the mapper will use to perform the required mapping.
- Note
- The memento can be considered valid for as long as model is not modified and the state name of the mapper remains the same. As soon as the state name or anything in model is changed, the caller should obtain a new memento.
Implements VectorNodeMapper.
◆ getStateName()
const QString & getStateName |
( |
| ) |
const |
- Returns
- The name of the state to map to a value.
- See also
- setStateName()
◆ getValue()
- Parameters
-
node | The node whose state should be mapped to a value. |
mementoData | The data from the memento created by a previous call to createMementoData(). It is used internally by this function to work out what value needs to be returned. |
- Returns
- The value of the requested state from this node. If mementoData is invalid, which can happen if the requested node state is not in the model passed to createMementoData(), then this function returns 0.
Implements VectorNodeMapper.
◆ load()
◆ operator=()
◆ save()
◆ setStateName()
void setStateName |
( |
const QString & |
name | ) |
|
- Parameters
-
name | The name of the state to be mapped to a value. The state can be any of the supported state types. Scalar doubles and integers are both returned directly. Values for vector states are returned according to the current setting returned by getVectorMapping(). As a special case, the node ID can be requested with the state name "id". |
- See also
- getStateName(), setVectorMapping()