diff --git a/Code/VisuRefac/otbCurves2DWidget.cxx b/Code/VisuRefac/otbCurves2DWidget.cxx index 318f5d9c153ee3e01b9d72941a99ee8c031f45b1..7fd9754287d25ec300db0679efc01fa42d91d8e3 100644 --- a/Code/VisuRefac/otbCurves2DWidget.cxx +++ b/Code/VisuRefac/otbCurves2DWidget.cxx @@ -264,7 +264,10 @@ void Curves2DWidget::RenderCurves() for(CurveListType::Iterator it = m_Curves->Begin(); it!=m_Curves->End(); ++it) { - it.Get()->Render(m_Extent,m_SpaceToScreenTransform); + if(it.Get()->GetVisible()) + { + it.Get()->Render(m_Extent,m_SpaceToScreenTransform); + } } } diff --git a/Code/VisuRefac/otbGlComponent.h b/Code/VisuRefac/otbGlComponent.h index cb01b308b87ef37037126d25498748807e62c03f..2dc765c56b7f2b3e996eaca186797134b5d9ce77 100644 --- a/Code/VisuRefac/otbGlComponent.h +++ b/Code/VisuRefac/otbGlComponent.h @@ -56,9 +56,14 @@ public: /// Render the curve according to display extent and axis characteristics virtual void Render(const RegionType& extent,const AffineTransformType * space2ScreenTransform) = 0; + /** Set/Get the visible status */ + itkSetMacro(Visible,bool); + itkGetMacro(Visible,bool); + itkBooleanMacro(Visible); + protected: /** Constructor */ - GlComponent() + GlComponent() : m_Visible(true) {} /** Destructor */ virtual ~GlComponent(){} @@ -72,6 +77,9 @@ private: GlComponent(const Self&); // purposely not implemented void operator=(const Self&); // purposely not implemented + /// Is the component visible ? + bool m_Visible; + }; // end class } // end namespace otb