238{
240
241
242
243
244 if (addTransform){
246 errDetailed->addChild( t1 );
247 errSimple->addChild( t1 );
248 }
249
250 const double sqrtv0 = sqrt( tmpcovmat(0,0) );
251 double sqrtv1=0.0;
252 if (!force1D){
253 sqrtv1 = sqrt( tmpcovmat(1,1) );
254 } else {
255 sqrtv1=100;
256 }
257
258
259
260
261
262
263
265 const double rp =
radius + sigmaScale * sqrtv0;
266 const double rm =
radius - sigmaScale * sqrtv0;
267
268
269 SoTranslation *
t0 =
new SoTranslation;
271
272
273 SoSeparator * circleGrp = new SoSeparator;
274 circleGrp->addChild(
t0);
275
276 SoSeparator * circleGrpSimple = new SoSeparator;
277 circleGrpSimple->addChild(
t0);
278
279 SoVertexProperty *vertices = new SoVertexProperty();
280 double zz[3];
281 int Nzz;
282 if ( drawZErrCircles )
283 {
284 Nzz = 3;
285 zz[0] = -sigmaScale * sqrtv1;
286 zz[1] = 0.0;
287 zz[2] = +sigmaScale * sqrtv1;
288 } else
289 {
290 Nzz = 1;
291 zz[0] = 0.0;
292 }
293
295 int Nrr;
296 if ( rm > 0 )
297 {
298 Nrr = 2;
301 } else
302 {
303 Nrr = 1;
305 }
306
307 SoLineSet * circles = new SoLineSet();
308 SoLineSet * circlesSimple = new SoLineSet();
309 int iver(0);
310 int numlines(0);
311 int numlinesSimple(0);
312 for (
int k = 0;
k<Nrr;
k++)
313 {
314 for (int j = 0; j<Nzz; j++)
315 {
316 vertices->vertex.set1Value(iver++,
rr[k],0.0,zz[j]);
317 for (
int i = 1;
i < numNodes;
i++)
318 {
319 vertices->vertex.set1Value(iver++,
320 cos(2.0*
static_cast<double>(i)*
M_PI/
static_cast<double>(numNodes))*
rr[k],
321 sin(2.0*
static_cast<double>(i)*
M_PI/
static_cast<double>(numNodes))*
rr[k],
322 zz[j]);
323 }
324 vertices->vertex.set1Value(iver++,
rr[k],0.0,zz[j]);
325
326 circles->numVertices.set1Value(numlines++,numNodes+1);
327
328 if (k==0)
329 {
330 circlesSimple->numVertices.set1Value(numlinesSimple++,numNodes+1);
331 }
332 }
333 }
334 circles->vertexProperty = vertices;
335 circleGrp->addChild( circles );
336
337 circlesSimple->vertexProperty = vertices;
338 circleGrpSimple->addChild( circlesSimple );
339
340 errDetailed->addChild( circleGrp );
341 errSimple->addChild( circleGrpSimple );
342
343
344 if (drawCylinder)
345 {
346 SoCylinder * outerCyl = new SoCylinder;
347 outerCyl->removePart( SoCylinder::TOP );
348 outerCyl->removePart( SoCylinder::BOTTOM );
349 outerCyl->radius.setValue (
rp );
350 outerCyl->height.setValue ( 2.0 * sigmaScale * sqrtv1 );
351
352 SoSeparator * cylGrp = new SoSeparator;
353 cylGrp->addChild(
t0);
354
355 SoGroup * outCylGrp = new SoGroup;
356 SoRotationXYZ * outCylRot = new SoRotationXYZ;
357 outCylRot->axis = SoRotationXYZ::X;
358 outCylRot->angle = M_PI_2;
359 outCylGrp->addChild(outCylRot);
360 outCylGrp->addChild(outerCyl);
361 cylGrp->addChild(outCylGrp);
362
364 SoTransparency * trans = new SoTransparency;
365 errDetailed->addChild( trans );
366 errDetailed->addChild( cylGrp );
367 }
368
369 return;
370}
const boost::regex rr(r_r)