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

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

Inheritance diagram for NoTexture:
[legend]

Public Member Functions

 NoTexture ()
 
 NoTexture (const NoTexture &notex)=default
 
Texturizerclone () const override
 
virtual QString getCacheId () const
 
unsigned getDimensions () const override
 
unsigned getNumImages () const override
 
Mesh::Vector3d getTextureCoords (const Mesh::NodeHandle &) const override
 
TextureImage getTextureImage (int) const override
 
bool setTexturedModel (const Mesh::MeshModelInterface &, bool) override
 
- Public Member Functions inherited from Texturizer
 ~Texturizer () override
 
bool canSerialize () const override
 
Texturizerclone () const override=0
 
QString getCacheId () const
 
virtual unsigned getDimensions () const =0
 
bool getEnabled () const
 
bool getInterpolate () const
 
unsigned getNumDimensionsEnabled () const
 
virtual unsigned getNumImages () const =0
 
unsigned getNumImagesEnabled () const
 
virtual Mesh::Vector3d getTextureCoords (const Mesh::NodeHandle &node) const =0
 
virtual TextureImage getTextureImage (int index) const =0
 
Wrapping getWrapping () const
 
bool load (const DataExecution::SerializedItem &item) override
 
bool save (DataExecution::SerializedItem &item) const override
 
void setEnabled (bool b)
 
void setInterpolate (bool b)
 
virtual bool setTexturedModel (const Mesh::MeshModelInterface &model, bool glyphing)
 
void setWrapping (Wrapping wrap)
 
- 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
 

Static Public Member Functions

static NoTexturenullObject ()
 

Additional Inherited Members

- Public Types inherited from Texturizer
enum  Wrapping { ClampToEdge , ClampToBorder , Repeat , MirroredRepeat }
 
- Protected Member Functions inherited from Texturizer
 Texturizer ()
 
 Texturizer (const Texturizer &t)
 
Texturizeroperator= (const Texturizer &t)
 

Constructor & Destructor Documentation

◆ NoTexture() [1/2]

NoTexture ( )
inline

◆ NoTexture() [2/2]

NoTexture ( const NoTexture notex)
default

Member Function Documentation

◆ clone()

Texturizer * clone ( ) const
inlineoverridevirtual
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 Texturizer.

◆ getCacheId()

virtual QString getCacheId ( ) const
inlinevirtual

◆ getDimensions()

unsigned getDimensions ( ) const
inlineoverridevirtual
Returns
The number of dimensions this texturizer supports. This should always be 1, 2 or 3, although it is conceivable that a texturizer might have 4 dimensions (but really that would be a modification of 3 dimensions with the 4th dimension being associated with the w component). A value of zero can also be returned as a special case to denote a texturizer which does not apply a texture at all.

Implements Texturizer.

◆ getNumImages()

unsigned getNumImages ( ) const
inlineoverridevirtual
Returns
The number of images this texturizer holds. Some texturizers provide only one image, whereas others provide a set of images and the image to use for any given element is found by calling getTextureImage(). The getNumImages() function can be used by model processors to work out how many images they will need to handle during processing.

Implements Texturizer.

◆ getTextureCoords()

Mesh::Vector3d getTextureCoords ( const Mesh::NodeHandle node) const
inlineoverridevirtual
Parameters
nodeThe node we want the texture co-ordinate of
Precondition
setTexturedModel must have already been called with the MeshModelInterface that the supplied node belongs to.
Returns
The texture co-ordinates for the specified node. While the result returned is a 3D vector corresponding to the (s,t,r) texture co-ordinates, for lower dimensional textures simply ignore the latter components (eg 2D textures ignore the r component). For consistency, lower dimensional texturizers must set components they don't use to zero.
See also
getTextureImage(), setTexturedModel()

Implements Texturizer.

◆ getTextureImage()

TextureImage getTextureImage ( int  index) const
inlineoverridevirtual
Parameters
indexThe index of the texture image to retrieve. It must be a non-negative number less than the result of getNumImages().
Returns
The texture image corresponding to the specified index.

Implements Texturizer.

◆ nullObject()

static NoTexture & nullObject ( )
inlinestatic

◆ setTexturedModel()

bool setTexturedModel ( const Mesh::MeshModelInterface model,
bool  glyphing 
)
inlineoverridevirtual
Parameters
modelThe model about to be textured.
glyphingIf true, the texture image selection by getTextureImage() should be based on node states instead of element states, since the the glyph that will be textured reflects the node states and no model elements are normally present or shown.

Subclasses can reimplement this function to save internal data about the model that will be used for subsequent calls to getTextureCoords() and getTextureImage(). 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 texturizer to process the specified model or before it outputs a glyph.

Returns
True if successful or false if there was an error when trying to use the specified model. If the texturizer will not be able to return valid texture co-ordinates (eg texture co-ordinate node states are missing in the model), this function should return false.

Reimplemented from Texturizer.