diff --git a/ViewerManager/Controller/otbImageViewerManagerController.cxx b/ViewerManager/Controller/otbImageViewerManagerController.cxx index 84d62e368bafd21664824c401f5ae6ed75480cfc..323d11f049b940d51308a0b3ecfbf33ade277785 100644 --- a/ViewerManager/Controller/otbImageViewerManagerController.cxx +++ b/ViewerManager/Controller/otbImageViewerManagerController.cxx @@ -142,5 +142,20 @@ ImageViewerManagerController } } +void +ImageViewerManagerController +::UdapteImageViewController(unsigned int selectedItem) +{ + try + { + m_Model->InitializeImageViewController(selectedItem); + } + catch (itk::ExceptionObject & err) + { + MsgReporter::GetInstance()->SendError(err.GetDescription()); + } +} + + } // end namespace otb diff --git a/ViewerManager/Controller/otbImageViewerManagerController.h b/ViewerManager/Controller/otbImageViewerManagerController.h index e8e400c54b40dc105648e0f6daa61db8443acd14..e26ba5b53512b26d58f5f14c241dc83615adbdf8 100644 --- a/ViewerManager/Controller/otbImageViewerManagerController.h +++ b/ViewerManager/Controller/otbImageViewerManagerController.h @@ -107,21 +107,7 @@ public: virtual void UpdateModulusChannelOrder(int realChoice , int imChoice ,unsigned int selectedItem ); virtual void UpdatePhaseChannelOrder(int realChoice , int imChoice, unsigned int selectedItem); virtual void Link(unsigned int leftChoice, unsigned int rightChoice , OffsetType offset); - - - -/* virtual void SaveOutput(); */ -/* virtual void ResetModel(); */ -/* virtual void ClearFeatures(); */ -/* virtual void CreateFeature(FeatureType featureType); */ -/* virtual void ClearSelectedChannels(); */ -/* virtual void SetOutputFileName( const char * name ); */ -/* virtual void AddInputChannels(std::vector<unsigned int> list); */ -/* virtual void ChangeFilterStatus(int id); */ -/* virtual void ViewedRegionChanged(); */ -/* virtual void PixelClicked(const IndexType & index); */ -/* virtual void AddToOutputListOrder(int id); */ -/* virtual void RemoveFromOutputListOrder(int id); */ + virtual void UdapteImageViewController(unsigned int selectedItem); protected: diff --git a/ViewerManager/Controller/otbImageViewerManagerControllerInterface.h b/ViewerManager/Controller/otbImageViewerManagerControllerInterface.h index 920385de97add43e819305497e4b983c1e41c7f8..cbd37d9eaa5c6aec0761dd5b5babe5d0cf5a0d3f 100644 --- a/ViewerManager/Controller/otbImageViewerManagerControllerInterface.h +++ b/ViewerManager/Controller/otbImageViewerManagerControllerInterface.h @@ -75,6 +75,7 @@ public: virtual void UpdateModulusChannelOrder(int realChoice , int imChoice,unsigned int selectedItem) = 0; virtual void UpdatePhaseChannelOrder(int realChoice , int imChoice, unsigned int selectedItem) = 0; virtual void Link(unsigned int leftChoice, unsigned int rightChoice , OffsetType offset) = 0; + virtual void UdapteImageViewController(unsigned int selectedItem) = 0; /** NewVisu */ virtual VisuControllerPointerType GetVisuController()=0; virtual VisuControllerPointerType GetPreviewVisuController() = 0; diff --git a/ViewerManager/Model/otbImageViewerManagerModel.cxx b/ViewerManager/Model/otbImageViewerManagerModel.cxx index b890804293a95617cd91b862278ced8210774737..59cbc07509e681b6d05c524ed3e57f2d01f10ba9 100644 --- a/ViewerManager/Model/otbImageViewerManagerModel.cxx +++ b/ViewerManager/Model/otbImageViewerManagerModel.cxx @@ -123,6 +123,7 @@ ImageViewerManagerModel m_HasImageOpened = false; } + /** * Built a part of the visu, create a pointer and add a model to the visu */ @@ -358,6 +359,21 @@ ImageViewerManagerModel } +/** + * + */ +void +ImageViewerManagerModel +::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; + + m_ObjectTrackedList.at(selectedItem-1).pWidgetController = this->BuiltController(render,view,pixelModel); + m_ObjectTrackedList.at(selectedItem-1).pVisuView->SetController(m_ObjectTrackedList.at(selectedItem-1).pWidgetController); +} + } diff --git a/ViewerManager/Model/otbImageViewerManagerModel.h b/ViewerManager/Model/otbImageViewerManagerModel.h index 92462cc30de6acecd80d5c89e99644ba7d5dde07..ff4f1027754053728f1e46980d99a897cfb66869 100644 --- a/ViewerManager/Model/otbImageViewerManagerModel.h +++ b/ViewerManager/Model/otbImageViewerManagerModel.h @@ -155,6 +155,7 @@ public: virtual void UpdateModulusChannelOrder(int realChoice , int imChoice,unsigned int selectedItem ); virtual void UpdatePhaseChannelOrder(int realChoice , int imChoice,unsigned int selectedItem ); virtual void Link(unsigned int leftChoice, unsigned int rightChoice, OffsetType offset); + virtual void InitializeImageViewController(unsigned int selectedItem); /** Method needed to Get the list of componenets stored*/ ObjectTrackedList GetObjectList()