diff --git a/Code/Visualization/otbCircleGlComponent.cxx b/Code/Visualization/otbCircleGlComponent.cxx index 822934029a5b8450e0aafdec051f0a986fb79042..32deb34895eb398125964a5aee3ad4ca393d5aa2 100644 --- a/Code/Visualization/otbCircleGlComponent.cxx +++ b/Code/Visualization/otbCircleGlComponent.cxx @@ -36,6 +36,8 @@ CircleGlComponent m_Radius = 10; // Create the tesselator m_GluTesselator = gluNewTess(); + // Center representation + m_CenterRepresentation = CROSS; } CircleGlComponent @@ -113,7 +115,7 @@ CircleGlComponent // Draw the center //glColor4d(m_ColorList[id][0],m_ColorList[id][1],m_ColorList[id][2],1) - if(m_Radius>4) + if( m_CenterRepresentation == CIRCLE && m_Radius>4 ) { glColor4d(0, 0, 0, 1); glEnable(GL_BLEND); @@ -122,6 +124,17 @@ CircleGlComponent glVertex2d(screenPoint[0],screenPoint[1]); glEnd(); } + else if( m_CenterRepresentation == CROSS ) + { + glColor4d(0, 0, 0, 1); + glBegin(GL_LINES); + // Draw a cross + glVertex2d(screenPoint[0]-m_Radius,screenPoint[1]); + glVertex2d(screenPoint[0]+m_Radius,screenPoint[1]); + glVertex2d(screenPoint[0],screenPoint[1]-m_Radius); + glVertex2d(screenPoint[0],screenPoint[1]+m_Radius); + glEnd(); + } } } diff --git a/Code/Visualization/otbCircleGlComponent.h b/Code/Visualization/otbCircleGlComponent.h index 4c2ded1e77e0648c7219819e15a6a2615c3031d8..199ffe24229d5b1a41e27dd18a40035e006687b1 100644 --- a/Code/Visualization/otbCircleGlComponent.h +++ b/Code/Visualization/otbCircleGlComponent.h @@ -69,6 +69,8 @@ public: typedef std::vector<IndexType> IndexListType; typedef std::vector<ColorType> ColorListType; + typedef enum { CIRCLE, CROSS } CenterRepresentationEnumType; + /** Runtime information */ itkTypeMacro(CircleGlComponent,GlComponent); @@ -132,6 +134,10 @@ public: itkSetMacro(Radius,double); itkGetMacro(Radius,double); + /** Set/Get the center circle radius. */ + itkSetMacro(CenterRepresentation,CenterRepresentationEnumType); + itkGetMacro(CenterRepresentation,CenterRepresentationEnumType); + protected: /** Constructor */ CircleGlComponent(); @@ -175,6 +181,9 @@ private: /** Default color : red*/ ColorType m_RedColor; + /** Center representation */ + CenterRepresentationEnumType m_CenterRepresentation; + }; // end class } // end namespace otb