ATLAS Offline Software
Loading...
Searching...
No Matches
SoCons Class Reference

SoCons - Inventor version of the G4Cons Geant Geometry entity. More...

#include <SoCons.h>

Inheritance diagram for SoCons:
Collaboration diagram for SoCons:

Public Member Functions

 SoCons ()
 Constructor, required.
virtual void generateAlternateRep ()
 Generate AlternateRep, required.
virtual void clearAlternateRep ()
 We better be able to clear it, too!

Static Public Member Functions

static void initClass ()
 Class Initializer, required.

Public Attributes

SoSFFloat fRmin1
 Inside radius at -fDz.
SoSFFloat fRmin2
 Inside radius at +fDz.
SoSFFloat fRmax1
 Outside radius at -fDz.
SoSFFloat fRmax2
 Outside radius at +fDz.
SoSFFloat fDz
 Half-length along Z.
SoSFFloat fSPhi
 Starting angle, in radians.
SoSFFloat fDPhi
 Delta-angle, in radians.
SoSFBool smoothDraw
 An Inventor option - slightly better render, worse performance.
SoSFInt32 pOverrideNPhi
 Override number of phi subdivision used for rendering shape (i.e.
SoSFNode alternateRep
 Alternate rep required - for use by users without HEPVis shared objects.

Protected Member Functions

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

Private Member Functions

 SO_NODE_HEADER (SoCons)
void generateChildren ()
 Generate Children.
void updateChildren ()
 Used to modify hidden children when a data field is changed.
void inc (double &sinPhi, double &cosPhi, double sinDeltaPhi, double cosDeltaPhi) const
 help with trigonometry. increments sines an cosines by an angle.

Private Attributes

std::unique_ptr< SoChildList > m_children
 ChildList. Required whenever the class has hidden children.

Detailed Description

SoCons - Inventor version of the G4Cons Geant Geometry entity.

Node: SoCons

Description: The Inventor version of the G4Cons Geant Geometry entity

Author: Joe Boudreau Nov 11 1996

The documentation from Geant says:

A G4Cons is, in the general case, a Phi segment of a cone, with half-length fDz, inner and outer radii specified at -fDz and +fDz. The Phi segment is described by a starting fSPhi angle, and the +fDPhi delta angle for the shape. If the delta angle is >=2*M_PI, the shape is treated as continuous in Phi

Member Data:

 fRmin1  inside radius at  -fDz
 fRmin2  inside radius at  +fDz
 fRmax1  outside radius at -fDz
 fRmax2  outside radius at +fDz
 fDz     half length in z

 fSPhi   starting angle of the segment in radians
 fDPhi   delta angle of the segment in radians

Definition at line 53 of file SoCons.h.

Constructor & Destructor Documentation

◆ SoCons()

SoCons::SoCons ( )

Constructor, required.

Definition at line 37 of file SoCons.cxx.

37 {
38 // This statement is required
39 SO_NODE_CONSTRUCTOR(SoCons);
40
41 // Data fields are initialized like this:
42 SO_NODE_ADD_FIELD(fRmin1, (0.0));
43 SO_NODE_ADD_FIELD(fRmin2, (0.0));
44 SO_NODE_ADD_FIELD(fRmax1, (1.0));
45 SO_NODE_ADD_FIELD(fRmax2, (1.0));
46 SO_NODE_ADD_FIELD(fDz, (10.0));
47 SO_NODE_ADD_FIELD(fSPhi, (0.0));
48 SO_NODE_ADD_FIELD(fDPhi, ((float)(2*M_PI)));
49 SO_NODE_ADD_FIELD(smoothDraw, (TRUE));
50 SO_NODE_ADD_FIELD(pOverrideNPhi, (0));
51 SO_NODE_ADD_FIELD(alternateRep, (NULL));
52 m_children = std::make_unique<SoChildList>(this);
53
54 setNodeType(EXTENSION);
55}
#define M_PI
SoCons()
Constructor, required.
Definition SoCons.cxx:37
SoSFFloat fDPhi
Delta-angle, in radians.
Definition SoCons.h:87
SoSFInt32 pOverrideNPhi
Override number of phi subdivision used for rendering shape (i.e.
Definition SoCons.h:96
SoSFFloat fSPhi
Starting angle, in radians.
Definition SoCons.h:83
SoSFFloat fRmax2
Outside radius at +fDz.
Definition SoCons.h:75
std::unique_ptr< SoChildList > m_children
ChildList. Required whenever the class has hidden children.
Definition SoCons.h:160
SoSFFloat fRmax1
Outside radius at -fDz.
Definition SoCons.h:71
SoSFFloat fRmin1
Inside radius at -fDz.
Definition SoCons.h:63
SoSFFloat fRmin2
Inside radius at +fDz.
Definition SoCons.h:67
SoSFNode alternateRep
Alternate rep required - for use by users without HEPVis shared objects.
Definition SoCons.h:100
SoSFFloat fDz
Half-length along Z.
Definition SoCons.h:79
SoSFBool smoothDraw
An Inventor option - slightly better render, worse performance.
Definition SoCons.h:91

Member Function Documentation

◆ clearAlternateRep()

void SoCons::clearAlternateRep ( )
virtual

We better be able to clear it, too!

Definition at line 439 of file SoCons.cxx.

439 {
440 alternateRep.setValue(NULL);
441}

◆ computeBBox()

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

compute bounding Box, required

Definition at line 239 of file SoCons.cxx.

239 {
240 RevolutionSurfaceUtil::setBBoxPars(fSPhi.getValue(), fDPhi.getValue(),
241 std::min(fRmin1.getValue(),fRmin1.getValue()),
242 std::max(fRmax1.getValue(),fRmax1.getValue()),
243 -fDz.getValue(),fDz.getValue(),
244 box, center );
245}
static void setBBoxPars(const float &sphi, const float &dphi, const float &rmin, const float &rmax, const float &zmin, const float &zmax, SbBox3f &box, SbVec3f &center)

◆ generateAlternateRep()

void SoCons::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 428 of file SoCons.cxx.

428 {
429
430 // This routine sets the alternate representation to the child
431 // list of this mode.
432
433 if (m_children->getLength() == 0) generateChildren();
435 alternateRep.setValue((SoSeparator *) ( *m_children)[0]);
436}
void updateChildren()
Used to modify hidden children when a data field is changed.
Definition SoCons.cxx:251
void generateChildren()
Generate Children.
Definition SoCons.cxx:404

◆ generateChildren()

void SoCons::generateChildren ( )
private

Generate Children.

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

Definition at line 404 of file SoCons.cxx.

404 {
405
406 // This routines creates one SoSeparator, one SoCoordinate3, and
407 // one SoLineSet, and puts it in the child list. This is done only
408 // once, whereas redrawing the position of the coordinates occurs each
409 // time an update is necessary, in the updateChildren routine.
410
411 assert(m_children->getLength() ==0);
412 SoSeparator *sep = new SoSeparator();
413 SoCoordinate3 *theCoordinates = new SoCoordinate3();
414 SoNormal *theNormals = new SoNormal();
415 SoNormalBinding *theNormalBinding = new SoNormalBinding();
416 SoIndexedFaceSet *theFaceSet = new SoIndexedFaceSet();
417 //
418 // This line costs some in render quality! but gives speed.
419 //
420 sep->addChild(theCoordinates);
421 sep->addChild(theNormals);
422 sep->addChild(theNormalBinding);
423 sep->addChild(theFaceSet);
424 m_children->append(sep);
425}

◆ generatePrimitives()

void SoCons::generatePrimitives ( SoAction * action)
protectedvirtual

Generate Primitives, required.

Definition at line 69 of file SoCons.cxx.

69 {
70 // This variable is used to store each vertex
71 SoPrimitiveVertex pv;
72
73 // Access the stat from the action
74 SoState *state = action->getState();
75 if (!state)
76 return;
77
78 // See if we have to use a texture coordinate function,
79 // rather than generating explicit texture coordinates.
80 SbBool useTexFunction=
81 (SoTextureCoordinateElement::getType(state) ==
82 SoTextureCoordinateElement::FUNCTION);
83
84 // If we need to generate texture coordinates with a function,
85 // we'll need an SoGLTextureCoordinateElement. Otherwise, we'll
86 // set up the coordinates directly.
87 const SoTextureCoordinateElement *tce = NULL;
88 SbVec4f texCoord;
89 if (useTexFunction) {
90 tce = SoTextureCoordinateElement::getInstance(state);
91 } else {
92 texCoord[2] = 0.0;
93 texCoord[3] = 1.0;
94 }
95 SbVec3f point, normal;
96
98 //-----------------------------------------------------
99#define GEN_VERTEX(pv,x,y,z,s,t,nx,ny,nz) \
100 point.setValue((float)(x),(float)(y),(float)(z)); \
101 normal.setValue((float)(nx),(float)(ny),(float)(nz)); \
102 if (useTexFunction) { \
103 texCoord=tce->get(point,normal); \
104 } else { \
105 texCoord[0]=(float)(s); \
106 texCoord[1]=(float)(t); \
107 } \
108 pv.setPoint(point); \
109 pv.setNormal(normal); \
110 pv.setTextureCoords(texCoord); \
111 shapeVertex(&pv);
112 //-----------------------------------------------------
114
115 int NPHI = RevolutionSurfaceUtil::nphiDivisions( fDPhi.getValue(), this->getComplexityValue(action), pOverrideNPhi.getValue() );
116
117 double deltaPhi = fDPhi.getValue()/NPHI;
118 double phi0 = fSPhi.getValue();
119 double phi1 = phi0 + fDPhi.getValue();
120 double rMax1 = fRmax1.getValue();
121 double rMin1 = fRmin1.getValue();
122 double rMax2 = fRmax2.getValue();
123 double rMin2 = fRmin2.getValue();
124 double zMax = fDz.getValue();
125 double zMin = -zMax;
126 double cosPhi0 = cos(phi0);
127 double sinPhi0 = sin(phi0);
128 double cosPhi1 = cos(phi1);
129 double sinPhi1 = sin(phi1);
130 double cosDeltaPhi = cos(deltaPhi);
131 double sinDeltaPhi = sin(deltaPhi);
132 //
133 // The outer surface!
134 //
135 int i;
136 double sinPhi=sinPhi0;
137 double cosPhi=cosPhi0;
138
139 {
140 double dR =rMax2-rMax1;
141 double dZ =zMax-zMin;
142 double cosTheta = -dR/sqrt(dR*dR+dZ*dZ);
143 double sinTheta = dZ/sqrt(dR*dR+dZ*dZ);
144
145 beginShape(action,TRIANGLE_STRIP);
146 for (i = 0; i<=NPHI; i++) {
147 GEN_VERTEX(pv,rMax2*cosPhi,rMax2*sinPhi,zMax,0.0,0.0,sinTheta*cosPhi,sinTheta*sinPhi,cosTheta);
148 GEN_VERTEX(pv,rMax1*cosPhi,rMax1*sinPhi,zMin,1.0,1.0,sinTheta*cosPhi,sinTheta*sinPhi,cosTheta);
149 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
150 }
151 endShape();
152 }
153 //
154 // The inner surface!
155 //
156
157 sinPhi=sinPhi0;
158 cosPhi=cosPhi0;
159
160 {
161 double dR =rMin2-rMin1;
162 double dZ =zMax-zMin;
163 double cosTheta = -dR/sqrt(dR*dR+dZ*dZ);
164 double sinTheta = dZ/sqrt(dR*dR+dZ*dZ);
165 beginShape(action,TRIANGLE_STRIP);
166 for (i = 0; i<=NPHI; i++) {
167 GEN_VERTEX(pv,rMin2*cosPhi,rMin2*sinPhi,zMax,0.0,0.0,-sinTheta*cosPhi,-sinTheta*sinPhi,-cosTheta);
168 GEN_VERTEX(pv,rMin1*cosPhi,rMin1*sinPhi,zMin,1.0,1.0,-sinTheta*cosPhi,-sinTheta*sinPhi,-cosTheta);
169 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
170 }
171 endShape();
172 }
173 if (fabs(deltaPhi)<2.0*M_PI) {
174 //
175 // The end
176 //
177 beginShape(action,TRIANGLE_STRIP);
178 sinPhi=sinPhi0;
179 cosPhi=cosPhi0;
180 GEN_VERTEX(pv,rMax2*cosPhi,rMax2*sinPhi,zMax,0.0,0.0,sinPhi,-cosPhi,0);
181 GEN_VERTEX(pv,rMax1*cosPhi,rMax1*sinPhi,zMin,1.0,1.0,sinPhi,-cosPhi,0);
182 GEN_VERTEX(pv,rMin2*cosPhi,rMin2*sinPhi,zMax,1.0,0.0,sinPhi,-cosPhi,0);
183 GEN_VERTEX(pv,rMin1*cosPhi,rMin1*sinPhi,zMin,0.0,1.0,sinPhi,-cosPhi,0);
184 endShape();
185 //
186 // The other end
187 //
188 beginShape(action,TRIANGLE_STRIP);
189 sinPhi=sinPhi1;
190 cosPhi=cosPhi1;
191 GEN_VERTEX(pv,rMax2*cosPhi,rMax2*sinPhi, zMax,0.0,0.0,-sinPhi,+cosPhi,0);
192 GEN_VERTEX(pv,rMax1*cosPhi,rMax1*sinPhi, zMin,1.0,1.0,-sinPhi,+cosPhi,0);
193 GEN_VERTEX(pv,rMin2*cosPhi,rMin2*sinPhi, zMax,1.0,0.0,-sinPhi,+cosPhi,0);
194 GEN_VERTEX(pv,rMin1*cosPhi,rMin1*sinPhi, zMin,0.0,1.0,-sinPhi,+cosPhi,0);
195 endShape();
196 }
197
198 //
199 // The outer surface at z=+PDZ
200 //
201 beginShape(action,TRIANGLE_STRIP);
202 sinPhi=sinPhi0;
203 cosPhi=cosPhi0;
204 for (i = 0; i<=NPHI; i++) {
205 GEN_VERTEX(pv,rMin2*cosPhi,rMin2*sinPhi,zMax,0.0,0.0,0,0,1);
206 GEN_VERTEX(pv,rMax2*cosPhi,rMax2*sinPhi,zMax,1.0,1.0,0,0,1);
207 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
208 }
209 endShape();
210 //
211 // The outer surface at z=-PDZ
212 //
213 beginShape(action,TRIANGLE_STRIP);
214 sinPhi=sinPhi0;
215 cosPhi=cosPhi0;
216 for (i = 0; i<=NPHI; i++) {
217 GEN_VERTEX(pv,rMin1*cosPhi,rMin1*sinPhi,zMin,0.0,0.0,0,0,-1);
218 GEN_VERTEX(pv,rMax1*cosPhi,rMax1*sinPhi,zMin,1.0,1.0,0,0,-1);
219 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
220 }
221 endShape();
222
223 if (state&&state->isElementEnabled(SoGLCacheContextElement::getClassStackIndex())) {
224 //Encourage auto caching
225 SoGLCacheContextElement::shouldAutoCache(state, SoGLCacheContextElement::DO_AUTO_CACHE);
226#if ((COIN_MAJOR_VERSION>=3)||((COIN_MAJOR_VERSION==2)&&(COIN_MINOR_VERSION>=5)))
227 SoGLCacheContextElement::incNumShapes(state);
228#endif
229 }
230}
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
#define GEN_VERTEX(pv, x, y, z, s, t, nx, ny, nz)
static int nphiDivisions(const float &dphi, const float &complexity, int OverrideNPhi=0)
void inc(double &sinPhi, double &cosPhi, double sinDeltaPhi, double cosDeltaPhi) const
help with trigonometry. increments sines an cosines by an angle.
Definition SoCons.h:165

◆ getChildren()

SoChildList * SoCons::getChildren ( ) const
protectedvirtual

GetChildList, required whenever the class has hidden children.

Definition at line 233 of file SoCons.cxx.

233 {
234 return m_children.get();
235}

◆ inc()

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

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

Definition at line 165 of file SoCons.h.

165 {
166 double oldSin=sinPhi,oldCos=cosPhi;
167 sinPhi = oldSin*cosDeltaPhi+oldCos*sinDeltaPhi;
168 cosPhi = oldCos*cosDeltaPhi-oldSin*sinDeltaPhi;
169 }

◆ initClass()

void SoCons::initClass ( )
static

Class Initializer, required.

Definition at line 59 of file SoCons.cxx.

60{
61 [[maybe_unused]] static const bool didInit = [&]() {
62 SO_NODE_INIT_CLASS(SoCons,SoShape,"Shape");
63 return true;
64 }();
65}

◆ SO_NODE_HEADER()

SoCons::SO_NODE_HEADER ( SoCons )
private

◆ updateChildren()

void SoCons::updateChildren ( )
private

Used to modify hidden children when a data field is changed.

Required whenever the class has hidden children.

Definition at line 251 of file SoCons.cxx.

251 {
252
253
254 // Redraw the G4Cons....
255
256 assert(m_children->getLength()==1);
257 SoSeparator *sep = (SoSeparator *) ( *m_children)[0];
258 SoCoordinate3 *theCoordinates = (SoCoordinate3 *) ( sep->getChild(0));
259 SoNormal *theNormals = (SoNormal *) ( sep->getChild(1));
260 SoNormalBinding *theNormalBinding = (SoNormalBinding *) ( sep->getChild(2));
261 SoIndexedFaceSet *theFaceSet = (SoIndexedFaceSet *) ( sep->getChild(3));
262
263 const int NPHI=96, NPOINTS=2*(2*NPHI+2), NFACES=4*NPHI+2, NINDICES = NFACES*5;
264 float points[NPOINTS][3], normals[NFACES][3];
265#ifdef INVENTOR2_0
266 static long indices[NINDICES];
267#else
268 static int32_t indices[NINDICES];
269#endif
270 static int init=0;
271 double phi, pp, DeltaPhi;
272
273 // Indices need to be generated once! This is here to keep it close to the point
274 // generation, since otherwise it will be confusing.
275
276 int i;
277 if (!init) {
278 init = 1;
279 // Outer face
280 for (i = 0; i< NPHI; i++) {
281 // 0 1 3 2;
282 indices[5*i+0] = 2*i+0;
283 indices[5*i+1] = 2*i+1;
284 indices[5*i+2] = 2*i+3;
285 indices[5*i+3] = 2*i+2;
286 indices[5*i+4] = SO_END_FACE_INDEX;
287 }
288 // the inner face
289 for (i=0;i<NPHI;i++) {
290 indices[5*1*NPHI + 5*i+0] = 2*NPHI+2 + 2*i+0;
291 indices[5*1*NPHI + 5*i+1] = 2*NPHI+2 + 2*i+1;
292 indices[5*1*NPHI + 5*i+2] = 2*NPHI+2 + 2*i+3;
293 indices[5*1*NPHI + 5*i+3] = 2*NPHI+2 + 2*i+2;
294 indices[5*1*NPHI + 5*i+4] = SO_END_FACE_INDEX;
295 }
296 // the top side
297 for (i=0;i<NPHI;i++) {
298 indices[5*2*NPHI + 5*i+0] = 2*i+0;
299 indices[5*2*NPHI + 5*i+1] = 2*i+2;
300 indices[5*2*NPHI + 5*i+2] = NPOINTS - (2*i+4);
301 indices[5*2*NPHI + 5*i+3] = NPOINTS - (2*i+2);
302 indices[5*2*NPHI + 5*i+4] = SO_END_FACE_INDEX;
303 }
304 // the bottom side
305 for (i=0;i<NPHI;i++) {
306 indices[5*3*NPHI + 5*i+0] = 2*i+1;
307 indices[5*3*NPHI + 5*i+1] = NPOINTS - (2*i+1);
308 indices[5*3*NPHI + 5*i+2] = NPOINTS - (2*i+3);
309 indices[5*3*NPHI + 5*i+3] = 2*i+3;
310 indices[5*3*NPHI + 5*i+4] = SO_END_FACE_INDEX;
311 }
312 // the odd side
313 indices[5*4*NPHI +0] = 2*NPHI;
314 indices[5*4*NPHI +1] = 2*NPHI+1;
315 indices[5*4*NPHI +2] = 2*NPHI+3;
316 indices[5*4*NPHI +3] = 2*NPHI+2;
317 indices[5*4*NPHI +4] = SO_END_FACE_INDEX;
318 // aother odd side
319 indices[5*4*NPHI +5 +0] = 0;
320 indices[5*4*NPHI +5 +1] = NPOINTS-2;
321 indices[5*4*NPHI +5 +2] = NPOINTS-1;
322 indices[5*4*NPHI +5 +3] = 1;
323 indices[5*4*NPHI +5 +4] = SO_END_FACE_INDEX;
324 }
325 // Points need to be generated each time:
326 // The outer surface
327 DeltaPhi = fDPhi.getValue()/NPHI, phi = fSPhi.getValue();
328 float t,st,ct;
329 t = FATAN((fRmax2.getValue()-fRmax1.getValue())/(2*fDz.getValue()));
330 st = FSIN(t);
331 ct = FCOS(t);
332 for (i = 0; i<=NPHI; i++) {
333 points[2*i+0][0] = fRmax2.getValue()*FCOS(phi);
334 points[2*i+0][1] = fRmax2.getValue()*FSIN(phi);
335 points[2*i+0][2] = +fDz.getValue();
336 points[2*i+1][0] = fRmax1.getValue()*FCOS(phi);
337 points[2*i+1][1] = fRmax1.getValue()*FSIN(phi);
338 points[2*i+1][2] = -fDz.getValue();
339 pp = phi+DeltaPhi/2.0;
340 if (i!=NPHI) {
341 normals[i][0] = ct * FCOS(pp);
342 normals[i][1] = ct * FSIN(pp);
343 normals[i][2] = -st;
344 }
345 phi+=DeltaPhi;
346 }
347 // The inner surface
348 phi = fSPhi.getValue() + fDPhi.getValue();
349 t = FATAN((fRmin2.getValue()-fRmin1.getValue())/(2*fDz.getValue()));
350 st = FSIN(t);
351 ct = FCOS(t);
352 for (i = 0; i<=NPHI; i++) {
353 points[2*NPHI+2+2*i+0][0] = fRmin2.getValue()*FCOS(phi);
354 points[2*NPHI+2+2*i+0][1] = fRmin2.getValue()*FSIN(phi);
355 points[2*NPHI+2+2*i+0][2] = +fDz.getValue();
356 points[2*NPHI+2+2*i+1][0] = fRmin1.getValue()*FCOS(phi);
357 points[2*NPHI+2+2*i+1][1] = fRmin1.getValue()*FSIN(phi);
358 points[2*NPHI+2+2*i+1][2] = -fDz.getValue();
359 pp = phi-DeltaPhi/2.0;
360 if (i!=NPHI) {
361 normals[NPHI+i][0] = -ct*FCOS(pp);
362 normals[NPHI+i][1] = -ct*FSIN(pp);
363 normals[NPHI+i][2] = st;
364 }
365 phi-=DeltaPhi;
366 }
367 // The top side
368 for (i=0;i<NPHI;i++) {
369 normals[2*NPHI+i][0]=normals[2*NPHI+i][1]=0;
370 normals[2*NPHI+i][2]= 1.0;
371 }
372 // The bottom side
373 for (i=0;i<NPHI;i++) {
374 normals[3*NPHI+i][0]=normals[3*NPHI+i][1]=0;
375 normals[3*NPHI+i][2]= -1.0;
376 }
377 // The odd side
378 phi = fSPhi.getValue();
379 normals[4*NPHI+0][0]= FSIN(phi);
380 normals[4*NPHI+0][1]= -FCOS(phi);
381 normals[4*NPHI+0][2]= 0;
382
383 // Another odd side
384 phi = fSPhi.getValue()+fDPhi.getValue();
385 normals[4*NPHI+1][0]= -FSIN(phi);
386 normals[4*NPHI+1][1]= +FCOS(phi);
387 normals[4*NPHI+1][2]=0;
388
389 for (int np=0;np<NPOINTS;np++) theCoordinates->point.set1Value(np,points[np][0],points[np][1],points[np][2]);
390 theFaceSet->coordIndex.setValues(0,NINDICES,indices);
391 if (smoothDraw.getValue()) {
392 // This Line is replaced by the next one because of an apparent Bug in Inventor (mem. leak).
393 // theNormals->vector.deleteValues(0);
394 for (int nf=0;nf<NFACES;nf++) theNormals->vector.set1Value(nf,normals[nf][0],normals[nf][1],normals[nf][2]);
395 theNormalBinding->value=SoNormalBinding::PER_FACE;
396 }
397 else {
398 for (int nf=0;nf<NFACES;nf++) theNormals->vector.set1Value(nf,normals[nf][0],normals[nf][1],normals[nf][2]);
399 theNormalBinding->value=SoNormalBinding::PER_FACE;
400 }
401}
Scalar phi() const
phi method
#define FCOS(x)
Definition SbMath.h:13
#define FSIN(x)
Definition SbMath.h:14
#define FATAN(x)
Definition SbMath.h:18
std::pair< long int, long int > indices
init(v_theApp, v_rootStream=None)
Definition PyKernel.py:45

Member Data Documentation

◆ alternateRep

SoSFNode SoCons::alternateRep

Alternate rep required - for use by users without HEPVis shared objects.

Definition at line 100 of file SoCons.h.

◆ fDPhi

SoSFFloat SoCons::fDPhi

Delta-angle, in radians.

Definition at line 87 of file SoCons.h.

◆ fDz

SoSFFloat SoCons::fDz

Half-length along Z.

Definition at line 79 of file SoCons.h.

◆ fRmax1

SoSFFloat SoCons::fRmax1

Outside radius at -fDz.

Definition at line 71 of file SoCons.h.

◆ fRmax2

SoSFFloat SoCons::fRmax2

Outside radius at +fDz.

Definition at line 75 of file SoCons.h.

◆ fRmin1

SoSFFloat SoCons::fRmin1

Inside radius at -fDz.

Definition at line 63 of file SoCons.h.

◆ fRmin2

SoSFFloat SoCons::fRmin2

Inside radius at +fDz.

Definition at line 67 of file SoCons.h.

◆ fSPhi

SoSFFloat SoCons::fSPhi

Starting angle, in radians.

Definition at line 83 of file SoCons.h.

◆ m_children

std::unique_ptr<SoChildList> SoCons::m_children
private

ChildList. Required whenever the class has hidden children.

Definition at line 160 of file SoCons.h.

◆ pOverrideNPhi

SoSFInt32 SoCons::pOverrideNPhi

Override number of phi subdivision used for rendering shape (i.e.

ignore e.g. complexity value). Put field to 0 (the default) to ignore it.

Definition at line 96 of file SoCons.h.

◆ smoothDraw

SoSFBool SoCons::smoothDraw

An Inventor option - slightly better render, worse performance.

Definition at line 91 of file SoCons.h.


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