H3D API  2.4.1
HAnimSegment.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 __HANIMSEGMENT_H__
30 #define __HANIMSEGMENT_H__
31 
32 #include <H3D/X3DGroupingNode.h>
33 #include <H3D/X3DCoordinateNode.h>
34 #include <H3D/HAnimDisplacer.h>
35 #include <H3D/MFFloat.h>
36 #include <H3D/MFInt32.h>
37 
38 namespace H3D {
39 
58  class H3DAPI_API HAnimSegment : public X3DGroupingNode {
59  public:
60 
63 
65  HAnimSegment( Inst< AddChildren > _addChildren = 0,
66  Inst< RemoveChildren > _removeChildren = 0,
67  Inst< MFChild > _children = 0,
68  Inst< SFNode > _metadata = 0,
69  Inst< SFBound > _bound = 0,
70  Inst< SFVec3f > _bboxCenter = 0,
71  Inst< SFVec3f > _bboxSize = 0,
72  Inst< SFVec3f > _centerOfMass = 0,
73  Inst< SFCoordinateNode > _coord = 0,
74  Inst< MFDisplacer > _displacers = 0,
75  Inst< SFFloat > _mass = 0,
76  Inst< MFFloat > _momentsOfInertia = 0,
77  Inst< SFString > _name = 0
78  );
79 
80  //virtual void render();
81  virtual void traverseSG( TraverseInfo &ti );
82 
90  H3DUniquePtr< SFVec3f > centerOfMass;
91 
99  H3DUniquePtr< SFCoordinateNode > coord;
100 
109  H3DUniquePtr< MFDisplacer > displacers;
110 
118  H3DUniquePtr< SFFloat > mass;
119 
127  H3DUniquePtr< MFFloat > momentsOfInertia;
128 
136  H3DUniquePtr< SFString > name;
137 
140  protected:
143  vector< Vec3d > points_double;
144 
147  vector< Vec3f > points_single;
148 
152 
158  template< class VectorType >
159  inline void updateCoordinates( VectorType &points );
160  };
161 }
162 
163 #endif
Header file for HAnimDisplacer, X3D scene-graph node.
Contains the MFFloat field class.
Contains the MFInt32 field class.
Header file for X3DCoordinateNode, X3D scene-graph node.
Header file for X3DGroupingNode, X3D scene-graph node.
The HAnimSegment object is a container for information about a segment of the body.
Definition: HAnimSegment.h:58
H3DUniquePtr< SFVec3f > centerOfMass
The X3D specification does not describe this field at all.
Definition: HAnimSegment.h:90
H3DUniquePtr< SFFloat > mass
The X3D specification does not describe this field at all.
Definition: HAnimSegment.h:118
vector< Vec3d > points_double
vector for storing the original points before joint and displacer modification if the original coord ...
Definition: HAnimSegment.h:143
H3DUniquePtr< MFDisplacer > displacers
The displacers field contains a list of HAnimDisplacer objects that are used to morph the deformable ...
Definition: HAnimSegment.h:109
AutoRef< X3DCoordinateNode > current_coordinate
The coordinate node that was used as base coordinate in last traverseSG.
Definition: HAnimSegment.h:151
H3DUniquePtr< MFFloat > momentsOfInertia
The X3D specification does not describe this field at all.
Definition: HAnimSegment.h:127
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: HAnimSegment.h:139
H3DUniquePtr< SFString > name
The name field contains a name that is used for identifying the object.
Definition: HAnimSegment.h:136
vector< Vec3f > points_single
vector for storing the original points before joint and displacer modification if the original coord ...
Definition: HAnimSegment.h:147
H3DUniquePtr< SFCoordinateNode > coord
Contains the coordinate node for the segment.
Definition: HAnimSegment.h:99
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 added to a MFNode are of a specified Node type.
Definition: MFNode.h:221
Template to make sure that the Node that is set in a SFNode is of a specified Node type.
Definition: SFNode.h:97
This abstract node type indicates that concrete node types derived from it contain children nodes and...
Definition: X3DGroupingNode.h:53
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