Workspace 6.21.5
Public Member Functions | Protected Member Functions | List of all members
Glypher Class Referenceabstract

Base class for glyphers to be used with a MeshModelInstance.

#include <Rendering/SceneComponents/Models/glypher.h>

Inheritance diagram for Glypher:
[legend]

Public Member Functions

 ~Glypher () override
 
bool canSerialize () const override
 
Glypherclone () const override=0
 
QString getCacheId () const
 
bool getEnabled () const
 
virtual Glyph getGlyph (const Mesh::ElementHandle &element)
 
virtual Glyph getGlyph (const Mesh::NodeHandle &node)=0
 
int getInterval () const
 
virtual Mesh::MeshModelLibrarygetMeshModelLibrary ()=0
 
virtual bool isElementGlypher (const CSIRO::Mesh::ElementType::Type **elementType) const
 
virtual bool isNodeGlypher () const
 
bool load (const DataExecution::SerializedItem &item) override
 
bool save (DataExecution::SerializedItem &item) const override
 
void setEnabled (bool b)
 
virtual void setGlyphedModel (const Mesh::MeshModelInterface &model)
 
void setInterval (int interval)
 
void setIntervalStateName (const QString &stateName)
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()=default
 
virtual Clonableclone () const =0
 
- Public Member Functions inherited from Serialize
virtual ~Serialize ()=default
 
virtual bool canSerialize () const =0
 
virtual bool load (const SerializedItem &item)=0
 
virtual bool save (SerializedItem &item) const =0
 

Protected Member Functions

 Glypher ()
 
 Glypher (const Glypher &glypher)
 
bool matchInterval (const Mesh::ElementHandle &elt) const
 
bool matchInterval (const Mesh::NodeHandle &node) const
 
Glypheroperator= (const Glypher &glypher)
 

Constructor & Destructor Documentation

◆ Glypher() [1/2]

Glypher ( )
protected

◆ Glypher() [2/2]

Glypher ( const Glypher glypher)
protected

◆ ~Glypher()

~Glypher ( )
override

Member Function Documentation

◆ canSerialize()

bool canSerialize ( ) const
overridevirtual
Returns
True if this object can be serialized.

For objects that can be serialized, the save and load functions will be used to do the serialization. If this function returns false, both load() and save() must also return false.

Implements Serialize.

◆ clone()

Glypher * clone ( ) const
overridepure virtual
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 Clonable.

Implemented in RodGlypher, SphereGlypher, SquareGlypher, StreakGlypher, SuperquadricGlypher, and VectorGlypher.

◆ getCacheId()

QString getCacheId ( ) const
Returns
A string which characterizes the parameters which affect the output of this object. It should be unique for each possible combination of the inputs. A common format is to append strings in the form ":key=value" to assist debugging, but any string that is unique for a given set of parameters is acceptable.
Note
The default implementation uses the serialization function save() to generate an appropriate string. Subclasses can override this function to provide a more efficient string if they so wish, since the default implementation is likely to be relatively expensive.

◆ getEnabled()

bool getEnabled ( ) const
Returns
whether or not the texturizer is enabled.

◆ getGlyph() [1/2]

Glyph getGlyph ( const Mesh::ElementHandle element)
virtual
Parameters
elementThe element for which a glyph should be returned.
Returns
A glyph object which can be used for the specified element. It is allowable for this function to return an invalid glyph to indicate that no glyph should be used for this element.

Reimplemented in RodGlypher.

◆ getGlyph() [2/2]

virtual Glyph getGlyph ( const Mesh::NodeHandle node)
pure virtual
Parameters
nodeThe node for which a glyph should be returned.
Returns
A glyph object which can be used for the specified node. It is allowable for this function to return an invalid glyph to indicate that no glyph should be used for this node.

Implemented in RodGlypher, SphereGlypher, SquareGlypher, StreakGlypher, SuperquadricGlypher, and VectorGlypher.

◆ getInterval()

int getInterval ( ) const

Returns the interval between glyphs, i.e. number of nodes that remain unglyphed between each glyphed node.

Returns
The glypher interval.

◆ getMeshModelLibrary()

virtual Mesh::MeshModelLibrary & getMeshModelLibrary ( )
pure virtual
Returns
The mesh model library the glypher uses to hold its glyphs. Most glyphers will employ their own internal model library (possibly shared between all glyphers of that type) for efficiency reasons and to keep model id's short and simple.

Implemented in RodGlypher, SphereGlypher, SquareGlypher, StreakGlypher, SuperquadricGlypher, and VectorGlypher.

◆ isElementGlypher()

bool isElementGlypher ( const CSIRO::Mesh::ElementType::Type **  elementType) const
virtual

Reimplemented in RodGlypher.

◆ isNodeGlypher()

bool isNodeGlypher ( ) const
virtual

Reimplemented in RodGlypher.

◆ load()

bool load ( const DataExecution::SerializedItem item)
overridevirtual
Parameters
itemSupplies the state to be loaded into this object.

This function will load the state of this object from item. For many object types, this is most easily implemented in terms of the object's input operator (>>).

It would be reasonable for subclass implementations to assume that the data provided in item is in the same form as would have been saved from a call to save.

Returns
If the state of the object could not be loaded, the function returns false. A return value of true implies that the object state was successfully loaded. If canSerialize() returns false, this function must do nothing except return false as well.

Implements Serialize.

Reimplemented in RodGlypher, SphereGlypher, SquareGlypher, StreakGlypher, SuperquadricGlypher, and VectorGlypher.

◆ matchInterval() [1/2]

bool matchInterval ( const Mesh::ElementHandle elt) const
protected
Parameters
eltThe element to test whether it matches the interval.
Returns
True if the provided element has an index that is on the interval specified in the glypher.

◆ matchInterval() [2/2]

bool matchInterval ( const Mesh::NodeHandle node) const
protected
Parameters
nodeThe node to test whether it matches the interval.
Returns
True if the provided node has an index that is on the interval specified in the glypher.

◆ operator=()

Glypher & operator= ( const Glypher glypher)
protected

◆ save()

bool save ( DataExecution::SerializedItem item) const
overridevirtual
Parameters
itemWhere to save the state of this object.

This function will serialise the object by saving it to item. For most object types, this is most easily implemented in terms of the object's output operator (<<).

It is allowable for an object to only serialize part of itself. This would be useful if the data it represents has a set of defaults and only those values different to the defaults need to be serialized. Such an implementation then needs to be careful how it handles the complimentary load member function.

Returns
If an object could not be serialised or if the underlying object type does not support serialisation, this function should return false. A return value of true implies that the object was successfully saved to item. If canSerialize() returns false, this function must do nothing except return false as well.

Implements Serialize.

Reimplemented in RodGlypher, SphereGlypher, SquareGlypher, StreakGlypher, SuperquadricGlypher, and VectorGlypher.

◆ setEnabled()

void setEnabled ( bool  b)
Parameters
bwhether or not to enable the texturizer.

◆ setGlyphedModel()

void setGlyphedModel ( const Mesh::MeshModelInterface model)
virtual
Parameters
modelThe model about to be glyphed.

Subclasses can reimplement this function to save internal data about the model that will be used for subsequent calls to getGlyph(). Clients are free to call this function at any time, so the subclass must keep this in mind, although it will usually only be called by a model appearance processor just before it uses the glypher to process the specified model.

NOTE: Derived classes must call this base class's method.

Reimplemented in RodGlypher, SphereGlypher, SquareGlypher, StreakGlypher, SuperquadricGlypher, and VectorGlypher.

◆ setInterval()

void setInterval ( int  interval)

Sets the interval between glyphs, i.e. number of nodes that remain unglyphed between each glyphed node.

Parameters
intervalInteger in the range [1,inf) specifying how many unglyphed nodes are to be drawn between glyphed nodes.

◆ setIntervalStateName()

void setIntervalStateName ( const QString &  stateName)

Specify the state name that will be used control the interval