Skip to content
Snippets Groups Projects
Commit 29e228e1 authored by p-kaiser's avatar p-kaiser
Browse files

PoseConstraint: Added alternative visualization in case no models are set

git-svn-id: http://svn.code.sf.net/p/simox/code/trunk@800 042f3d55-54a8-47e9-b7fb-15903f145c44
parent 2d4a13f6
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,8 @@
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoMaterial.h>
#include <Inventor/nodes/SoSphere.h>
#include <Inventor/nodes/SoTransform.h>
using namespace VirtualRobot;
......@@ -83,9 +85,22 @@ void PoseConstraint::visualize(SoSeparator *sep)
mat->setOverride(true);
s->addChild(mat);
for(auto &object : visualizationNodeSet->getSceneObjects())
if(visualizationNodeSet)
{
s->addChild(object->getVisualization<CoinVisualization>()->getCoinVisualization());
for(auto &object : visualizationNodeSet->getSceneObjects())
{
s->addChild(object->getVisualization<CoinVisualization>()->getCoinVisualization());
}
}
else
{
SoTransform *t = new SoTransform;
t->translation.setValue(target(0,3), target(1,3), target(2,3));
s->addChild(t);
SoSphere *sphere = new SoSphere;
sphere->radius = 50;
s->addChild(sphere);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment