H3D API  2.4.1
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
H3D::SimpleMovieTexture Class Reference

SimpleMovieTexture is a node for showing movies as textures with a simpler interface than the movie texture node. More...

#include <H3D/SimpleMovieTexture.h>

Inheritance diagram for H3D::SimpleMovieTexture:
Inheritance graph

Classes

class  DecoderManager
 The DecoderManager class manages all state changes in the decoder depending on the values of the fields in
SimpleMovieTexture. More...
 
class  FieldUpdater
 The FieldUpdater field updates all output fields in the SimpleMovieTexture node that needs to be updated each frame. More...
 

Public Member Functions

 SimpleMovieTexture (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< SFBool > _repeatS=0, Inst< SFBool > _repeatT=0, Inst< SFBool > _scaleToP2=0, Inst< SFImage > _image=0, Inst< SFTextureProperties > _textureProperties=0, Inst< SFBool > _play=0, Inst< SFBool > _stop=0, Inst< SFBool > _pause=0, Inst< SFTime > _duration=0, Inst< SFFloat > _rate=0, Inst< SFBool > _playAudio=0, Inst< SFBool > _loop=0, Inst< SFInt32 > _width=0, Inst< SFInt32 > _height=0, Inst< MFString > _url=0, Inst< SFTime > _elapsedTime=0)
 Constructor.
 
- Public Member Functions inherited from H3D::H3DVideoTextureNode
 H3DVideoTextureNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< SFBool > _repeatS=0, Inst< SFBool > _repeatT=0, Inst< SFBool > _scaleToP2=0, Inst< SFImage > _image=0, Inst< SFTextureProperties > _textureProperties=0)
 Constructor.
 
virtual void traverseSG (TraverseInfo &ti)
 Traverse the senegraph.
 
virtual void render ()
 Render the texture.
 
- Public Member Functions inherited from H3D::X3DTexture2DNode
 X3DTexture2DNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< SFBool > _repeatS=0, Inst< SFBool > _repeatT=0, Inst< SFBool > _scaleToP2=0, Inst< SFImage > _image=0, Inst< SFTextureProperties > _textureProperties=0)
 Constructor.
 
virtual void renderTextureProperties ()
 Render all OpenGL texture properties.
 
virtual GLuint64 getTextureHandle ()
 Get the bindless texture handle.
 
virtual void enableTexturing ()
 Virtual function for making all OpenGL calls that are needed to enable texturing for the texture.
 
virtual void disableTexturing ()
 Virtual function for making all OpenGL calls that are needed to disable texturing for the texture.
 
virtual GLint glInternalFormat (Image *_image)
 Returns the internal OpenGL format to use given an Image.
 
virtual void glTexImage (Image *_image, GLenum _texture_target, bool scale_to_power_of_two)
 Installs the given image as a OpenGL texture with a call to the glTexImage2D function. More...
 
virtual void renderSubImage (Image *_image, GLenum _texture_target, int xoffset, int yoffset, int width, int height)
 Replaces part of the current texture from an image.
 
virtual ImagerenderToImage (H3DInt32 _width, H3DInt32 _height, bool output_float_texture=false)
 override the render to image function, to download the texture_id directly from graphic card
 
virtual void setTextureWidth (int _width)
 Set the texture width.
 
virtual void setTextureHeight (int _height)
 Set the texture height.
 
virtual GLenum glPixelFormat (Image *_image)
 Returns the OpenGL pixel format to use given an Image, e.g.
 
- Public Member Functions inherited from H3D::H3DSingleTextureNode
 H3DSingleTextureNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< UpdateSaveToURL > _saveToUrl=0, Inst< SFBool > _saveSuccess=0, Inst< SFInt32 > _saveHeight=0, Inst< SFInt32 > _saveWidth=0)
 Constructor.
 
virtual ~H3DSingleTextureNode ()
 Destructor.
 
virtual GLuint getTextureId ()
 Get the OpenGL texture id that is used for this texture.
 
virtual GLuint getTextureUnit ()
 Get the OpenGL texture unit that is used for this texture.
 
virtual GLenum getTextureTarget ()
 Get the OpenGL texture target that is used for this texture.
 
virtual int getTextureWidth ()
 Get the texture width.
 
virtual int getTextureHeight ()
 Get the texture height.
 
virtual int getTextureDepth ()
 Get the texture depth.
 
virtual void setTextureDepth (int _depth)
 Set the texture depth.
 
virtual void setTextureId (GLuint _id)
 Set the OpenGL texture id that is used for this texture.
 
virtual void setTextureUnit (GLint unit)
 Set the OpenGL texture unit that is used for this texture.
 
virtual void setTextureTarget (GLenum target)
 Set the OpenGL texture target that is used for this texture.
 
virtual bool makeResident ()
 { Bindless texturing functions More...
 
virtual void makeNonResident ()
 Make the texture non-resident.
 
virtual bool isResident ()
 Returns true if the texture is resident in GPU memory or false otherwise.
 
virtual void invalidateTextureHandle ()
 This should be called if the texture object is to be replaced. More...
 
void addShaderField (Field &_field)
 Add a shader field which contains this texture node. More...
 
void removeShaderField (Field &_field)
 Remove a shader field which contains this texture node. More...
 
virtual void inUse ()
 Call to signify that this texture is currently in use. More...
 
- Public Member Functions inherited from H3D::X3DTextureNode
 X3DTextureNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< UpdateSaveToURL > _saveToUrl=0, Inst< SFBool > _saveSuccess=0, Inst< SFInt32 > _saveHeight=0, Inst< SFInt32 > _saveWidth=0)
 Constructor.
 
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value. More...
 
virtual void preRender ()
 This function will be called by the X3DShapeNode before any rendering of geometry and before the call to the render function.
 
virtual void postRender ()
 This function will be called by the X3DShapeNode after the geometry has been rendered to restore the states to what it was before the call to preRender().
 
virtual GLbitfield getAffectedGLAttribs ()
 Returns a bitmask of the OpenGL attrib bits that will be affected by this node. More...
 
virtual Vec3f textureSize ()
 Sometimes the texture represents a volume in space, e.g. More...
 
virtual GLuint renderImage (Image *image, GLenum texture_target, bool scale_to_power_of_two)
 Installs the image as a OpenGL texture. More...
 
virtual GLenum glPixelComponentType (Image *image)
 Returns the OpenGL pixel compnent type to use given an Image, e.g. More...
 
- Public Member Functions inherited from H3D::X3DAppearanceChildNode
 X3DAppearanceChildNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0)
 Constructor.
 
- Public Member Functions inherited from H3D::X3DNode
 X3DNode (Inst< SFNode > _metadata=0)
 Constructor.
 
X3DMetadataObjectgetMetadataByName (const string &_name)
 Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More...
 
- Public Member Functions inherited from H3D::Node
 Node ()
 Constructor.
 
virtual Nodeclone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL)
 Returns a new instance of this node type with the same state as this one. More...
 
virtual ~Node ()
 Destructor.
 
X3DPrototypeInstancegetProtoInstanceParent ()
 If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More...
 
void setProtoInstanceParent (X3DPrototypeInstance *p)
 Set the X3DPrototypeInstance this node is the the root node if applicaple.
 
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and the Node. More...
 
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on Node to p. More...
 
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the Node. More...
 
virtual FieldgetField (const string &_name) const
 return a pointer to the field specified by name within this instance
 
int addDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
int removeDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
- Public Member Functions inherited from H3D::H3DDisplayListObject
 H3DDisplayListObject (Inst< DisplayList > _displayList=0)
 Constructor.
 
- Public Member Functions inherited from H3D::H3DImageObject
 H3DImageObject (Inst< SFImage > _image=0)
 Constructor.
 
- Public Member Functions inherited from H3D::X3DUrlObject
 X3DUrlObject (Inst< MFString > _url=0)
 Constructor.
 
virtual LoadStatus loadStatus ()
 The loadStatus function returns the status of the loading of the current urls in order to be used with the LoadSensor node.
 
virtual H3DFloat loadProgress ()
 The loadProgress() functions returns a value between 0 and 1 indicating how much of the current url has been loaded. More...
 
void setURLUsed (const string &_url_used)
 Set the url that is currently loaded.
 
const string & getURLUsed ()
 Get the url that is currently loaded.
 
void setURLBase (const string &_url_base)
 Set the url base address.
 
const string & getURLBase ()
 Get the current url base address.
 
string resolveURLAsFile (const string &url, bool *is_tmp_file=NULL)
 Get the url as a local file.
 
string resolveURLAsString (const string &url)
 Get the content of the URL as a string.
 
bool removeTmpFile (const string &file)
 Remove a tmpfile with the given name. More...
 

Public Attributes

H3DUniquePtr< SFBoolplay
 If a true event is received by the "play" field the movie will start playing, if it paused or stopped. More...
 
H3DUniquePtr< SFBoolstop
 If a true event is received by the "stop" field the movie will stop playing, and the playback position will be reset to the beginning, so that a later "play" event will start playing from the start. More...
 
H3DUniquePtr< SFBoolpause
 If a true event is received by the "pause" field the movie will be paused. More...
 
H3DUniquePtr< SFTimeduration
 The duration field is an output only field for the duration of the currently loaded video clip played at normal rate in seconds. More...
 
H3DUniquePtr< SFFloatrate
 The rate field determines the rate at which the movie should be played. More...
 
H3DUniquePtr< SFBoolplayAudio
 The playAudio field determines whether audio should be played or not if the movie contains an audio stream. More...
 
H3DUniquePtr< SFBoolloop
 The loop field determines or not the movie should start over from the beginning when the end has been reached. More...
 
H3DUniquePtr< SFInt32videoWidth
 The videoWidth contains the width in pixels of the currently loaded video clip. More...
 
H3DUniquePtr< SFInt32videoHeight
 The videoWidth contains the width in pixels of the currently loaded video clip. More...
 
H3DUniquePtr< SFTimeelapsedTime
 The elapsedTime field is the time elapsed from the start time of the clip in seconds. More...
 
H3DUniquePtr< FieldUpdaterfieldUpdater
 The fieldUpdater field is updating all output fields that needs to be updated each frame.
 
H3DUniquePtr< DecoderManagerdecoderManager
 The DecoderManager class manages all state changes in the decoder depending on the values of the fields in
SimpleMovieTexture.
 
- Public Attributes inherited from H3D::X3DTexture2DNode
H3DUniquePtr< SFBoolrepeatS
 If true the texture will repeat itself when the s texture coordinate is outside the range [0,1]. More...
 
H3DUniquePtr< SFBoolrepeatT
 If true the texture will repeat itself when the t texture coordinate is outside the range [0,1]. More...
 
H3DUniquePtr< SFBoolscaleToPowerOfTwo
 If true the image used will be scaled so that the dimensions are a power of two if they are not. More...
 
H3DUniquePtr< SFTexturePropertiestextureProperties
 The textureProperties field contains a TextureProperties node which allows fine control over a texture's application. More...
 
H3DUniquePtr< UpdateTextureProperties > updateTextureProperties
 Field that will make sure that the texture properties changes are transferred to the texture when changed. More...
 
- Public Attributes inherited from H3D::X3DTextureNode
H3DUniquePtr< UpdateSaveToURLsaveToUrl
 When a new value is specified for saveToUrl the current texture is rendered to a buffer and saved to the specified filename. More...
 
H3DUniquePtr< SFBoolsaveSuccess
 Contains the result of the last save operation. More...
 
H3DUniquePtr< SFInt32saveHeight
 The height of the image to write to file when the saveToUrl field is used. More...
 
H3DUniquePtr< SFInt32saveWidth
 The width of the image to write to file when the saveToUrl field is used. More...
 
- Public Attributes inherited from H3D::X3DNode
H3DUniquePtr< SFNodemetadata
 Meta data about the node. More...
 
- Public Attributes inherited from H3D::H3DDisplayListObject
H3DUniquePtr< DisplayListdisplayList
 The DisplayList instance handling the OpenGL caching of this object.
 
- Public Attributes inherited from H3D::H3DImageObject
H3DUniquePtr< SFImageimage
 Field containing the Image to use as a texture.
 
- Public Attributes inherited from H3D::X3DUrlObject
H3DUniquePtr< MFStringurl
 The urls in decreasing order of preference.
 

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::H3DVideoTextureNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DTexture2DNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DTextureNode
static bool load_images_in_separate_thread = true
 This is the default value for the GlobalSettings::loadTexturesInThread field. More...
 
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 

Additional Inherited Members

- Public Types inherited from H3D::X3DTexture2DNode
typedef DependentSFNode< FieldRef< TextureProperties, Field, &TextureProperties::propertyChanged > > SFTextureProperties
 The SFTextureProperties is dependent on the propertyChanged field of the contained TextureProperties.
 
- Public Types inherited from H3D::Node
typedef std::map< Node *, Node * > DeepCopyMap
 A map type used during a deep copy clone() to map from original nodes to cloned nodes.
 
- Public Types inherited from H3D::X3DUrlObject
enum  LoadStatus { INIT , LOADED , LOADING , FAILED }
 The load status of the given url. More...
 
- Static Public Member Functions inherited from H3D::H3DSingleTextureNode
static void makeUnusedTexturesNonResident (H3DTime _unusedTime)
 Look at all resident textures and make those that have not been used recently non-resident. More...
 
- Static Public Member Functions inherited from H3D::X3DTextureNode
static X3DTextureNodegetActiveTexture ()
 Gets the currently active texture, i.e. More...
 
static void setActiveTexture (X3DTextureNode *t)
 Set the active texture. More...
 
- Static Public Member Functions inherited from H3D::Node
static unsigned int nrNodesAlive ()
 Returns the nr of nodes currently alive, i.e. nodes created but not destructed.
 
static int nrNodesCreated ()
 Returns the number of nodes created in total since the start of the program.
 
- Protected Types inherited from H3D::H3DSingleTextureNode
typedef std::vector< H3DSingleTextureNode * > TextureVector
 }
 
- Protected Member Functions inherited from H3D::X3DTexture2DNode
virtual std::pair< H3DInt32, H3DInt32getDefaultSaveDimensions ()
 Returns the default dimensions to use when this texture is saved to file. More...
 
- Protected Member Functions inherited from H3D::X3DTextureNode
GLint glCompressedInternalFormat (GLint _format, const std::string &_compression)
 Given a non-compressed internal format, return an equivelent compressed format based on the compression settings. More...
 
- Protected Member Functions inherited from H3D::Node
void cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for the clone() method. More...
 
- Protected Member Functions inherited from H3D::X3DUrlObject
string resolveURL (const string &_url, bool return_contents, bool *is_tmp_file=NULL)
 Helper function for resolveURLAs*() functions.
 
void addInlinePrefix (const string &s)
 Add a inline prefix that this node supports.
 
int getInlinedContentOffset (const std::string &url)
 If the URL contains any inline prefix, return the index of the start of the inlined content. More...
 
- Static Protected Member Functions inherited from H3D::Node
static NodegetClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for nodes that implement clone() More...
 
- Protected Attributes inherited from H3D::H3DVideoTextureNode
AutoRef< H3DVideoClipDecoderNodedecoder
 The decoder to use for the texture. More...
 
unsigned int frame_bytes_allocated
 The number of bytes currently allocated for frame data.
 
- Protected Attributes inherited from H3D::X3DTexture2DNode
H3DUniquePtr< FieldimageUpdated
 Field to indicate image is modified C++ only field.
 
H3DUniquePtr< FieldtextureUpdated
 Field which is used to trigger an update of the texture when it has been modified through some functions. More...
 
- Protected Attributes inherited from H3D::H3DSingleTextureNode
GLuint64 texture_handle
 The texture handle (GPU)
 
GLuint texture_id
 The OpenGL texture id of the installed texture, 0 if not installed.
 
GLint texture_unit
 The OpenGL texture unit that is used to render this texture. More...
 
GLenum texture_target
 The OpenGL texture target that is used to render this texture.
 
int texture_width
 texture width
 
int texture_height
 texture height
 
int texture_depth
 texture depth
 
Field::FieldVector shader_fields
 Shader fields which contain this texture.
 
H3DTime last_used
 Time-stamp at which this texture was last used.
 
bool is_resident
 True if this texture is currently resident.
 
- Protected Attributes inherited from H3D::X3DUrlObject
string url_used
 If loadStatus() returns LOADED this string should contain the url that is loaded. More...
 
string url_base
 The base URL for urls in this url object. More...
 
list< string > supported_inline_prefixes
 A list of inline prefixes that are supported by this url object. More...
 
- Static Protected Attributes inherited from H3D::H3DSingleTextureNode
static TextureVector resident_textures
 List of all currently resident textures.
 

Detailed Description

SimpleMovieTexture is a node for showing movies as textures with a simpler interface than the movie texture node.

Examples:

Internal routes:

Member Data Documentation

◆ duration

H3DUniquePtr< SFTime > H3D::SimpleMovieTexture::duration

The duration field is an output only field for the duration of the currently loaded video clip played at normal rate in seconds.

Access type: outputOnly

Referenced by SimpleMovieTexture().

◆ elapsedTime

H3DUniquePtr< SFTime > H3D::SimpleMovieTexture::elapsedTime

The elapsedTime field is the time elapsed from the start time of the clip in seconds.

If set the movie will jump to that time.

Access type: inputOutput
Default value: 0

Referenced by SimpleMovieTexture().

◆ loop

H3DUniquePtr< SFBool > H3D::SimpleMovieTexture::loop

The loop field determines or not the movie should start over from the beginning when the end has been reached.

Access type: inputOutput
Default value: false

Referenced by SimpleMovieTexture().

◆ pause

H3DUniquePtr< SFBool > H3D::SimpleMovieTexture::pause

If a true event is received by the "pause" field the movie will be paused.

It can be resumed again by sending a false event to the "pause" field or a start event to the "play" field.

Access type: inputOnly

Referenced by SimpleMovieTexture().

◆ play

H3DUniquePtr< SFBool > H3D::SimpleMovieTexture::play

If a true event is received by the "play" field the movie will start playing, if it paused or stopped.

If it is currently running nothing will happen.

Access type: inputOnly

Referenced by SimpleMovieTexture().

◆ playAudio

H3DUniquePtr< SFBool > H3D::SimpleMovieTexture::playAudio

The playAudio field determines whether audio should be played or not if the movie contains an audio stream.

Access type: inputOutput
Default value: true

Referenced by SimpleMovieTexture().

◆ rate

H3DUniquePtr< SFFloat > H3D::SimpleMovieTexture::rate

The rate field determines the rate at which the movie should be played.

A value of 1 specifies normal playback rate, and a value of e.g. 2 doubles the playback rate. A negative value means that the movie should be played backwards. All video decoders does not support all rates (especially not negative).

Access type: inputOutput
Default value: 1.0

Referenced by SimpleMovieTexture().

◆ stop

H3DUniquePtr< SFBool > H3D::SimpleMovieTexture::stop

If a true event is received by the "stop" field the movie will stop playing, and the playback position will be reset to the beginning, so that a later "play" event will start playing from the start.

Access type: inputOnly

Referenced by SimpleMovieTexture().

◆ videoHeight

H3DUniquePtr< SFInt32 > H3D::SimpleMovieTexture::videoHeight

The videoWidth contains the width in pixels of the currently loaded video clip.

Access type: outputOnly

Referenced by SimpleMovieTexture().

◆ videoWidth

H3DUniquePtr< SFInt32 > H3D::SimpleMovieTexture::videoWidth

The videoWidth contains the width in pixels of the currently loaded video clip.

Access type: outputOnly

Referenced by SimpleMovieTexture().


The documentation for this class was generated from the following files: