Image Component Library (ICL)
CoordinateFrameSceneObject.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLGeom/src/ICLGeom/CoordinateFrameSceneObject.h **
10 ** Module : ICLGeom **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #ifndef ICL_HAVE_OPENGL
34  #if WIN32
35  #pragma WARNING("this header must not be included if ICL_HAVE_OPENGL is not defined")
36  #else
37  #warning "this header must not be included if ICL_HAVE_OPENGL is not defined"
38  #endif
39 #else
40 
41 #include <ICLUtils/CompatMacros.h>
42 #include <ICLGeom/SceneObject.h>
43 
44 namespace icl{
45  namespace geom{
46 
48 
53 
55  float axisLength;
56 
59 
62 
63  public:
64 
66  CoordinateFrameSceneObject(float axisLength=100,float axisThickness=5):
67  axisLength(axisLength),axisThickness(axisThickness){
68  for(int i=0;i<3;++i){
69  axis[i] = addCube(0,0,0,1);
70  axis[i]->setColor(Primitive::quad,GeomColor((i==0)*255,(i==1)*255,(i==2)*255,255));
71  }
72  setVisible(Primitive::vertex,false,true);
73  setVisible(Primitive::line,false,true);
74 
75  setParams(axisLength,axisThickness);
76  }
78  void setParams(float axisLength, float axisThickness){
79  this->axisLength = axisLength;
80  this->axisThickness = axisThickness;
81  const float &l = axisLength, t=axisThickness;
82 
83  for(int i=0;i<3;++i){
84  axis[i]->removeTransformation();
85  axis[i]->scale((i==0)*l+(i!=0)*t,
86  (i==1)*l+(i!=1)*t,
87  (i==2)*l+(i!=2)*t);
88  axis[i]->translate((i==0)*l/2,
89  (i==1)*l/2,
90  (i==2)*l/2);
91  }
92  }
93 
95  float getAxisLength() const { return axisLength; }
96 
98  float getAxisThickness() const { return axisThickness; }
99  };
100  } // namespace geom
101 }
102 
103 #endif
Definition: Primitive.h:63
undocument this line if you encounter any issues!
Definition: Any.h:37
void setParams(float axisLength, float axisThickness)
Dynamic adaption.
Definition: CoordinateFrameSceneObject.h:78
#define ICLGeom_API
Definition: CompatMacros.h:179
Definition: Primitive.h:66
CoordinateFrameSceneObject(float axisLength=100, float axisThickness=5)
Default constructor with useful default size.
Definition: CoordinateFrameSceneObject.h:66
Definition: Primitive.h:64
Special SceneObject implementation that define a visible coordinate frame.
Definition: CoordinateFrameSceneObject.h:52
core::Color4D32f GeomColor
color for geometry primitives
Definition: GeomDefs.h:45
float axisThickness
thickness of the axis'
Definition: CoordinateFrameSceneObject.h:58
axis
for flipping of images
Definition: Types.h:99
float axisLength
length for x-, y- and z-axis
Definition: CoordinateFrameSceneObject.h:55
float getAxisThickness() const
returns current thickness of the axis'
Definition: CoordinateFrameSceneObject.h:98
float getAxisLength() const
returns current length of the axis'
Definition: CoordinateFrameSceneObject.h:95
The SceneObject class defines visible objects in scenes or scene graph nodes.
Definition: SceneObject.h:140