8 #include <Inventor/C/errors/debugerror.h>
9 #include <Inventor/nodes/SoVertexProperty.h>
10 #include <Inventor/nodes/SoLineSet.h>
11 #include <Inventor/nodes/SoPointSet.h>
12 #include <Inventor/nodes/SoSeparator.h>
13 #include <Inventor/nodes/SoCylinder.h>
14 #include <Inventor/nodes/SoRotationXYZ.h>
15 #include <Inventor/nodes/SoTranslation.h>
16 #include <Inventor/nodes/SoInfo.h>
17 #include <Inventor/nodes/SoTransform.h>
52 theclass->
message(
"sanitiseParameterValue WARNING - received nan paramter. Putting to 1.0e-5.");
70 theclass->
message(
"sanitiseParameterValue WARNING - received nan paramter. Putting to 1.0e-5.");
80 if (
x < 1.0
e-5 &&
x != 0.0 )
85 void summarise(
unsigned n,
const QString& shapename)
const;
144 double id(halfLength-999999999.9*
radius);
150 SoSeparator*
sep =
new SoSeparator;
151 SoRotationXYZ * rot =
new SoRotationXYZ;
153 rot->angle.setValue(
M_PI*0.5
f);
155 SoCylinder * cyl =
new SoCylinder;
156 cyl->radius.setValue(
radius);
157 cyl->height.setValue(2.0
f*halfLength);
163 SoVertexProperty * scatVtxProperty =
new SoVertexProperty();
164 scatVtxProperty->vertex.set1Value(0, 0.0
f,0.0
f,-halfLength);
165 scatVtxProperty->vertex.set1Value(1, 0.0
f,0.0
f, halfLength);
166 SoLineSet *
line =
new SoLineSet();
167 line->numVertices = 2;
168 line->vertexProperty = scatVtxProperty;
187 SoSeparator*
sep =
new SoSeparator;
188 SoRotationXYZ * rot =
new SoRotationXYZ;
190 rot->angle.setValue(
M_PI*0.5
f);
192 SoCylinder * cyl =
new SoCylinder;
193 cyl->radius.setValue(
radius);
204 bool inner,
bool outer )
210 double id(halfLength-9999.9*
radius-(inner?0.0:-9999799.99)-(outer?0.0:-9999997979.99));
215 if (!inner&&!outer) {
217 SoInfo *
info =
new SoInfo;
224 double halfLengthInner = halfLength<160.0 ? 2*349.3150-halfLength : halfLength;
228 SoSeparator*
sep =
new SoSeparator;
229 SoRotationXYZ * rot =
new SoRotationXYZ;
231 rot->angle.setValue(
M_PI*0.5
f);
233 SoCylinder * cyl =
new SoCylinder;
234 cyl->radius.setValue(
radius);
237 SoTranslation * trans =
new SoTranslation;
238 trans->translation.setValue(0.0
f,halfLengthInner,0.0
f);
239 sep->addChild(trans);
243 SoTranslation * trans =
new SoTranslation;
244 trans->translation.setValue(0.0
f,(inner?-halfLength-halfLengthInner:-halfLength),0.0
f);
245 sep->addChild(trans);
252 SoPointSet * scatPointSet =
new SoPointSet;
253 SoVertexProperty * scatVtxProperty =
new SoVertexProperty;
256 scatVtxProperty->vertex.set1Value(
i++,0.0
f,0.0
f,halfLengthInner);
258 scatVtxProperty->vertex.set1Value(
i++,0.0
f,0.0
f,-halfLength);
259 scatPointSet->numPoints=
i;
260 scatPointSet->vertexProperty.setValue(scatVtxProperty);
284 std::cout <<
"lengthStrip==0.0, returning a point..." << std::endl;
288 SoVertexProperty * scatVtxProperty =
new SoVertexProperty();
289 scatVtxProperty->vertex.set1Value(0, 0.0
f,-
length*0.5
f,0.0
f);
290 scatVtxProperty->vertex.set1Value(1, 0.0
f,
length*0.5
f,0.0
f);
291 SoLineSet *
line =
new SoLineSet();
292 line->numVertices = 2;
293 line->vertexProperty = scatVtxProperty;
332 if (maxWidth==0.0&&
depth==0) {
334 std::cout <<
"lengthWire==0.0, returning a point..." << std::endl;
338 SoVertexProperty * scatVtxProperty =
new SoVertexProperty();
339 scatVtxProperty->vertex.set1Value(0, 0.0
f,-
length*0.5
f,0.0
f);
340 scatVtxProperty->vertex.set1Value(1, 0.0
f,
length*0.5
f,0.0
f);
341 SoLineSet *
line =
new SoLineSet();
342 line->numVertices = 2;
343 line->vertexProperty = scatVtxProperty;
378 if (maxWidth==0.0 &&
depth==0) {
380 std::cout <<
"maxWidth==0.0 && depth==0 && lengthPad==0.0, returning a point..." << std::endl;
385 SoVertexProperty * scatVtxProperty =
new SoVertexProperty();
386 scatVtxProperty->vertex.set1Value(0, 0.0
f,-
length*0.5
f,0.0
f);
387 scatVtxProperty->vertex.set1Value(1, 0.0
f,
length*0.5
f,0.0
f);
388 SoLineSet *
line =
new SoLineSet();
389 line->numVertices = 2;
390 line->vertexProperty = scatVtxProperty;
415 SoPointSet * scatPointSet =
new SoPointSet;
416 SoVertexProperty * scatVtxProperty =
new SoVertexProperty;
417 scatVtxProperty->vertex.set1Value(0,0.0
f,0.0
f,0.0
f);
418 scatPointSet->numPoints=1;
419 scatPointSet->vertexProperty.setValue(scatVtxProperty);
433 SoVertexProperty * vertices =
new SoVertexProperty;
435 vertices->vertex.set1Value(iver++,-extent,0.0,0.0);
436 vertices->vertex.set1Value(iver++,+extent,0.0,0.0);
437 vertices->vertex.set1Value(iver++,0.0,-extent,0.0);
438 vertices->vertex.set1Value(iver++,0.0,+extent,0.0);
439 vertices->vertex.set1Value(iver++,0.0,0.0,-extent);
440 vertices->vertex.set1Value(iver++,0.0,0.0,+extent);
442 SoLineSet * cross =
new SoLineSet;
443 cross->vertexProperty = vertices;
445 cross->numVertices.set1Value(numlines++,2);
446 cross->numVertices.set1Value(numlines++,2);
447 cross->numVertices.set1Value(numlines++,2);