diff --git a/Code/Visu/otbImageViewerBase.h b/Code/Visu/otbImageViewerBase.h index 857b2ba7142256b0934e4a9d9b67810fb3fc1257..462d1201405aa26d022eca609449f3604ecce6c6 100644 --- a/Code/Visu/otbImageViewerBase.h +++ b/Code/Visu/otbImageViewerBase.h @@ -27,6 +27,7 @@ PURPOSE. See the above copyright notices for more information. #include "otbStreamingShrinkImageFilter.h" #include "otbImageWidgetBoxForm.h" #include "otbImageWidgetPolygonForm.h" +#include "otbImageWidgetPolylineForm.h" #include "otbImageWidgetCircleForm.h" #include "itkListSample.h" #include "otbObjectList.h" @@ -165,6 +166,14 @@ namespace otb typedef typename ImageWidgetCircleFormType::Pointer ImageWidgetCircleFormPointerType; typedef std::map<LabelType,ColorType> ROIColorMapType; + typedef otb::PolyLineParametricPathWithValue<double,2> PathType; + typedef typename PathType::VertexListIteratorType PathIteratorType; + typedef otb::ObjectList<PathType> PathListType; + typedef typename PathListType::Pointer PathListPointerType; + typedef typename PathListType::Iterator PathListIteratorType; + typedef ImageWidgetPolylineForm<double> ImageWidgetPolylineFormType; + typedef typename ImageWidgetPolylineFormType::Pointer ImageWidgetPolylineFormPointerType; + /// Accessors itkGetMacro(Built,bool); itkGetMacro(ShrinkFactor,unsigned int); @@ -184,6 +193,8 @@ namespace otb itkGetMacro(UseScroll,bool); itkGetObjectMacro(PolygonROIList, PolygonListType); itkSetObjectMacro(PolygonROIList, PolygonListType); + itkGetObjectMacro(PathList, PathListType); + itkSetObjectMacro(PathList, PathListType); itkGetObjectMacro(InterfaceBoxesList,FormListType); itkSetObjectMacro(InterfaceBoxesList,FormListType); itkSetMacro(InterfaceBoxesColor,ColorType); @@ -473,6 +484,8 @@ namespace otb OffsetListType m_LinkedViewerOffsetList; /// PolygonList PolygonListPointerType m_PolygonROIList; + /// PathList + PathListPointerType m_PathList; /// Interface boxes FormListPointerType m_InterfaceBoxesList; /// Next ROI color diff --git a/Code/Visu/otbImageViewerBase.txx b/Code/Visu/otbImageViewerBase.txx index 18213d24361fc9c55711ed8768ff4cf831948c27..1a9723d5d55b0ee6e663069bbc3f75b29a8c35fe 100644 --- a/Code/Visu/otbImageViewerBase.txx +++ b/Code/Visu/otbImageViewerBase.txx @@ -60,6 +60,7 @@ namespace otb m_LinkedViewerList = ViewerListType::New(); m_Updating = false; m_PolygonROIList = PolygonListType::New(); + m_PathList = PathListType::New(); m_InterfaceBoxesList = FormListType::New(); m_ShowFullWidget = true; m_ShowScrollWidget = true; @@ -565,6 +566,19 @@ namespace otb new_list->PushBack(new_poly); } + for(PathListIteratorType it2 = m_PathList->Begin(); + it2!=m_PathList->End();++it2) + { + ImageWidgetPolylineFormPointerType new_line = ImageWidgetPolylineFormType::New(); + new_line->SetPolyline(it2.Get()); +// new_line->SetInternalValueToAlphaChannel(true); + + new_line->SetColor(m_DefaultROIColor); + + new_list->PushBack(new_line); + } + + if(m_UseScroll) { m_ScrollWidget->SetFormListOverlay(new_list);