H3D API  2.4.1
LoadSensor.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 __LOADSENSOR_H__
30 #define __LOADSENSOR_H__
31 
33 #include <H3D/X3DUrlObject.h>
34 #include <H3D/MFNode.h>
35 #include <H3D/SFTime.h>
36 #include <H3D/SFFloat.h>
37 
38 namespace H3D {
39 
145  class H3DAPI_API LoadSensor : public X3DNetworkSensorNode {
146  public:
147 
149 
151  LoadSensor( Inst< SFBool > _enabled = 0,
152  Inst< SFNode > _metadata = 0,
153  Inst< SFBool > _isActive = 0,
154  Inst< SFTime > _timeOut = 0,
155  Inst< MFUrlObject > _watchList = 0,
156  Inst< SFBool > _isLoaded = 0,
157  Inst< SFTime > _loadTime = 0,
158  Inst< SFFloat > _progress = 0 );
159 
160  virtual void traverseSG( TraverseInfo &ti );
161 
171  H3DUniquePtr< MFUrlObject > watchList;
172 
183  H3DUniquePtr< SFTime > timeOut;
184 
197  H3DUniquePtr< SFBool > isLoaded;
198 
206  H3DUniquePtr< SFTime > loadTime;
207 
215  H3DUniquePtr< SFFloat > progress;
216 
217  static H3DNodeDatabase database;
218  protected:
219  bool loading_last_loop;
220  bool finished_loading;
221  TimeStamp activation_time;
222 
223  };
224 }
225 
226 #endif
Contains the MFNode class.
Contains the SFFloat field class.
Contains the SFTime field class.
Header file for X3DNetworkSensorNode, X3D scene-graph node.
Header file for X3DUrlObject, X3D scene-graph node.
The LoadSensor monitors the progress and success of downloading URL elements over a network.
Definition: LoadSensor.h:145
H3DUniquePtr< SFTime > loadTime
The loadTime event is generated when loading of the LoadSensor's watchList has successfully completed...
Definition: LoadSensor.h:206
H3DUniquePtr< SFBool > isLoaded
The isLoaded field generates events when loading of the LoadSensor's watchList has completed.
Definition: LoadSensor.h:197
H3DUniquePtr< SFFloat > progress
The progress field generates events as loading progresses.
Definition: LoadSensor.h:215
H3DUniquePtr< MFUrlObject > watchList
The watchList field contains one or more URL objects to monitor.
Definition: LoadSensor.h:171
H3DUniquePtr< SFTime > timeOut
The timeOut field specifies the maximum time for which the LoadSensor will monitor loading,...
Definition: LoadSensor.h:183
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
Template to make sure that the Nodes that are set in a MFNode are of a specified type.
Definition: MFNode.h:265
This abstract node type is the basis for all sensors that generate events based on network activity.
Definition: X3DNetworkSensorNode.h:42
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