Skip to content
Snippets Groups Projects
Commit 25905502 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH : change circle center representation solution

parent 517c8536
Branches
Tags
No related merge requests found
......@@ -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();
}
}
}
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment