MCPcopy Create free account
hub / github.com/OctoMap/octomap / drawAxis

Method drawAxis

octovis/src/SelectionBox.cpp:242–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240
241
242void SelectionBox::drawAxis(float length) const
243{
244 const float radius = length/20;
245
246 GLboolean lighting, colorMaterial;
247 glGetBooleanv(GL_LIGHTING, &lighting);
248 glGetBooleanv(GL_COLOR_MATERIAL, &colorMaterial);
249
250 glDisable(GL_COLOR_MATERIAL);
251
252 float color[4];
253 color[0] = 0.7f; color[1] = 0.7f; color[2] = 1.0f; color[3] = 1.0f;
254 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
255 QGLViewer::drawArrow(length, radius);
256
257 color[0] = 1.0f; color[1] = 0.7f; color[2] = 0.7f; color[3] = 1.0f;
258 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
259 glPushMatrix();
260 glRotatef(90.0, 0.0, 1.0, 0.0);
261 QGLViewer::drawArrow(length, radius);
262 glPopMatrix();
263
264 color[0] = 0.7f; color[1] = 1.0f; color[2] = 0.7f; color[3] = 1.0f;
265 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
266 glPushMatrix();
267 glRotatef(-90.0, 1.0, 0.0, 0.0);
268 QGLViewer::drawArrow(length, radius);
269 glPopMatrix();
270
271 if (colorMaterial)
272 glEnable(GL_COLOR_MATERIAL);
273 if (!lighting)
274 glDisable(GL_LIGHTING);
275}
276
277
278}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected