29 #ifndef __SUPERSHAPE_H__
30 #define __SUPERSHAPE_H__
92 FieldRef< X3DGeometricPropertyNode,
94 &X3DCoordinateNode::propertyChanged > >, Types< SFFloat, SFFloat,
102 virtual void update();
125 H3DFloat r1theta = R( theta, sm, sa, sb, sn1, sn2, sn3 );
126 H3DFloat r2phi = R( phi, tm, ta, tb, tn1, tn2, tn3 );
128 H3DFloat x = r1theta * cosf(theta) * r2phi * cosf(phi);
129 H3DFloat y = r1theta * sin(theta) * r2phi * cosf(phi);
132 return Vec3f(
x, y, z);
140 Inst< SFBound > _bound = 0,
141 Inst< SFFloat > _ss1_m = 0,
142 Inst< SFFloat > _ss1_a = 0,
143 Inst< SFFloat > _ss1_b = 0,
144 Inst< SFFloat > _ss1_n1 = 0,
145 Inst< SFFloat > _ss1_n2 = 0,
146 Inst< SFFloat > _ss1_n3 = 0,
147 Inst< SFFloat > _ss2_m = 0,
148 Inst< SFFloat > _ss2_a = 0,
149 Inst< SFFloat > _ss2_b = 0,
150 Inst< SFFloat > _ss2_n1 = 0,
151 Inst< SFFloat > _ss2_n2 = 0,
152 Inst< SFFloat > _ss2_n3 = 0,
153 Inst< SFInt32 > _resolution = 0 );
155 virtual void render();
159 H3DInt32 res = resolution->getValue();
160 if( res < 0 )
return 0;
161 else return res * res * 2;
290 H3DUniquePtr< SFCoordinateNode >
coord;
Header file for CoordBoundField, specialiced field class.
Contains the DependentSFNode and DependentMFNode template classes.
Contains the SFFloat field class.
Contains the SFInt32 field class.
Header file for X3DCoordinateNode, X3D scene-graph node.
Header file for X3DGeometryNode, X3D scene-graph node.
Header file for X3DNormalNode, X3D scene-graph node.
The CoordBoundField is specialized update itself from a X3DCoordinateNode.
Definition: CoordBoundField.h:43
DependentSFNode are modified TypedSFNode fields where the field dirty status is dependent on fields i...
Definition: DependentNodeFields.h:294
Class used for specifying a field member of a node in a DependentSFNode or DependentMFNode specificat...
Definition: DependentNodeFields.h:48
The Field class.
Definition: Field.h:46
The SFCoordinateNode is a class that contain a X3DCoordinateNode.
Definition: SuperShape.h:100
The SuperShape node implements a SuperShape!
Definition: SuperShape.h:62
H3DUniquePtr< SFFloat > ss2_n2
Parameter to define supershape.
Definition: SuperShape.h:255
H3DUniquePtr< SFFloat > ss2_b
Parameter to define supershape.
Definition: SuperShape.h:239
H3DUniquePtr< SFFloat > ss1_a
Parameter to define supershape.
Definition: SuperShape.h:183
H3DUniquePtr< SFFloat > ss1_n3
Parameter to define supershape.
Definition: SuperShape.h:215
H3DUniquePtr< SFFloat > ss2_a
Parameter to define supershape.
Definition: SuperShape.h:231
DependentSFNode< X3DNormalNode, FieldRef< X3DGeometricPropertyNode, Field, &X3DNormalNode::propertyChanged > > SFNormalNode
The SFNormalNode is dependent on the propertyChanged field of the contained X3DNormalNode.
Definition: SuperShape.h:71
H3DUniquePtr< SFCoordinateNode > coord
Field that contains a Coordinate node with the coordinates generated by SuperShape.
Definition: SuperShape.h:290
H3DUniquePtr< SFFloat > ss1_n1
Parameter to define supershape.
Definition: SuperShape.h:199
H3DUniquePtr< SFFloat > ss1_n2
Parameter to define supershape.
Definition: SuperShape.h:207
H3DUniquePtr< SFNormalNode > normal
Field that contains a Normal node with the normals generated by SuperShape.
Definition: SuperShape.h:295
virtual int nrTriangles()
The number of triangles renderered in this geometry.
Definition: SuperShape.h:158
CoordBoundField SFBound
The bound field for SuperShape is a CoordBoundField.
Definition: SuperShape.h:137
H3DUniquePtr< SFFloat > ss2_n3
Parameter to define supershape.
Definition: SuperShape.h:263
H3DUniquePtr< SFFloat > ss2_m
Parameter to define supershape.
Definition: SuperShape.h:223
H3DUniquePtr< SFFloat > ss2_n1
Parameter to define supershape.
Definition: SuperShape.h:247
H3DUniquePtr< SFInt32 > resolution
Parameter to define the resolution of the supershape.
Definition: SuperShape.h:273
H3DUniquePtr< SFFloat > ss1_m
Parameter to define supershape.
Definition: SuperShape.h:175
H3DUniquePtr< SFFloat > ss1_b
Parameter to define supershape.
Definition: SuperShape.h:191
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
This is the base node type for all geometric property node types defined in X3D.
Definition: X3DGeometricPropertyNode.h:43
H3DUniquePtr< Field > propertyChanged
Field that indicated whether the properties have changed.
Definition: X3DGeometricPropertyNode.h:53
This is the base node type for all geometry in X3D.
Definition: X3DGeometryNode.h:61
This is the base node type for all normal node types in X3D.
Definition: X3DNormalNode.h:45
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