94 theclass->messageVerbose(
"Building 3D objects");
95 sep =
new SoSeparator;
99 SoSeparator * sepfirst =
new SoSeparator;
100 SoSeparator * sepsecond =
new SoSeparator;
102 for (
int i = 0;i<2;++i){
103 SoRotationXYZ * xf =
new SoRotationXYZ();
104 xf->axis=SoRotationXYZ::X;
105 xf->angle = i==0 ? 90.0*SYSTEM_OF_UNITS::deg : -90*SYSTEM_OF_UNITS::deg;
106 SoTranslation * xl =
new SoTranslation();
107 SoCone * cone =
new SoCone();
108 SoTranslation * innerxl =
new SoTranslation();
109 SoCone * innercone =
new SoCone();
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);
140 theclass->messageVerbose(
"Updating fields");
143 double tanfact = tan(
theta);
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;
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);
174 const double epsilon = 0.50*SYSTEM_OF_UNITS::mm;
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);