17 #include <Inventor/C/errors/debugerror.h>
18 #include <Inventor/nodes/SoMaterial.h>
19 #include <Inventor/nodes/SoCone.h>
20 #include <Inventor/nodes/SoSeparator.h>
21 #include <Inventor/nodes/SoTranslation.h>
22 #include <Inventor/nodes/SoRotationXYZ.h>
25 #include "CLHEP/Units/SystemOfUnits.h"
26 #define SYSTEM_OF_UNITS CLHEP
28 #include "GaudiKernel/SystemOfUnits.h"
29 #define SYSTEM_OF_UNITS Gaudi::Units
37 SoSeparator * attachsep);
80 : theclass(tc), material(
mat), attachSep(as), shown(false),
81 etaval(1), extent(1),
sep(0),
82 cone1(0), trans1(0), innercone1(0), innertrans1(0),
83 cone2(0), trans2(0), innercone2(0), innertrans2(0)
94 theclass->messageVerbose(
"Building 3D objects");
95 sep =
new SoSeparator;
97 sep->addChild(material);
99 SoSeparator * sepfirst =
new SoSeparator;
100 SoSeparator * sepsecond =
new SoSeparator;
102 for (
int i = 0;
i<2;++
i){
103 SoRotationXYZ * xf =
new SoRotationXYZ();
106 SoTranslation * xl =
new SoTranslation();
107 SoCone * cone =
new SoCone();
108 SoTranslation * innerxl =
new SoTranslation();
109 SoCone * innercone =
new SoCone();
114 innercone1 = innercone;
115 innertrans1 = innerxl;
119 innercone2 = innercone;
120 innertrans2 = innerxl;
123 cone->removePart(SoCone::BOTTOM);
124 innercone->removePart(SoCone::BOTTOM);
126 SoSeparator *
s(
i==0?sepfirst:sepsecond);
130 s->addChild(innerxl);
131 s->addChild(innercone);
139 ensureInit3DObjects();
140 theclass->messageVerbose(
"Updating fields");
144 bool etaconeextentisz = (extent<0);
145 double absextent = fabs(extent);
146 double coneHeight,bottomRadius;
147 if (etaconeextentisz) {
148 coneHeight = absextent;
149 bottomRadius = coneHeight*tanfact;
151 bottomRadius = absextent;
152 coneHeight=bottomRadius/tanfact;
155 theclass->messageVerbose(
"etaval = "+
str(etaval));
156 theclass->messageVerbose(
"extent = "+
str(extent));
157 theclass->messageVerbose(
"absextent = "+
str(absextent));
158 theclass->messageVerbose(
"tanfact = "+
str(tanfact));
159 theclass->messageVerbose(
"bottomRadius = "+
str(bottomRadius));
160 theclass->messageVerbose(
"coneHeight = "+
str(coneHeight));
162 cone1->bottomRadius = bottomRadius;
163 cone1->height = coneHeight;
164 cone2->bottomRadius = bottomRadius;
165 cone2->height = coneHeight;
166 trans1->translation.setValue(0, -coneHeight/2, 0);
167 trans2->translation.setValue(0, -coneHeight/2, 0);
169 innercone1->bottomRadius = bottomRadius;
170 innercone1->height = -coneHeight;
171 innercone2->bottomRadius = bottomRadius;
172 innercone2->height = -coneHeight;
175 innertrans1->translation.setValue(0, coneHeight/2+1.001*coneHeight/2+epsilon, 0);
176 innertrans2->translation.setValue(0, coneHeight/2+1.001*coneHeight/2+epsilon, 0);