H3D API  2.4.1
LOD.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 __LOD_H__
30 #define __LOD_H__
31 
32 #include <H3D/MatrixTransform.h>
33 #include <H3D/SFInt32.h>
34 #include <H3D/MFFloat.h>
35 
36 
37 namespace H3D {
38 
77  class H3DAPI_API LOD : public MatrixTransform {
78  public:
79 
81  LOD( Inst< AddChildren > _addChildren = 0,
82  Inst< RemoveChildren > _removeChildren = 0,
83  Inst< MFChild > _children = 0,
84  Inst< SFNode > _metadata = 0,
85  Inst< SFBound > _bound = 0,
86  Inst< SFInt32 > _level_changed = 0,
87  Inst< SFVec3f > _bboxCenter = 0,
88  Inst< SFVec3f > _bboxSize = 0,
89  Inst< SFVec3f > _center = 0,
90  Inst< SFBool > _forceTransitions = 0,
91  Inst< MFFloat > _range = 0 );
92 
93  virtual void render();
94 
99  virtual void traverseSG( TraverseInfo &ti );
100 
109  virtual bool lineIntersect(
110  const Vec3f &from,
111  const Vec3f &to,
112  LineIntersectResult &result );
113 
120  virtual void closestPoint( const Vec3f &p,
121  NodeIntersectResult &result );
122 
132  virtual bool movingSphereIntersect( H3DFloat radius,
133  const Vec3f &from,
134  const Vec3f &to,
135  NodeIntersectResult &result );
136 
146  H3DUniquePtr< SFInt32 > level_changed;
147 
149  H3DUniquePtr <SFInt32> display_index;
150 
160  H3DUniquePtr< SFVec3f > center;
161 
171  H3DUniquePtr< SFBool > forceTransitions;
172 
183  H3DUniquePtr< MFFloat > range;
184 
187  };
188 }
189 
190 #endif
Contains the MFFloat field class.
Header file for MatrixTransform, X3D scene-graph node.
Contains the SFInt32 field class.
The LOD node specifies various levels of detail or complexity for a given object, and provides hints ...
Definition: LOD.h:77
H3DUniquePtr< SFInt32 > display_index
This field is only accessible in C++.
Definition: LOD.h:149
H3DUniquePtr< SFBool > forceTransitions
The forceTransitions field specifies whether browsers are allowed to disregard level distances in ord...
Definition: LOD.h:171
H3DUniquePtr< SFVec3f > center
The center field is a translation offset in the local coordinate system that specifies the centre of ...
Definition: LOD.h:160
H3DUniquePtr< SFInt32 > level_changed
The LOD node generates a level_changed event with value i where the value of i identifies which level...
Definition: LOD.h:146
H3DUniquePtr< MFFloat > range
The range field specifies the ideal distances at which to switch between the levels.
Definition: LOD.h:183
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: LOD.h:186
The MatrixTransform node is a grouping node that defines a coordinate system for its children that is...
Definition: MatrixTransform.h:64
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
float H3DFloat
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
Used as input to lineIntersect functions.
Definition: Node.h:224
Used as input to intersection functions.
Definition: Node.h:114