Geant4-11
Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Private Member Functions | Private Attributes
SoTubs Class Reference

#include <SoTubs.h>

Inheritance diagram for SoTubs:

Public Member Functions

virtual void clearAlternateRep ()
 We better be able to clear it, too! More...
 
virtual void generateAlternateRep ()
 
 SoTubs ()
 Constructor, required. More...
 

Static Public Member Functions

static void initClass ()
 Class Initializer, required. More...
 

Data Fields

SoSFNode alternateRep
 Alternate rep - required. More...
 
SoSFFloat pDPhi
 Delta-angle, in radians. More...
 
SoSFFloat pDz
 Half-length in Z. More...
 
SoSFFloat pRMax
 Outside radius of the tube. More...
 
SoSFFloat pRMin
 Inside radius of the tube. More...
 
SoSFFloat pSPhi
 Starting angle, in radians. More...
 

Protected Member Functions

virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f &center)
 compute bounding Box, required More...
 
virtual void generatePrimitives (SoAction *action)
 Generate Primitives, required. More...
 
virtual SoChildList * getChildren () const
 GetChildList, required whenever the class has hidden children. More...
 
virtual ~SoTubs ()
 Destructor, required. More...
 

Private Member Functions

void generateChildren ()
 
void inc (double &sinPhi, double &cosPhi, double sinDeltaPhi, double cosDeltaPhi) const
 help with trigonometry. increments sines an cosines by an angle. More...
 
 SO_NODE_HEADER (SoTubs)
 
void updateChildren ()
 

Private Attributes

SoChildList * children
 ChildList. Required whenever the class has hidden children.
More...
 

Detailed Description

Definition at line 71 of file SoTubs.h.

Constructor & Destructor Documentation

◆ SoTubs()

SoTubs::SoTubs ( )

Constructor, required.

Definition at line 61 of file SoTubs.cc.

61 {
62
63
64 // This statement is required
65 SO_NODE_CONSTRUCTOR(SoTubs);
66
67 // Data fields are initialized like this:
68 SO_NODE_ADD_FIELD(pRMin, (0));
69 SO_NODE_ADD_FIELD(pRMax, (1));
70 SO_NODE_ADD_FIELD(pDz, (10));
71 SO_NODE_ADD_FIELD(pSPhi, (0));
72 SO_NODE_ADD_FIELD(pDPhi, ((float)(2*M_PI)));
73 SO_NODE_ADD_FIELD(alternateRep, (NULL));
74 children = new SoChildList(this);
75}
#define M_PI
Definition: SbMath.h:33
Definition: SoTubs.h:71
SoSFFloat pDz
Half-length in Z.
Definition: SoTubs.h:89
SoSFNode alternateRep
Alternate rep - required.
Definition: SoTubs.h:101
SoChildList * children
ChildList. Required whenever the class has hidden children.
Definition: SoTubs.h:168
SoSFFloat pDPhi
Delta-angle, in radians.
Definition: SoTubs.h:97
SoSFFloat pSPhi
Starting angle, in radians.
Definition: SoTubs.h:93
SoSFFloat pRMin
Inside radius of the tube.
Definition: SoTubs.h:81
SoSFFloat pRMax
Outside radius of the tube.
Definition: SoTubs.h:85

References M_PI.

◆ ~SoTubs()

SoTubs::~SoTubs ( )
protectedvirtual

Destructor, required.

Definition at line 78 of file SoTubs.cc.

78 {
79 delete children;
80}

References children.

Member Function Documentation

◆ clearAlternateRep()

void SoTubs::clearAlternateRep ( )
virtual

We better be able to clear it, too!

Definition at line 469 of file SoTubs.cc.

469 {
470 alternateRep.setValue(NULL);
471}

References alternateRep.

◆ computeBBox()

void SoTubs::computeBBox ( SoAction *  action,
SbBox3f &  box,
SbVec3f &  center 
)
protectedvirtual

compute bounding Box, required

Definition at line 256 of file SoTubs.cc.

256 {
257 SbVec3f vmin(-pRMax.getValue(),-pRMax.getValue(),-pDz.getValue()),
258 vmax( pRMax.getValue(), pRMax.getValue(), pDz.getValue());
259 center.setValue(0,0,0);
260 box.setBounds(vmin,vmax);
261}

References pDz, and pRMax.

◆ generateAlternateRep()

void SoTubs::generateAlternateRep ( )
virtual

Generate AlternateRep, required. Generating an alternate representation must be done upon users request. It allows an Inventor program to read back the file without requiring this code to be dynamically linked. If the users expects that this code will be dynamically linked, he need not invoke this method.

Definition at line 458 of file SoTubs.cc.

458 {
459
460 // This routine sets the alternate representation to the child
461 // list of this mode.
462
463 if (children->getLength() == 0) generateChildren();
465 alternateRep.setValue((SoSeparator *) ( *children)[0]);
466}
void updateChildren()
Definition: SoTubs.cc:265
void generateChildren()
Definition: SoTubs.cc:434

References alternateRep, children, generateChildren(), and updateChildren().

◆ generateChildren()

void SoTubs::generateChildren ( )
private

Generate Children. Used to create the hidden children. Required whenever the node has hidden children.

Definition at line 434 of file SoTubs.cc.

434 {
435
436 // This routines creates one SoSeparator, one SoCoordinate3, and
437 // one SoLineSet, and puts it in the child list. This is done only
438 // once, whereas redrawing the position of the coordinates occurs each
439 // time an update is necessary, in the updateChildren routine.
440
441 assert(children->getLength() ==0);
442 SoSeparator *sep = new SoSeparator();
443 SoCoordinate3 *theCoordinates = new SoCoordinate3();
444 SoNormal *theNormals = new SoNormal();
445 SoNormalBinding *theNormalBinding = new SoNormalBinding();
446 SoIndexedFaceSet *theFaceSet = new SoIndexedFaceSet();
447 //
448 // This line costs some in render quality! but gives speed.
449 //
450 sep->addChild(theCoordinates);
451 sep->addChild(theNormals);
452 sep->addChild(theNormalBinding);
453 sep->addChild(theFaceSet);
454 children->append(sep);
455}

References children.

Referenced by generateAlternateRep().

◆ generatePrimitives()

void SoTubs::generatePrimitives ( SoAction *  action)
protectedvirtual

Generate Primitives, required.

Definition at line 94 of file SoTubs.cc.

94 {
95 // This variable is used to store each vertex
96 SoPrimitiveVertex pv;
97
98 // Access the stat from the action
99 SoState *state = action->getState();
100
101 // See if we have to use a texture coordinate function,
102 // rather than generating explicit texture coordinates.
103 SbBool useTexFunction=
104 (SoTextureCoordinateElement::getType(state) ==
105 SoTextureCoordinateElement::FUNCTION);
106
107 // If we need to generate texture coordinates with a function,
108 // we'll need an SoGLTextureCoordinateElement. Otherwise, we'll
109 // set up the coordinates directly.
110 const SoTextureCoordinateElement* tce = NULL;
111 SbVec4f texCoord;
112 if (useTexFunction) {
113 tce = SoTextureCoordinateElement::getInstance(state);
114 }
115 else {
116 texCoord[2] = 0.0;
117 texCoord[3] = 1.0;
118 }
119 SbVec3f point, normal;
120
121
123 //-----------------------------------------------------
124#define GEN_VERTEX(pv,x,y,z,s,t,nx,ny,nz) \
125 point.setValue((float)(x),(float)(y),(float)(z)); \
126 normal.setValue((float)(nx),(float)(ny),(float)(nz)); \
127 if (useTexFunction) { \
128 texCoord=tce->get(point,normal); \
129 } else { \
130 texCoord[0]=(float)(s); \
131 texCoord[1]=(float)(t); \
132 } \
133 pv.setPoint(point); \
134 pv.setNormal(normal); \
135 pv.setTextureCoords(texCoord); \
136 shapeVertex(&pv);
137 //-----------------------------------------------------
139
140 int NPHI = (int)(2+22*std::fabs(pDPhi.getValue()/(2.0*M_PI)));
141 double deltaPhi = pDPhi.getValue()/NPHI, phi0 = pSPhi.getValue(),phi1=phi0+pDPhi.getValue();
142 double rMax=pRMax.getValue(),rMin=pRMin.getValue();
143 double zMax=pDz.getValue(),zMin=-zMax;
144 double cosPhi0=std::cos(phi0), sinPhi0=std::sin(phi0);
145 double cosPhi1=std::cos(phi1), sinPhi1=std::sin(phi1);
146 double cosDeltaPhi=std::cos(deltaPhi),sinDeltaPhi=std::sin(deltaPhi);
147 //
148 // The outer surface!
149 //
150 int i;
151 double sinPhi,cosPhi;
152 beginShape(action,TRIANGLE_STRIP);
153 sinPhi=sinPhi0;
154 cosPhi=cosPhi0;
155 for (i = 0; i<=NPHI; i++) {
156 GEN_VERTEX(pv,rMax*cosPhi,rMax*sinPhi,zMax,0.0,0.0,cosPhi,sinPhi,0);
157 GEN_VERTEX(pv,rMax*cosPhi,rMax*sinPhi,zMin,1.0,1.0,cosPhi,sinPhi,0);
158 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
159 }
160 endShape();
161 //
162 // The inner surface!
163 //
164 if(rMin!=0.F) {
165 beginShape(action,TRIANGLE_STRIP);
166 sinPhi=sinPhi0;
167 cosPhi=cosPhi0;
168 for (i = 0; i<=NPHI; i++) {
169 GEN_VERTEX(pv,rMin*cosPhi,rMin*sinPhi,zMax,0.0,0.0,-cosPhi,-sinPhi,0);
170 GEN_VERTEX(pv,rMin*cosPhi,rMin*sinPhi,zMin,1.0,1.0,-cosPhi,-sinPhi,0);
171 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
172 }
173 endShape();
174 }
175 if (std::fabs(deltaPhi)<2.0*M_PI) {
176 //
177 // The end
178 //
179 beginShape(action,TRIANGLE_STRIP);
180 sinPhi=sinPhi0;
181 cosPhi=cosPhi0;
182 GEN_VERTEX(pv,rMax*cosPhi,rMax*sinPhi,zMax,0.0,0.0,sinPhi,-cosPhi,0);
183 GEN_VERTEX(pv,rMax*cosPhi,rMax*sinPhi,zMin,1.0,1.0,sinPhi,-cosPhi,0);
184 GEN_VERTEX(pv,rMin*cosPhi,rMin*sinPhi,zMax,1.0,0.0,sinPhi,-cosPhi,0);
185 GEN_VERTEX(pv,rMin*cosPhi,rMin*sinPhi,zMin,0.0,1.0,sinPhi,-cosPhi,0);
186 endShape();
187 //
188 // The other end
189 //
190 beginShape(action,TRIANGLE_STRIP);
191 sinPhi=sinPhi1;
192 cosPhi=cosPhi1;
193 GEN_VERTEX(pv,rMax*cosPhi,rMax*sinPhi, zMax,0.0,0.0,-sinPhi,+cosPhi,0);
194 GEN_VERTEX(pv,rMax*cosPhi,rMax*sinPhi, zMin,1.0,1.0,-sinPhi,+cosPhi,0);
195 GEN_VERTEX(pv,rMin*cosPhi,rMin*sinPhi, zMax,1.0,0.0,-sinPhi,+cosPhi,0);
196 GEN_VERTEX(pv,rMin*cosPhi,rMin*sinPhi, zMin,0.0,1.0,-sinPhi,+cosPhi,0);
197 endShape();
198 }
199 //
200 // The outer surface at z=+PDZ
201 //
202 if(rMin==0.F) {
203 beginShape(action,TRIANGLE_FAN);
204 sinPhi=sinPhi0;
205 cosPhi=cosPhi0;
206 GEN_VERTEX(pv,0,0,zMax,0.0,0.0,0,0,1);
207 for (i = 0; i<=NPHI; i++) {
208 GEN_VERTEX(pv,rMax*cosPhi,rMax*sinPhi,zMax,1.0,1.0,0,0,1);
209 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
210 }
211 endShape();
212 //
213 // The outer surface at z=-PDZ
214 //
215 beginShape(action,TRIANGLE_FAN);
216 sinPhi=sinPhi0;
217 cosPhi=cosPhi0;
218 GEN_VERTEX(pv,0,0,zMin,0.0,0.0,0,0,-1);
219 for (i = 0; i<=NPHI; i++) {
220 GEN_VERTEX(pv,rMax*cosPhi,rMax*sinPhi,zMin,1.0,1.0,0,0,-1);
221 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
222 }
223 endShape();
224 } else {
225 beginShape(action,TRIANGLE_STRIP);
226 sinPhi=sinPhi0;
227 cosPhi=cosPhi0;
228 for (i = 0; i<=NPHI; i++) {
229 GEN_VERTEX(pv,rMin*cosPhi,rMin*sinPhi,zMax,0.0,0.0,0,0,1);
230 GEN_VERTEX(pv,rMax*cosPhi,rMax*sinPhi,zMax,1.0,1.0,0,0,1);
231 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
232 }
233 endShape();
234 //
235 // The outer surface at z=-PDZ
236 //
237 beginShape(action,TRIANGLE_STRIP);
238 sinPhi=sinPhi0;
239 cosPhi=cosPhi0;
240 for (i = 0; i<=NPHI; i++) {
241 GEN_VERTEX(pv,rMin*cosPhi,rMin*sinPhi,zMin,0.0,0.0,0,0,-1);
242 GEN_VERTEX(pv,rMax*cosPhi,rMax*sinPhi,zMin,1.0,1.0,0,0,-1);
243 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
244 }
245 endShape();
246 }
247}
#define GEN_VERTEX(pv, x, y, z, s, t, nx, ny, nz)
void inc(double &sinPhi, double &cosPhi, double sinDeltaPhi, double cosDeltaPhi) const
help with trigonometry. increments sines an cosines by an angle.
Definition: SoTubs.h:173
static double normal(HepRandomEngine *eptr)
Definition: RandPoisson.cc:79

References geant4_check_module_cycles::action, GEN_VERTEX, inc(), M_PI, CLHEP::normal(), pDPhi, pDz, pRMax, pRMin, and pSPhi.

◆ getChildren()

SoChildList * SoTubs::getChildren ( ) const
protectedvirtual

GetChildList, required whenever the class has hidden children.

Definition at line 250 of file SoTubs.cc.

250 {
251 return children;
252}

References children.

◆ inc()

void SoTubs::inc ( double &  sinPhi,
double &  cosPhi,
double  sinDeltaPhi,
double  cosDeltaPhi 
) const
inlineprivate

help with trigonometry. increments sines an cosines by an angle.

Definition at line 173 of file SoTubs.h.

173 {
174 double oldSin=sinPhi,oldCos=cosPhi;
175 sinPhi = oldSin*cosDeltaPhi+oldCos*sinDeltaPhi;
176 cosPhi = oldCos*cosDeltaPhi-oldSin*sinDeltaPhi;
177 }

Referenced by generatePrimitives().

◆ initClass()

void SoTubs::initClass ( void  )
static

Class Initializer, required.

Definition at line 84 of file SoTubs.cc.

84 {
85 // This statement is required.
86 static bool first = true;
87 if (first) {
88 first = false;
89 SO_NODE_INIT_CLASS(SoTubs,SoShape,"Shape");
90 }
91}

Referenced by G4OpenInventor::InitNodes().

◆ SO_NODE_HEADER()

SoTubs::SO_NODE_HEADER ( SoTubs  )
private

◆ updateChildren()

void SoTubs::updateChildren ( )
private

Used to modify hidden children when a data field is changed. Required whenever the class has hidden children.

Definition at line 265 of file SoTubs.cc.

265 {
266
267 // Redraw the G4Tubs....
268
269 assert(children->getLength()==1);
270 SoSeparator *sep = (SoSeparator *) ( *children)[0];
271 SoCoordinate3 *theCoordinates = (SoCoordinate3 *) ( sep->getChild(0));
272 SoNormal *theNormals = (SoNormal *) ( sep->getChild(1));
273 SoNormalBinding *theNormalBinding = (SoNormalBinding *) ( sep->getChild(2));
274 SoIndexedFaceSet *theFaceSet = (SoIndexedFaceSet *) ( sep->getChild(3));
275
276
277 const int NPHI=24, NPOINTS=2*(2*NPHI+2), NFACES=4*NPHI+2, NINDICES = NFACES*5;
278 float points[NPOINTS][3],normals[NFACES][3];
279#ifdef INVENTOR2_0
280 static long indices[NINDICES];
281#else
282 static int32_t indices[NINDICES];
283#endif
284
285 static int init=0;
286 double phi, pp, DeltaPhi;
287
288 // Indices need to be generated once! This is here to keep it close to the point
289 // generation, since otherwise it will be confusing.
290
291 int i;
292 if (!init) {
293 init = 1;
294 // Outer face
295 for (i = 0; i< NPHI; i++) {
296 // 0 1 3 2;
297 indices[5*i+0] = 2*i+0;
298 indices[5*i+1] = 2*i+1;
299 indices[5*i+2] = 2*i+3;
300 indices[5*i+3] = 2*i+2;
301 indices[5*i+4] = SO_END_FACE_INDEX;
302 }
303 // the inner face
304 for (i=0;i<NPHI;i++) {
305 indices[5*1*NPHI + 5*i+0] = 2*NPHI+2 + 2*i+0;
306 indices[5*1*NPHI + 5*i+1] = 2*NPHI+2 + 2*i+1;
307 indices[5*1*NPHI + 5*i+2] = 2*NPHI+2 + 2*i+3;
308 indices[5*1*NPHI + 5*i+3] = 2*NPHI+2 + 2*i+2;
309 indices[5*1*NPHI + 5*i+4] = SO_END_FACE_INDEX;
310 }
311 // the top side
312 for (i=0;i<NPHI;i++) {
313 indices[5*2*NPHI + 5*i+0] = 2*i+0;
314 indices[5*2*NPHI + 5*i+1] = 2*i+2;
315 indices[5*2*NPHI + 5*i+2] = NPOINTS - (2*i+4);
316 indices[5*2*NPHI + 5*i+3] = NPOINTS - (2*i+2);
317 indices[5*2*NPHI + 5*i+4] = SO_END_FACE_INDEX;
318 }
319 // the bottom side
320 for (i=0;i<NPHI;i++) {
321 indices[5*3*NPHI + 5*i+0] = 2*i+1;
322 indices[5*3*NPHI + 5*i+1] = NPOINTS - (2*i+1);
323 indices[5*3*NPHI + 5*i+2] = NPOINTS - (2*i+3);
324 indices[5*3*NPHI + 5*i+3] = 2*i+3;
325 indices[5*3*NPHI + 5*i+4] = SO_END_FACE_INDEX;
326 }
327 // the odd side
328 indices[5*4*NPHI +0] = 2*NPHI;
329 indices[5*4*NPHI +1] = 2*NPHI+1;
330 indices[5*4*NPHI +2] = 2*NPHI+3;
331 indices[5*4*NPHI +3] = 2*NPHI+2;
332 indices[5*4*NPHI +4] = SO_END_FACE_INDEX;
333 // aother odd side
334 indices[5*4*NPHI +5 +0] = 0;
335 indices[5*4*NPHI +5 +1] = NPOINTS-2;
336 indices[5*4*NPHI +5 +2] = NPOINTS-1;
337 indices[5*4*NPHI +5 +3] = 1;
338 indices[5*4*NPHI +5 +4] = SO_END_FACE_INDEX;
339 }
340 // Points need to be generated each time:
341 if (pDPhi.getValue()<2*M_PI) {
342 // the odd side
343 indices[5*4*NPHI +0] = 2*NPHI;
344 indices[5*4*NPHI +1] = 2*NPHI+1;
345 indices[5*4*NPHI +2] = 2*NPHI+3;
346 indices[5*4*NPHI +3] = 2*NPHI+2;
347 indices[5*4*NPHI +4] = SO_END_FACE_INDEX;
348 // aother odd side
349 indices[5*4*NPHI +5 +0] = 0;
350 indices[5*4*NPHI +5 +1] = NPOINTS-2;
351 indices[5*4*NPHI +5 +2] = NPOINTS-1;
352 indices[5*4*NPHI +5 +3] = 1;
353 indices[5*4*NPHI +5 +4] = SO_END_FACE_INDEX;
354 }
355 else {
356 // the odd side
357 indices[5*4*NPHI +0] = SO_END_FACE_INDEX;
358 indices[5*4*NPHI +1] = SO_END_FACE_INDEX;
359 indices[5*4*NPHI +2] = SO_END_FACE_INDEX;
360 indices[5*4*NPHI +3] = SO_END_FACE_INDEX;
361 indices[5*4*NPHI +4] = SO_END_FACE_INDEX;
362 // aother odd side
363 indices[5*4*NPHI +5 +0] = SO_END_FACE_INDEX;
364 indices[5*4*NPHI +5 +1] = SO_END_FACE_INDEX;
365 indices[5*4*NPHI +5 +2] = SO_END_FACE_INDEX;
366 indices[5*4*NPHI +5 +3] = SO_END_FACE_INDEX;
367 indices[5*4*NPHI +5 +4] = SO_END_FACE_INDEX;
368 }
369 // The outer surface
370 DeltaPhi = pDPhi.getValue()/NPHI, phi = pSPhi.getValue();
371 for (i = 0; i<=NPHI; i++) {
372 points[2*i+0][0] = pRMax.getValue()*FCOS(phi);
373 points[2*i+0][1]= pRMax.getValue()*FSIN(phi);
374 points[2*i+0][2] = +pDz.getValue();
375
376 points[2*i+1][0] = pRMax.getValue()*FCOS(phi);
377 points[2*i+1][1]= pRMax.getValue()*FSIN(phi);
378 points[2*i+1][2] = -pDz.getValue();
379
380 pp = phi+DeltaPhi/2.0;
381 if (i!=NPHI) {
382 normals[i][0] = FCOS(pp);
383 normals[i][1] = FSIN(pp);
384 normals[i][2] = 0;
385 }
386 phi+=DeltaPhi;
387 }
388 // The inner surface
389 phi = pSPhi.getValue() + pDPhi.getValue();
390 for (i = 0; i<=NPHI; i++) {
391 points[2*NPHI+2+2*i+0][0] = pRMin.getValue()*FCOS(phi);
392 points[2*NPHI+2+2*i+0][1] = pRMin.getValue()*FSIN(phi);
393 points[2*NPHI+2+2*i+0][2] = +pDz.getValue();
394 points[2*NPHI+2+2*i+1][0] = pRMin.getValue()*FCOS(phi);
395 points[2*NPHI+2+2*i+1][1] = pRMin.getValue()*FSIN(phi);
396 points[2*NPHI+2+2*i+1][2] = -pDz.getValue();
397 pp = phi-DeltaPhi/2.0;
398 if (i!=NPHI) {
399 normals[NPHI+i][0] = -FCOS(pp);
400 normals[NPHI+i][1] = -FSIN(pp);
401 normals[NPHI+i][2] = 0;
402 }
403 phi-=DeltaPhi;
404 }
405 // The top side
406 for (i=0;i<NPHI;i++) {
407 normals[2*NPHI+i][0]=normals[2*NPHI+i][1]=0;
408 normals[2*NPHI+i][2]= 1.0;
409 }
410 // The bottom side
411 for (i=0;i<NPHI;i++) {
412 normals[3*NPHI+i][0]=normals[3*NPHI+i][1]=0;
413 normals[3*NPHI+i][2]= -1.0;
414 }
415 // The odd side
416 phi = pSPhi.getValue();
417 normals[4*NPHI+0][0]= FSIN(phi);
418 normals[4*NPHI+0][1]= -FCOS(phi);
419 normals[4*NPHI+0][2]=0;
420
421 // Another odd side
422 phi = pSPhi.getValue()+pDPhi.getValue();
423 normals[4*NPHI+1][0]= -FSIN(phi);
424 normals[4*NPHI+1][1]= +FCOS(phi);
425 normals[4*NPHI+1][2]=0;
426
427 for (int np=0;np<NPOINTS; np++) theCoordinates->point.set1Value(np,points[np][0],points[np][1],points[np][2]);
428 for (int ni=0;ni<NINDICES;ni++) theFaceSet->coordIndex.set1Value(ni,indices[ni]);
429 for (int nf=0;nf<NFACES;nf++) theNormals->vector.set1Value(nf,normals[nf][0],normals[nf][1],normals[nf][2]);
430 theNormalBinding->value=SoNormalBinding::PER_FACE;
431}
#define FCOS(x)
Definition: SbMath.h:40
#define FSIN(x)
Definition: SbMath.h:41

References children, FCOS, FSIN, M_PI, pDPhi, pDz, G4InuclParticleNames::pp, pRMax, pRMin, and pSPhi.

Referenced by generateAlternateRep().

Field Documentation

◆ alternateRep

SoSFNode SoTubs::alternateRep

Alternate rep - required.

Definition at line 101 of file SoTubs.h.

Referenced by clearAlternateRep(), and generateAlternateRep().

◆ children

SoChildList* SoTubs::children
private

ChildList. Required whenever the class has hidden children.

Definition at line 168 of file SoTubs.h.

Referenced by generateAlternateRep(), generateChildren(), getChildren(), updateChildren(), and ~SoTubs().

◆ pDPhi

SoSFFloat SoTubs::pDPhi

Delta-angle, in radians.

Definition at line 97 of file SoTubs.h.

Referenced by generatePrimitives(), and updateChildren().

◆ pDz

SoSFFloat SoTubs::pDz

Half-length in Z.

Definition at line 89 of file SoTubs.h.

Referenced by computeBBox(), generatePrimitives(), and updateChildren().

◆ pRMax

SoSFFloat SoTubs::pRMax

Outside radius of the tube.

Definition at line 85 of file SoTubs.h.

Referenced by computeBBox(), generatePrimitives(), and updateChildren().

◆ pRMin

SoSFFloat SoTubs::pRMin

Inside radius of the tube.

Definition at line 81 of file SoTubs.h.

Referenced by generatePrimitives(), and updateChildren().

◆ pSPhi

SoSFFloat SoTubs::pSPhi

Starting angle, in radians.

Definition at line 93 of file SoTubs.h.

Referenced by generatePrimitives(), and updateChildren().


The documentation for this class was generated from the following files: