H3D API  2.4.1
SimpleMovieTexture.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __SIMPLEMOVIETEXTURE_H__
30 #define __SIMPLEMOVIETEXTURE_H__
31 
33 #include <H3D/X3DUrlObject.h>
34 #include <H3D/SFFloat.h>
35 #include <H3D/SFTime.h>
36 #include <H3D/SFInt32.h>
37 #include <H3D/PeriodicUpdate.h>
38 
39 namespace H3D {
52  class H3DAPI_API SimpleMovieTexture : public H3DVideoTextureNode,
53  public X3DUrlObject{
54  public:
55 
58  class H3DAPI_API FieldUpdater: public PeriodicUpdate< SFTime > {
59  virtual void update();
60  };
61 
62 
66  class H3DAPI_API DecoderManager: public TypedField< AutoUpdate< SFBool >,
67  Types< SFBool, SFBool, SFBool,
68  SFBool, MFString, SFFloat, SFTime > > {
69  virtual void update();
70  };
71 #ifdef __BORLANDC__
72  friend class DecoderManager;
73 #endif
74 
77  Inst< DisplayList > _displayList = 0,
78  Inst< SFNode > _metadata = 0,
79  Inst< SFBool > _repeatS = 0,
80  Inst< SFBool > _repeatT = 0,
81  Inst< SFBool > _scaleToP2 = 0,
82  Inst< SFImage > _image = 0,
83  Inst< SFTextureProperties > _textureProperties = 0,
84  Inst< SFBool > _play = 0,
85  Inst< SFBool > _stop = 0,
86  Inst< SFBool > _pause = 0,
87  Inst< SFTime > _duration = 0,
88  Inst< SFFloat > _rate = 0,
89  Inst< SFBool > _playAudio = 0,
90  Inst< SFBool > _loop = 0,
91  Inst< SFInt32 > _width = 0,
92  Inst< SFInt32 > _height = 0,
93  Inst< MFString > _url = 0,
94  Inst< SFTime > _elapsedTime = 0 );
95 
98 
106  H3DUniquePtr< SFBool > play;
107 
116  H3DUniquePtr< SFBool > stop;
117 
125  H3DUniquePtr< SFBool > pause;
126 
133  H3DUniquePtr< SFTime > duration;
134 
145  H3DUniquePtr< SFFloat > rate;
146 
154  H3DUniquePtr< SFBool > playAudio;
155 
163  H3DUniquePtr< SFBool > loop;
164 
171  H3DUniquePtr< SFInt32 > videoWidth;
172 
179  H3DUniquePtr< SFInt32 > videoHeight;
180 
188  H3DUniquePtr< SFTime > elapsedTime;
189 
191  H3DUniquePtr< FieldUpdater > fieldUpdater;
192 
196  H3DUniquePtr< DecoderManager > decoderManager;
197 
198  };
199 }
200 
201 #endif
Header file for H3DVideoTextureNode.
Header file for PeriodicUpdate, template field modifier.
Contains the SFFloat field class.
Contains the SFInt32 field class.
Contains the SFTime field class.
Header file for X3DUrlObject, X3D scene-graph node.
H3DVideoTextureNode is a virtual base class for classes using video as a texture.
Definition: H3DVideoTextureNode.h:41
The PeriodicUpdate is a template modifier that changes the way the field is updated.
Definition: PeriodicUpdate.h:74
The DecoderManager class manages all state changes in the decoder depending on the values of the fiel...
Definition: SimpleMovieTexture.h:68
The FieldUpdater field updates all output fields in the SimpleMovieTexture node that needs to be upda...
Definition: SimpleMovieTexture.h:58
SimpleMovieTexture is a node for showing movies as textures with a simpler interface than the movie t...
Definition: SimpleMovieTexture.h:53
H3DUniquePtr< SFBool > playAudio
The playAudio field determines whether audio should be played or not if the movie contains an audio s...
Definition: SimpleMovieTexture.h:154
H3DUniquePtr< SFInt32 > videoHeight
The videoWidth contains the width in pixels of the currently loaded video clip.
Definition: SimpleMovieTexture.h:179
H3DUniquePtr< SFInt32 > videoWidth
The videoWidth contains the width in pixels of the currently loaded video clip.
Definition: SimpleMovieTexture.h:171
H3DUniquePtr< SFBool > stop
If a true event is received by the "stop" field the movie will stop playing, and the playback positio...
Definition: SimpleMovieTexture.h:116
H3DUniquePtr< SFBool > loop
The loop field determines or not the movie should start over from the beginning when the end has been...
Definition: SimpleMovieTexture.h:163
H3DUniquePtr< FieldUpdater > fieldUpdater
The fieldUpdater field is updating all output fields that needs to be updated each frame.
Definition: SimpleMovieTexture.h:191
H3DUniquePtr< SFBool > pause
If a true event is received by the "pause" field the movie will be paused.
Definition: SimpleMovieTexture.h:125
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: SimpleMovieTexture.h:97
H3DUniquePtr< DecoderManager > decoderManager
The DecoderManager class manages all state changes in the decoder depending on the values of the fiel...
Definition: SimpleMovieTexture.h:196
H3DUniquePtr< SFBool > play
If a true event is received by the "play" field the movie will start playing, if it paused or stopped...
Definition: SimpleMovieTexture.h:106
H3DUniquePtr< SFTime > elapsedTime
The elapsedTime field is the time elapsed from the start time of the clip in seconds.
Definition: SimpleMovieTexture.h:188
H3DUniquePtr< SFTime > duration
The duration field is an output only field for the duration of the currently loaded video clip played...
Definition: SimpleMovieTexture.h:133
H3DUniquePtr< SFFloat > rate
The rate field determines the rate at which the movie should be played.
Definition: SimpleMovieTexture.h:145
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
This abstract interface is inherited by all nodes that contain data located on the World Wide Web,...
Definition: X3DUrlObject.h:51
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