Skip to content
Snippets Groups Projects
Commit 0b4cb511 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

ENH: Handling path drawing

parent 9725cf3e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment