Commit 8d977e77 authored by Cyrille Valladeau's avatar Cyrille Valladeau

STYLE

parent a5466b68
......@@ -193,4 +193,3 @@ ViewerController
}
} // end namespace otb
......@@ -37,34 +37,34 @@ class ITK_EXPORT ViewerController
{
public:
/** Standard class typedefs */
typedef ViewerController Self;
typedef ViewerControllerInterface Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef ViewerViewGUI ViewType;
typedef ViewType::Pointer ViewPointerType;
typedef ViewType::VisuViewType VisuViewType;
typedef ViewType::VisuViewPointerType VisuViewPointerType;
typedef ViewType::ImageWidgetPointerType VisuWidgetPointerType;
typedef ViewerController Self;
typedef ViewerControllerInterface Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef ViewerViewGUI ViewType;
typedef ViewType::Pointer ViewPointerType;
typedef ViewType::VisuViewType VisuViewType;
typedef ViewType::VisuViewPointerType VisuViewPointerType;
typedef ViewType::ImageWidgetPointerType VisuWidgetPointerType;
typedef Superclass::ImageType InputImageType;
typedef Superclass::ImagePointerType InputImagePointerType;
typedef Superclass::ImageType InputImageType;
typedef Superclass::ImagePointerType InputImagePointerType;
/** NewVisu */
typedef ModelType::VisuModelType VisuModelType; //RenderingImageLayer
typedef ModelType::VisuModelPointerType VisuModelPointerType; //RenderingImageLayer
typedef ModelType::VisuModelType VisuModelType;
typedef ModelType::VisuModelPointerType VisuModelPointerType;
typedef ObjectList<VisuControllerType> VisuControllerListType;
typedef ObjectList<VisuControllerType> VisuControllerListType;
typedef WidgetResizingActionHandler<VisuModelType, VisuViewType> ResizingHandlerType;
typedef ResizingHandlerType::Pointer ResizingHandlerPointerType;
typedef WidgetResizingActionHandler<VisuModelType, VisuViewType> ResizingHandlerType;
typedef ResizingHandlerType::Pointer ResizingHandlerPointerType;
typedef ChangeExtractRegionActionHandler<VisuModelType, VisuViewType> ChangeExtractRegionHandlerType;
typedef ChangeExtractRegionActionHandler<VisuModelType, VisuViewType> ChangeExtractRegionHandlerType;
typedef ChangeExtractRegionHandlerType::Pointer ChangeExtractRegionHandlerPointerType;
typedef AutoScaleActionHandler<ViewType::ImageWidgetType> AutoScaleHandlerType;
typedef AutoScaleHandlerType::Pointer AutoScaleHandlerPointerType;
typedef AutoScaleActionHandler<ViewType::ImageWidgetType> AutoScaleHandlerType;
typedef AutoScaleHandlerType::Pointer AutoScaleHandlerPointerType;
/** Standard type macros */
itkTypeMacro(ViewerController, Superclass);
......@@ -135,4 +135,3 @@ private:
} //end namespace otb
#endif
......@@ -32,32 +32,32 @@ class ITK_EXPORT ViewerControllerInterface
{
public:
/** Standard class typedefs */
typedef ViewerControllerInterface Self;
typedef itk::ProcessObject Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef ViewerControllerInterface Self;
typedef itk::ProcessObject Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef ViewerModel ModelType;
typedef ModelType::VisuModelType VisuModelType;
typedef ModelType::VisuModelPointerType VisuModelPointerType;
typedef ModelType::ImageType ImageType;
typedef ModelType::ImagePointerType ImagePointerType;
typedef ModelType::OffsetType OffsetType;
typedef ViewerModel ModelType;
typedef ModelType::VisuModelType VisuModelType;
typedef ModelType::VisuModelPointerType VisuModelPointerType;
typedef ModelType::ImageType ImageType;
typedef ModelType::ImagePointerType ImagePointerType;
typedef ModelType::OffsetType OffsetType;
/** NewVisu */
typedef ImageWidgetController VisuControllerType;
typedef VisuControllerType::Pointer VisuControllerPointerType;
typedef ImageWidgetController VisuControllerType;
typedef VisuControllerType::Pointer VisuControllerPointerType;
typedef ObjectList<VisuControllerType> VisuControllerListType;
typedef VisuControllerListType::Pointer VisuControllerListPointerType;
typedef ObjectList<VisuControllerType> VisuControllerListType;
typedef VisuControllerListType::Pointer VisuControllerListPointerType;
typedef ImageWidgetController WidgetControllerType;
typedef WidgetControllerType::Pointer WidgetControllerPointerType;
typedef ImageWidgetController WidgetControllerType;
typedef WidgetControllerType::Pointer WidgetControllerPointerType;
typedef ImageWidget<> WidgetType;
typedef WidgetType::Pointer VisuWidgetPointerType;
typedef ImageWidget<> WidgetType;
typedef WidgetType::Pointer VisuWidgetPointerType;
/** Standard type macros */
itkTypeMacro(ViewerControllerInterface, Superclass);
......
......@@ -114,7 +114,9 @@ ViewerModel
void
ViewerModel
::GetJPEG2000ResolutionAndInformations(const std::string & filepath, std::vector<unsigned int>& res, std::vector<std::string> & desc)
::GetJPEG2000ResolutionAndInformations(const std::string & filepath,
std::vector<unsigned int>& res,
std::vector<std::string> & desc)
{
#ifdef OTB_USE_JPEG2000
if( !this->IsJPEG2000File(filepath) )
......@@ -185,7 +187,7 @@ ViewerModel
reader->GetOutput()->GetLargestPossibleRegion().GetSize()[1] );
if( maxSize > 512 )
{
shrinkFactor = static_cast<unsigned int>( vcl_floor( static_cast<double>(maxSize)/static_cast<double>(256) + 0.5) );
shrinkFactor = static_cast<unsigned int>( vcl_floor( static_cast<double>(maxSize)/256. + 0.5) );
}
shrinker->SetShrinkFactor(shrinkFactor);
......@@ -371,7 +373,9 @@ ViewerModel
ViewerModel
::WidgetControllerPointerType
ViewerModel
::BuiltController(VisuModelPointerType modelRenderingLayer, VisuViewPointerType visuView, PixelDescriptionModelPointerType pixelModel)
::BuiltController(VisuModelPointerType modelRenderingLayer,
VisuViewPointerType visuView,
PixelDescriptionModelPointerType pixelModel)
{
WidgetControllerPointerType controller = WidgetControllerType::New();
......@@ -384,7 +388,7 @@ ViewerModel
// Add the change scaled region handler
ChangeScaledRegionHandlerType::Pointer changeScaledHandler =ChangeScaledRegionHandlerType::New();
changeScaledHandler->SetModel(modelRenderingLayer);
changeScaledHandler->SetView(visuView);
changeScaledHandler->SetView(visuView);
controller->AddActionHandler(changeScaledHandler);
// Add the change extract region handler
......@@ -562,52 +566,6 @@ ViewerModel
PixelDescriptionModelPointerType rightPixelModel = m_ObjectTrackedList.at(rightChoice-1).pPixelModel;
PixelDescriptionModelPointerType leftPixelModel = m_ObjectTrackedList.at(leftChoice-1).pPixelModel;
/*
pLeftVisuView->GetScrollWidget()->SetIdentifier("Scroll_l");
pLeftVisuView->GetFullWidget()->SetIdentifier("Full_l");
pLeftVisuView->GetZoomWidget()->SetIdentifier("Zoom_l");
pRightVisuView->GetScrollWidget()->SetIdentifier("Scroll_r");
pRightVisuView->GetFullWidget()->SetIdentifier("Full_r");
pRightVisuView->GetZoomWidget()->SetIdentifier("Zoom_r");
leftController->RemoveActionHandler(3);
rightController->RemoveActionHandler(3);
// Add the change scaled handler
ChangeScaleHandlerType::Pointer rightChangeScaleHandler =ChangeScaleHandlerType::New();
rightChangeScaleHandler->SetModel(rightRenderModel );
rightChangeScaleHandler->SetView(pLeftVisuView);
rightChangeScaleHandler->SetView2(pRightVisuView);
ChangeScaleHandlerType::Pointer leftChangeScaleHandler =ChangeScaleHandlerType::New();
leftChangeScaleHandler->SetModel(leftRenderModel );
leftChangeScaleHandler->SetView(pRightVisuView);
leftChangeScaleHandler->SetView2(pLeftVisuView);
rightController->AddActionHandler( leftChangeScaleHandler);
leftController->AddActionHandler(rightChangeScaleHandler);
// Add the change scaled handler
ChangeScaleHandlerType::Pointer rChangeScaleHandler =ChangeScaleHandlerType::New();
rChangeScaleHandler->SetModel(leftRenderModel );
rChangeScaleHandler->SetView(pLeftVisuView);
ChangeScaleHandlerType::Pointer lChangeScaleHandler =ChangeScaleHandlerType::New();
lChangeScaleHandler->SetModel(rightRenderModel );
lChangeScaleHandler->SetView(pRightVisuView);
rightController->AddActionHandler( lChangeScaleHandler);
leftController->AddActionHandler(rChangeScaleHandler);
*/
// Add the resizing handler
ResizingHandlerType::Pointer rightResizingHandler = ResizingHandlerType::New();
rightResizingHandler->SetModel(rightRenderModel);
......@@ -676,9 +634,8 @@ ViewerModel
leftPixelActionHandler->SetModel(leftPixelModel);
leftPixelActionHandler->SetOffset(offset);
//rightController->AddActionHandler(leftPixelActionHandler );
//leftController->AddActionHandler(rightPixelActionHandler);
rightController->AddActionHandler(leftPixelActionHandler );
leftController->AddActionHandler(rightPixelActionHandler);
}
/**
......@@ -688,14 +645,13 @@ void
ViewerModel
::InitializeImageViewController(unsigned int selectedItem)
{
VisuModelPointerType render = m_ObjectTrackedList.at(selectedItem-1).pRendering;
VisuViewPointerType view = m_ObjectTrackedList.at(selectedItem-1).pVisuView;
PixelDescriptionModelPointerType pixelModel = m_ObjectTrackedList.at(selectedItem-1).pPixelModel;
_ObjectsTracked & objTracked = m_ObjectTrackedList.at(selectedItem-1);
VisuModelPointerType render = objTracked.pRendering;
VisuViewPointerType view = objTracked.pVisuView;
PixelDescriptionModelPointerType pixelModel = objTracked.pPixelModel;
m_ObjectTrackedList.at(selectedItem-1).pWidgetController = this->BuiltController(render, view, pixelModel);
m_ObjectTrackedList.at(selectedItem-1).pVisuView->SetController(m_ObjectTrackedList.at(selectedItem-1).pWidgetController);
objTracked.pWidgetController = this->BuiltController(render, view, pixelModel);
view->SetController(m_ObjectTrackedList.at(selectedItem-1).pWidgetController);
}
}
......@@ -82,9 +82,9 @@ public:
/** typedef support for layers */
typedef ImageLayer<ImageType, ViewerImageType> LayerType;
typedef LayerType::Pointer LayerPointerType;
typedef LayerType::Pointer LayerPointerType;
typedef ImageLayerGenerator<LayerType> LayerGeneratorType;
typedef ImageLayerGenerator<LayerType> LayerGeneratorType;
typedef LayerGeneratorType::Pointer LayerGeneratorPointerType;
typedef LayerGeneratorType::RenderingFunctionType RenderingFunctionType;
typedef Function::StandardRenderingFunction<ImageType::PixelType, RGBPixelType> StandardRenderingFunctionType;
......@@ -142,13 +142,13 @@ public:
std::string pFileName;
};
typedef struct _ObjectsTracked ObjectsTracked;
typedef struct _ObjectsTracked ObjectsTracked;
/**
* List of objectTracked, we cannot use ObjectList
* for struct cause don't implenement Register method
*/
typedef std::vector<ObjectsTracked> ObjectTrackedList;
typedef std::vector<ObjectsTracked> ObjectTrackedList;
/** Get the unique instanc1e of the model */
static Pointer GetInstance();
......@@ -164,11 +164,12 @@ public:
virtual void InitializeImageViewController(unsigned int selectedItem);
/** Method needed to Get the list of componenets stored*/
ObjectTrackedList GetObjectList()
const ObjectTrackedList & GetObjectList() const
{
return m_ObjectTrackedList;
}
/** Boolean Flags */
itkGetMacro(HasImageOpened, bool);
itkGetMacro(HasChangedChannelOrder, bool);
......@@ -180,7 +181,9 @@ public:
std::vector<unsigned int> GetJPEG2000Resolution(const std::string & filepath);
// If the file is JPEG2000, the function will find the available
// resolutions and informations
void GetJPEG2000ResolutionAndInformations(const std::string & filepath, std::vector<unsigned int>& res, std::vector<std::string> & desc);
void GetJPEG2000ResolutionAndInformations(const std::string & filepath,
std::vector<unsigned int>& res,
std::vector<std::string> & desc);
protected:
/** This is protected for the singleton. Use GetInstance() instead. */
......@@ -194,7 +197,9 @@ protected:
/** Built Visu & Controller*/
virtual VisuViewPointerType BuiltVisu(VisuModelPointerType pRendering);
virtual WidgetControllerPointerType BuiltController(VisuModelPointerType modelRenderingLayer, VisuViewPointerType visuView , PixelDescriptionModelType::Pointer pixelModel);
virtual WidgetControllerPointerType BuiltController(VisuModelPointerType modelRenderingLayer,
VisuViewPointerType visuView ,
PixelDescriptionModelType::Pointer pixelModel);
private:
ViewerModel(const Self&); //purposely not implemented
......@@ -217,4 +222,3 @@ private:
}
#endif
......@@ -35,10 +35,10 @@ class AutoScaleActionHandler
{
public:
/** Standard class typedefs */
typedef AutoScaleActionHandler Self;
typedef ImageWidgetActionHandler Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef AutoScaleActionHandler Self;
typedef ImageWidgetActionHandler Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory */
itkNewMacro(Self);
......@@ -47,8 +47,8 @@ public:
itkTypeMacro(AutoScaleActionHandler, ImageWidgetActionHandler);
/** Preview Typedef typedefs */
typedef TWidgetType WidgetType;
typedef typename WidgetType::Pointer WidgetPointerType;
typedef TWidgetType WidgetType;
typedef typename WidgetType::Pointer WidgetPointerType;
/** Handle widget resizing
* \param widgetId The id of the resized widget
......@@ -99,5 +99,3 @@ private:
}; // end class
} // end namespace otb
#endif
......@@ -27,14 +27,13 @@ namespace otb
ViewerViewGUI
::ViewerViewGUI():m_TemplateViewerName(""), m_DisplayedLabel("+ "),
m_UndisplayedLabel("- "), m_DiaporamaCurrentIndex(0)
m_UndisplayedLabel("- "), m_DiaporamaCurrentIndex(0)
{
m_VisuView = VisuViewType::New();
m_PreviewWidget = ImageWidgetType::New();
m_pRenderingFunction = StandardRenderingFunctionType::New();
m_WidgetManagerList = WidgetManagerList::New();
m_LinkWidgetManagerList = WidgetManagerList::New();
m_VisuView = VisuViewType::New();
m_PreviewWidget = ImageWidgetType::New();
m_WidgetManagerList = WidgetManagerList::New();
m_LinkWidgetManagerList = WidgetManagerList::New();
//Get an instance of the model
m_ViewerModel = ViewerModel::GetInstance();
......@@ -274,9 +273,9 @@ ViewerViewGUI
//Link when all images are closed
if(guiLinkSetupWindow->shown() != 0)
if(guiImageList->size() == 0)
this->LinkSetupOk();
if(guiImageList->size() == 0)
this->LinkSetupOk();
//Erase from the lists
m_DisplayStatusList.erase( m_DisplayStatusList.begin()+(selectedItem-1));
m_LinkedDisplayStatusList.erase( m_LinkedDisplayStatusList.begin()+(selectedItem-1));
......@@ -301,16 +300,19 @@ ViewerViewGUI
{
//if the closed image is the first one : show the next one
this->UpdateDiaporamaProgressBar();
++m_DiaporamaCurrentIndex; //Increment to show the next image
//Increment to show the next image
++m_DiaporamaCurrentIndex;
this->DisplayDiaporama();
--m_DiaporamaCurrentIndex; //Decrement because we remove the first image, so the current display become the first
//Decrement because we remove the first image, so the current display become the first
--m_DiaporamaCurrentIndex;
}
}
else
{
if(selectedItem < m_DiaporamaCurrentIndex+1)
{
--m_DiaporamaCurrentIndex; //Increment the current index because an image before the one displayed is removed
//Increment the current index because an image before the one displayed is removed
--m_DiaporamaCurrentIndex;
}
this->UpdateDiaporamaProgressBar();
}
......@@ -323,7 +325,8 @@ ViewerViewGUI
if(m_DisplayStatusList.size() == 0)
{
m_DiaporamaCurrentIndex=0;
this->DiaporamaQuit(); //If no image to display anymore : quit the diaporamaGUI
//If no image to display anymore : quit the diaporamaGUI
this->DiaporamaQuit();
}
}
......@@ -484,12 +487,13 @@ ViewerViewGUI
ViewerViewGUI
::Display(WidgetManagerList::Pointer widgetList, unsigned int selectedItem)
{
const ObjectsTrackedType & objTracked = m_ViewerModel->GetObjectList().at(selectedItem-1);
//Get the view stored in the model
CurvesWidgetType::Pointer curveWidget = m_ViewerModel->GetObjectList().at(selectedItem-1).pCurveWidget;
VisuViewPointerType currentVisuView = m_ViewerModel->GetObjectList().at(selectedItem-1).pVisuView;
CurvesWidgetType::Pointer curveWidget = objTracked.pCurveWidget;
VisuViewPointerType currentVisuView = objTracked.pVisuView;
//First get the histogram list
RenderingFunctionType::Pointer pRenderingFunction = m_ViewerModel->GetObjectList().at(selectedItem-1).pRenderFunction;
RenderingFunctionType::Pointer pRenderingFunction = objTracked.pRenderFunction;
curveWidget->ClearAllCurves();
......@@ -499,7 +503,7 @@ ViewerViewGUI
HistogramCurveType::Pointer bhistogram = HistogramCurveType::New();
bhistogram->SetHistogramColor(m_Blue);
bhistogram->SetLabelColor(m_Blue);
bhistogram->SetHistogram(m_ViewerModel->GetObjectList().at(selectedItem-1).pLayer->GetHistogramList()->GetNthElement(2));
bhistogram->SetHistogram(objTracked.pLayer->GetHistogramList()->GetNthElement(2));
curveWidget->AddCurve(bhistogram);
}
......@@ -508,7 +512,7 @@ ViewerViewGUI
HistogramCurveType::Pointer ghistogram = HistogramCurveType::New();
ghistogram->SetHistogramColor(m_Green);
ghistogram->SetLabelColor(m_Green);
ghistogram->SetHistogram(m_ViewerModel->GetObjectList().at(selectedItem-1).pLayer->GetHistogramList()->GetNthElement(1));
ghistogram->SetHistogram(objTracked.pLayer->GetHistogramList()->GetNthElement(1));
curveWidget->AddCurve(ghistogram);
}
......@@ -523,15 +527,14 @@ ViewerViewGUI
rhistogram->SetHistogramColor(m_Red);
rhistogram->SetLabelColor(m_Red);
}
rhistogram->SetHistogram(m_ViewerModel->GetObjectList().at(selectedItem-1).pLayer->GetHistogramList()->GetNthElement(0));
rhistogram->SetHistogram(objTracked.pLayer->GetHistogramList()->GetNthElement(0));
curveWidget->AddCurve(rhistogram);
curveWidget->SetXAxisLabel("Pixels");
curveWidget->SetYAxisLabel("Frequency");
//Get the pixelView
PixelDescriptionViewType::Pointer pixelView = m_ViewerModel->GetObjectList().at(selectedItem-1).pPixelView;
PixelDescriptionViewType::Pointer pixelView = objTracked.pPixelView;
widgetList->GetNthElement(selectedItem-1)->RegisterFullWidget(currentVisuView->GetFullWidget());
widgetList->GetNthElement(selectedItem-1)->RegisterScrollWidget(currentVisuView->GetScrollWidget());
......@@ -758,7 +761,8 @@ ViewerViewGUI
{
itk::OStringStream oss;
oss.str("");
std::string selectedImageName = m_ViewerModel->GetObjectList().at(selectedItem-1).pFileName;
const ObjectsTrackedType & objTracked = m_ViewerModel->GetObjectList().at(selectedItem-1);
std::string selectedImageName = objTracked.pFileName;
// Clear the info buffer
guiViewerInformation->buffer()->remove(0, guiViewerInformation->buffer()->length());
oss<<"Filename: "<<selectedImageName<<std::endl;
......@@ -767,20 +771,20 @@ ViewerViewGUI
oss<<"Image information:"<<std::endl;
guiViewerInformation->insert(oss.str().c_str());
oss.str("");
oss<<"Number of bands: "<<m_ViewerModel->GetObjectList().at(selectedItem-1).pReader->GetOutput()->GetNumberOfComponentsPerPixel();
oss<<" - Size: "<<m_ViewerModel->GetObjectList().at(selectedItem-1).pReader->GetOutput()->GetLargestPossibleRegion().GetSize()<<std::endl;
oss<<"Number of bands: "<<objTracked.pReader->GetOutput()->GetNumberOfComponentsPerPixel();
oss<<" - Size: "<<objTracked.pReader->GetOutput()->GetLargestPossibleRegion().GetSize()<<std::endl;
guiViewerInformation->insert(oss.str().c_str());
oss.str("");
//update band information
if(m_ViewerModel->GetObjectList().at(selectedItem-1).pReader->GetOutput()->GetNumberOfComponentsPerPixel()>=3)
if(objTracked.pReader->GetOutput()->GetNumberOfComponentsPerPixel()>=3)
{
//FIXME why this is not using the Describe method of the rendering function?
// oss<<"RGB Composition: ";
// oss<<" Band 1: "<<m_ViewerModel->GetObjectList().at(selectedItem-1).pRenderFunction->GetRedChannelIndex();
// oss<<" Band 2: "<<m_ViewerModel->GetObjectList().at(selectedItem-1).pRenderFunction->GetGreenChannelIndex();
// oss<<" Band 3: "<<m_ViewerModel->GetObjectList().at(selectedItem-1).pRenderFunction->GetBlueChannelIndex()<<std::endl;
// oss<<"RGB Composition: ";
// oss<<" Band 1: "<<m_ViewerModel->GetObjectList().at(selectedItem-1).pRenderFunction->GetRedChannelIndex();
// oss<<" Band 2: "<<m_ViewerModel->GetObjectList().at(selectedItem-1).pRenderFunction->GetGreenChannelIndex();
// oss<<" Band 3: "<<m_ViewerModel->GetObjectList().at(selectedItem-1).pRenderFunction->GetBlueChannelIndex()<<std::endl;
}
guiViewerInformation->insert(oss.str().c_str());
......@@ -1034,7 +1038,7 @@ void
ViewerViewGUI
::Diaporama()
{
if (guiImageList->size() == 0 || guiDiaporama->shown())
if (guiImageList->size() == 0 || guiDiaporama->shown())
{
// no image selected, return
return;
......@@ -1063,7 +1067,7 @@ ViewerViewGUI
::CutFileName(unsigned int selectedItem)
{
std::string fileName = m_ViewerModel->GetObjectList().at(selectedItem).pFileName;
int slashIndex = fileName.find_last_of("/", fileName.size());
int slashIndex = fileName.find_last_of("/", fileName.size());
std::string fileNameCut = fileName.substr(slashIndex+1, fileName.size());
return fileNameCut.c_str();
......@@ -1073,21 +1077,22 @@ void
ViewerViewGUI
::DisplayDiaporama()
{
const ObjectsTrackedType & objTracked = m_ViewerModel->GetObjectList().at(m_DiaporamaCurrentIndex);
//Get the view stored in the model
CurvesWidgetType::Pointer curveWidget = m_ViewerModel->GetObjectList().at(m_DiaporamaCurrentIndex).pCurveWidget;
VisuViewPointerType currentVisuView = m_ViewerModel->GetObjectList().at(m_DiaporamaCurrentIndex).pVisuView;
CurvesWidgetType::Pointer curveWidget = objTracked.pCurveWidget;
VisuViewPointerType currentVisuView = objTracked.pVisuView;
//First get the histogram list
RenderingFunctionType::Pointer pRenderingFunction = m_ViewerModel->GetObjectList().at(m_DiaporamaCurrentIndex).pRenderFunction;
RenderingFunctionType::Pointer pRenderingFunction = objTracked.pRenderFunction;
HistogramCurveType::Pointer rhistogram = HistogramCurveType::New();
HistogramCurveType::Pointer ghistogram = HistogramCurveType::New();
HistogramCurveType::Pointer bhistogram = HistogramCurveType::New();
//Color Definition
HistogramCurveType::ColorType Red;
HistogramCurveType::ColorType Green;
HistogramCurveType::ColorType Blue;
HistogramCurveType::ColorType Red;
HistogramCurveType::ColorType Green;
HistogramCurveType::ColorType Blue;
Red.Fill(0);
Green.Fill(0);
Blue.Fill(0);
......@@ -1102,7 +1107,7 @@ ViewerViewGUI
rhistogram->SetHistogramColor(Red);
rhistogram->SetLabelColor(Red);
const unsigned int nbBands = m_ViewerModel->GetObjectList().at(m_DiaporamaCurrentIndex).pLayer->GetHistogramList()->Size();
const unsigned int nbBands = objTracked.pLayer->GetHistogramList()->Size();
curveWidget->ClearAllCurves();
......@@ -1113,19 +1118,19 @@ ViewerViewGUI
if( nbBands >= 1 )
{
rhistogram->SetHistogram(m_ViewerModel->GetObjectList().at(m_DiaporamaCurrentIndex).pLayer->GetHistogramList()->GetNthElement(0));
rhistogram->SetHistogram(objTracked.pLayer->GetHistogramList()->GetNthElement(0));
curveWidget->AddCurve(rhistogram);
}
if( nbBands >= 2 )
{
ghistogram->SetHistogram(m_ViewerModel->GetObjectList().at(m_DiaporamaCurrentIndex).pLayer->GetHistogramList()->GetNthElement(1));
ghistogram->SetHistogram(objTracked.pLayer->GetHistogramList()->GetNthElement(1));
curveWidget->AddCurve(ghistogram);
}
if( nbBands >= 3 )
{
bhistogram->SetHistogram(m_ViewerModel->GetObjectList().at(m_DiaporamaCurrentIndex).pLayer->GetHistogramList()->GetNthElement(2));
bhistogram->SetHistogram(objTracked.pLayer->GetHistogramList()->GetNthElement(2));
curveWidget->AddCurve(bhistogram);
}
......@@ -1133,7 +1138,7 @@ ViewerViewGUI
curveWidget->SetYAxisLabel("Frequency");
//Get the pixelView
PixelDescriptionViewType::Pointer pixelView = m_ViewerModel->GetObjectList().at(m_DiaporamaCurrentIndex).pPixelView;
PixelDescriptionViewType::Pointer pixelView = objTracked.pPixelView;
//Edit the Widget
m_Widget->UnRegisterAll();
......@@ -1353,8 +1358,9 @@ ViewerViewGUI
unsigned counter = 0;
for(unsigned int p = 0; p < tempElementToRemove.size(); p ++ )
{
m_LinkedImageList.erase(m_LinkedImageList.begin()+tempElementToRemove[p] - counter); // counter because the size of the list is decreasing after each iteration
counter++;
// counter because the size of the list is decreasing after each iteration
m_LinkedImageList.erase(m_LinkedImageList.begin()+tempElementToRemove[p] - counter);
counter++;
}
m_LinkedImageList.clear();
......@@ -1371,4 +1377,3 @@ ViewerViewGUI
Superclass::PrintSelf(os, indent);