Workspace 6.21.5
|
Generic 3D image texture. More...
#include <Rendering/SceneComponents/Models/texture3d.h>
Public Member Functions | |
Texture3D () | |
Texture3D (const Texture3D &texturizer) | |
~Texture3D () override | |
void | clearImages () |
Texture3D * | clone () const override |
virtual QString | getCacheId () const |
unsigned | getDimensions () const override |
const DataAnalysis::Image3d & | getImage (int index=0) const |
unsigned | getNumImages () const override |
const QString & | getStateNameR () const |
const QString & | getStateNameS () const |
const QString & | getStateNameT () const |
Mesh::Vector3d | getTextureCoords (const Mesh::NodeHandle &node) const override |
TextureImage | getTextureImage (int index) const override |
bool | load (const DataExecution::SerializedItem &item) override |
Texture3D & | operator= (const Texture3D &texturizer) |
bool | save (DataExecution::SerializedItem &item) const override |
int | setImage (const DataAnalysis::Image3d *image, int index=-1) |
void | setStateNameR (const QString &name) |
void | setStateNameS (const QString &name) |
void | setStateNameT (const QString &name) |
bool | setTexturedModel (const Mesh::MeshModelInterface &model, bool glyphing) override |
Public Member Functions inherited from Texturizer | |
~Texturizer () override | |
bool | canSerialize () const override |
Texturizer * | clone () 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 Clonable * | clone () 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 |
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) | |
Texturizer & | operator= (const Texturizer &t) |
3D image textures should generally have a width and height that is a power of 2. If they don't, some renderers might scale them accordingly which will still yield the correct result, but the image quality might not be as good as if a correctly sized image was provided in the first place.
Texture3D | ( | ) |
|
override |
void clearImages | ( | ) |
Discards all images currently held by the texturizer.
|
overridevirtual |
Implements Texturizer.
|
virtual |
|
overridevirtual |
Implements Texturizer.
const Image3d & getImage | ( | int | index = 0 | ) | const |
index | The index of the image to retrieve. |
|
overridevirtual |
Implements Texturizer.
const QString & getStateNameR | ( | ) | const |
const QString & getStateNameS | ( | ) | const |
const QString & getStateNameT | ( | ) | const |
|
overridevirtual |
node | The node we want the texture co-ordinate of |
Implements Texturizer.
|
overridevirtual |
index | The index of the texture image to retrieve. It must be a non-negative number less than the result of getNumImages(). |
Implements Texturizer.
|
overridevirtual |
item | Supplies 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.
Implements Serialize.
|
overridevirtual |
item | Where 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.
Implements Serialize.
int setImage | ( | const DataAnalysis::Image3d * | image, |
int | index = -1 |
||
) |
image | The image to use for the 3D texture. It should normally have a width and height that is an integer power of 2. |
index | The index of the image. If omitted, the default value of -1 indicates that the image should be appended to the array of images already added. |
void setStateNameR | ( | const QString & | name | ) |
name | The name of the node state which specifies the T component of the (S,T,R) texture co-ordinate space. |
void setStateNameS | ( | const QString & | name | ) |
name | The name of the node state which specifies the S component of the (S,T) texture co-ordinate space. |
void setStateNameT | ( | const QString & | name | ) |
name | The name of the node state which specifies the T component of the (S,T) texture co-ordinate space. |
|
overridevirtual |
model | The model about to be textured. |
glyphing | If 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.
Reimplemented from Texturizer.