29 #ifndef __X3DTEXTURE3DNODE_H__
30 #define __X3DTEXTURE3DNODE_H__
55 virtual string getValueAsString(
const string& separator =
" ");
57 virtual X3DTypes::X3DType
getX3DType() {
return X3DTypes::SFIMAGE; }
60 class UpdateTextureProperties :
public Field{
62 virtual void update();
67 typedef DependentSFNode< FieldRef<TextureProperties,
74 virtual void onNewValue(
const std::string &v );
79 Inst< SFNode > _metadata = 0,
80 Inst< SFBool > _repeatS = 0,
81 Inst< SFBool > _repeatT = 0,
82 Inst< SFBool > _repeatR = 0,
83 Inst< SFBool > _scaleToP2 = 0,
84 Inst< SFImage > _image = 0,
85 Inst< SFTextureProperties > _textureProperties = 0,
86 Inst< UpdateSaveToURL > _saveToUrl = 0,
87 Inst< SFBool > _saveSuccess = 0,
88 Inst< SFInt32 > _saveHeight = 0,
89 Inst< SFInt32 > _saveWidth = 0 );
94 virtual void render();
97 virtual void renderTextureProperties();
100 virtual GLint glInternalFormat(
Image *_image );
105 virtual void enableTexturing();
110 virtual void disableTexturing();
113 virtual GLuint64 getTextureHandle();
119 Image *tex_image = image->getValue();
122 size.x *= tex_image->
width();
123 size.y *= tex_image->
height();
124 size.z *= tex_image->
depth();
127 return Vec3f( 0, 0, 0 );
137 virtual void glTexImage(
Image *_image, GLenum _texture_target,
138 bool scale_to_power_of_two );
141 virtual void renderSubImage(
Image *_image, GLenum _texture_target,
142 int xoffset,
int yoffset,
int z_offset,
143 int width,
int height,
int depth );
145 virtual void setTextureWidth(
int _width );
147 virtual void setTextureHeight(
int _height );
149 virtual void setTextureDepth(
int _depth );
212 virtual std::pair<H3DInt32,H3DInt32> getDefaultSaveDimensions ();
229 virtual GLenum glPixelFormat(
Image *_image );
234 bool mip_mapping_used;
Contains the DependentSFNode and DependentMFNode template classes.
Header file for H3DImageObject, X3D abstract texture scene-graph node.
Header file for H3DSingleTextureNode, X3D scene-graph node.
Header file for TextureProperties, X3D scene-graph node.
virtual Vec3f pixelSize()
virtual unsigned int depth()=0
virtual unsigned int width()=0
virtual unsigned int height()=0
The Field class.
Definition: Field.h:46
The SFImage field is a field containing an Image pointer.
Definition: H3DImageObject.h:50
This abstract interface is inherited by all nodes that contains an SFImage object with an Image conta...
Definition: H3DImageObject.h:45
This abstract node type is the base type for all texture nodes that is defined by a single texture.
Definition: H3DSingleTextureNode.h:45
H3DUniquePtr< Field > propertyChanged
Field that gets an event when any of the X3D fields in the TextureProperties generates an event.
Definition: TextureProperties.h:369
A SFNode encapsulating an Image class.
Definition: X3DTexture3DNode.h:49
virtual X3DTypes::X3DType getX3DType()
Returns the X3DType of the field.
Definition: X3DTexture3DNode.h:57
virtual void setValueFromString(const string &s)
Set the value of the field given a string.
Definition: X3DTexture3DNode.h:51
This abstract node type is the base type for all node types which specify 3D sources for texture imag...
Definition: X3DTexture3DNode.h:46
H3DUniquePtr< SFBool > repeatS
If true the texture will repeat itself when the s texture coordinate is outside the range [0,...
Definition: X3DTexture3DNode.h:159
DependentSFNode< FieldRef< TextureProperties, Field, &TextureProperties::propertyChanged > > SFTextureProperties
The SFTextureProperties is dependent on the propertyChanged field of the contained TextureProperties.
Definition: X3DTexture3DNode.h:70
H3DUniquePtr< SFBool > repeatT
If true the texture will repeat itself when the t texture coordinate is outside the range [0,...
Definition: X3DTexture3DNode.h:169
virtual Vec3f textureSize()
Sometimes the texture represents a volume in space, e.g.
Definition: X3DTexture3DNode.h:118
H3DUniquePtr< UpdateTextureProperties > updateTextureProperties
Field that will make sure that the texture properties changes are transferred to the texture when cha...
Definition: X3DTexture3DNode.h:226
H3DUniquePtr< Field > imageUpdated
Field to indicate image changed C++ only field.
Definition: X3DTexture3DNode.h:216
H3DUniquePtr< SFTextureProperties > textureProperties
The textureProperties field contains a TextureProperties node which allows fine control over a textur...
Definition: X3DTexture3DNode.h:202
H3DUniquePtr< SFBool > scaleToPowerOfTwo
If true the image used will be scaled so that the dimensions are a power of two if they are not.
Definition: X3DTexture3DNode.h:194
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: X3DTexture3DNode.h:205
H3DUniquePtr< SFBool > repeatR
If true the texture will repeat itself when the r texture coordinate is outside the range [0,...
Definition: X3DTexture3DNode.h:179
H3DUniquePtr< Field > textureUpdated
Field which is used to trigger an update of the texture when it has been modified through some functi...
Definition: X3DTexture3DNode.h:221
A field used to execute the save to URL operation when the URL is set.
Definition: X3DTextureNode.h:63
PixelImage * X3DStringTo3DImage(const string &x3d_string)
Convert a string to a 3D PixelImage according to the X3D spec for Pixel3DTexture.
Definition: X3DFieldConversion.cpp:36
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194