H3D API  2.4.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
DepthMapSurface.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 __DEPTHMAPSURFACE_H__
30 #define __DEPTHMAPSURFACE_H__
31 
33 #include <H3D/X3DTexture2DNode.h>
34 #include <H3D/SFVec2d.h>
35 
36 namespace H3D {
37 
53  class H3DAPI_API DepthMapSurface: public H3DFrictionalSurfaceNode {
54  public:
55 
58  class H3DAPI_API SFTexture2DNode :
59  public DependentSFNode< X3DTexture2DNode,
60  FieldRef< H3DDisplayListObject,
61  H3DDisplayListObject::DisplayList,
62  &H3DDisplayListObject::displayList >,
63  true > {
64  public:
69  true >
71 
73  virtual void onAdd( Node *n );
74 
76  virtual void onRemove( Node *n );
77  };
78 
83  class SetImagePtr : public AutoUpdate<
84  TypedField< SFBool, Types< X3DTexture2DNode::SFImage > > > {
85  protected:
86  virtual void update();
87  };
88 
90  DepthMapSurface( Inst< UpdateStiffness > _stiffness = 0,
91  Inst< UpdateDamping > _damping = 0,
92  Inst< UpdateStaticFriction > _staticFriction = 0,
93  Inst< UpdateDynamicFriction > _dynamicFriction = 0,
94  Inst< SFBool > _useRelativeValues = 0,
95  Inst< SFTexture2DNode > _depthMap = 0,
96  Inst< SFFloat > _maxDepth = 0,
97  Inst< SFBool > _whiteIsOut = 0 );
98 
101  virtual void initialize();
102 
108  H3DUniquePtr< SFTexture2DNode > depthMap;
109 
117  H3DUniquePtr< SFFloat > maxDepth;
118 
126  H3DUniquePtr< SFBool > whiteIsOut;
127 
130 
131  protected:
133  H3DUniquePtr< SetImagePtr > setImagePtr;
134  };
135 }
136 
137 #endif
Header file for H3DFrictionalSurfaceNode.
Contains the SFVec2d field class.
Header file for X3DTexture2DNode, X3D scene-graph node.
DependentSFNode are modified TypedSFNode fields where the field dirty status is dependent on fields i...
Definition: DependentNodeFields.h:294
Field that contains an X3DTexture2DNode.
Definition: DepthMapSurface.h:63
Field used to transfer the routed image to the HAPISurfaceObject.
Definition: DepthMapSurface.h:84
Uses a 2D texture to modify the depth of the surface.
Definition: DepthMapSurface.h:53
H3DUniquePtr< SFTexture2DNode > depthMap
The texture used as depthMap.
Definition: DepthMapSurface.h:108
H3DUniquePtr< SFFloat > maxDepth
The maximum difference in meter between totally black and totally white in the image.
Definition: DepthMapSurface.h:117
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: DepthMapSurface.h:129
H3DUniquePtr< SFBool > whiteIsOut
If this parameter is true then white will be out from surface and black will be in.
Definition: DepthMapSurface.h:126
H3DUniquePtr< SetImagePtr > setImagePtr
Used to update the image pointer in HAPISurfaceObject.
Definition: DepthMapSurface.h:133
Class used for specifying a field member of a node in a DependentSFNode or DependentMFNode specificat...
Definition: DependentNodeFields.h:48
We use the Field's lazy evaluation mechanisms to manage the GL display lists for rendering,...
Definition: H3DDisplayListObject.h:60
This abstract interface class is the base class for all node types that wants to create an OpenGL dis...
Definition: H3DDisplayListObject.h:54
H3DUniquePtr< DisplayList > displayList
The DisplayList instance handling the OpenGL caching of this object.
Definition: H3DDisplayListObject.h:256
Base class for surfaces with friction.
Definition: H3DFrictionalSurfaceNode.h:40
Node is the base class for all classes that can be part of the H3D scene-graph.
Definition: Node.h:46
This abstract node type is the base type for all node types which specify 2D sources for texture imag...
Definition: X3DTexture2DNode.h:46
H3D API namespace.
Definition: Anchor.h:38
The AutoUpdate field is a template to force the BaseField to update itself as soon as an event is rec...
Definition: FieldTemplates.h:130
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194