3 #include <VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.h>
5 #include <RobotAPI/interface/ArViz/Elements.h>
8 #include <Inventor/nodes/SoAsciiText.h>
9 #include <Inventor/nodes/SoCube.h>
10 #include <Inventor/nodes/SoMaterial.h>
11 #include <Inventor/nodes/SoSeparator.h>
12 #include <Inventor/nodes/SoTransform.h>
13 #include <Inventor/nodes/SoTranslation.h>
25 for (
int i = 0; i < 3; i++)
27 SoTransform* t =
new SoTransform();
28 SoMaterial* m =
new SoMaterial();
32 SoCube*
c =
new SoCube();
33 SoCube* c2 =
new SoCube();
34 SoTransform* t2 =
new SoTransform();
39 SoSeparator* tmp1 =
new SoSeparator();
45 SoSeparator* tmp2 =
new SoSeparator();
46 SoMaterial* m2 =
new SoMaterial();
47 m2->diffuseColor.setValue(1.0f, 1.0f, 1.0f);
59 SoSeparator* textSep =
new SoSeparator();
60 SoTranslation* moveT =
new SoTranslation();
61 moveT->translation.setValue(2.0f, 2.0f, 0.0f);
62 textSep->addChild(moveT);
66 node->addChild(textSep);
72 const float axisSize = 3.0f;
73 const float axisLength = 100.0f;
78 float blockSize = axisSize + 0.5f;
79 float blockWidth = 0.1f;
83 blockSize += axisSize / 10.0f;
84 blockWidth += axisSize / 10.0f;
87 float axisBlockTranslation = axisLength / numberOfBlocks;
89 for (
int i = 0; i < 3; i++)
91 SoTransform* t =
t_[i];
92 SoMaterial* m =
m_[i];
94 float translation = (axisLength / 2.0f + axisSize / 2.0f) * scaling;
97 m->diffuseColor.setValue(1.0f, 0, 0);
98 t->translation.setValue(translation, 0, 0);
102 m->diffuseColor.setValue(0, 1.0f, 0);
103 t->translation.setValue(0, translation, 0);
107 m->diffuseColor.setValue(0, 0, 1.0f);
108 t->translation.setValue(0, 0, translation);
113 SoTransform* t2 =
t2_[i];
117 c->width = axisLength * scaling;
118 c->height = axisSize * scaling;
119 c->depth = axisSize * scaling;
120 c2->width = blockWidth * scaling;
121 c2->height = blockSize * scaling;
122 c2->depth = blockSize * scaling;
123 t2->translation.setValue(axisBlockTranslation * scaling, 0, 0);
127 c->height = axisLength * scaling;
128 c->width = axisSize * scaling;
129 c->depth = axisSize * scaling;
130 c2->width = blockSize * scaling;
131 c2->height = blockWidth * scaling;
132 c2->depth = blockSize * scaling;
133 t2->translation.setValue(0, axisBlockTranslation * scaling, 0);
137 c->depth = axisLength * scaling;
138 c->height = axisSize * scaling;
139 c->width = axisSize * scaling;
140 c2->width = blockSize * scaling;
141 c2->height = blockSize * scaling;
142 c2->depth = blockWidth * scaling;
143 t2->translation.setValue(0, 0, axisBlockTranslation * scaling);
147 textNode->string.setValue(element.id.c_str());
153 std::array<SoTransform*, 3>
t_;
154 std::array<SoMaterial*, 3>
m_;
155 std::array<SoCube*, 3>
c_;
156 std::array<SoCube*, 3>
c2_;
157 std::array<SoTransform*, 3>
t2_;