From: caballero Date: Mon, 23 Mar 2009 10:37:06 +0000 (+0000) Subject: Cleaned the viewer and deactivated color function X-Git-Tag: EED.02Oct2009~133 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=88745f8677503fa747963f8cd78c52f4b3deb35e;p=creaImageIO.git Cleaned the viewer and deactivated color function --- diff --git a/src2/creaImageIOWxTreeView.cpp b/src2/creaImageIOWxTreeView.cpp index 1d5663f..3a24eb4 100644 --- a/src2/creaImageIOWxTreeView.cpp +++ b/src2/creaImageIOWxTreeView.cpp @@ -306,9 +306,7 @@ namespace creaImageIO <<"'"<LoadChildren(*i,1); @@ -342,37 +340,7 @@ namespace creaImageIO int n= GetTreeHandler()->GetNumberOfChildren(*j); oss << n; std::string s(oss.str()); - item.SetText( crea::std2wx(s)); - - //Setting the color according to the parent - if(l==0) - { - item.SetBackgroundColour - (wxColourDatabase().Find - (crea::std2wx(mColorPalette[colorId]))); - mColorMap.insert - (NodeColorPair - (*j,wxColourDatabase().Find - (crea::std2wx(mColorPalette[colorId])))); - if(colorId<64) - { - colorId++; - } - else - { - colorId=0; - } - } - else if(l!=mLevelList.size()-1) - { - item.SetBackgroundColour(mColorMap[*i]); - mColorMap.insert(NodeColorPair(*j,mColorMap[*i])); - } - else - { - item.SetBackgroundColour(mColorMap[*i]); - } - + item.SetText( crea::std2wx(s)); item.SetColumn(0); GetCtrl(l)->SetItem(item); @@ -749,6 +717,40 @@ namespace creaImageIO } } + //================================================================ + void WxTreeView::SetColor(int l) + { + /* + int colorId=0; + //Setting the color according to the parent + if(l==0) + { + item.SetBackgroundColour + (wxColourDatabase().Find + (crea::std2wx(mColorPalette[colorId]))); + mColorMap.insert + (NodeColorPair + (*j,wxColourDatabase().Find + (crea::std2wx(mColorPalette[colorId])))); + if(colorId<64) + { + colorId++; + } + else + { + colorId=0; + } + } + else if(l!=mLevelList.size()-1) + { + item.SetBackgroundColour(mColorMap[*i]); + mColorMap.insert(NodeColorPair(*j,mColorMap[*i])); + } + else + { + item.SetBackgroundColour(mColorMap[*i]); + }*/ + } //================================================================ void WxTreeView::CreateColorPalette() { diff --git a/src2/creaImageIOWxTreeView.h b/src2/creaImageIOWxTreeView.h index 2332533..a1d5ed6 100644 --- a/src2/creaImageIOWxTreeView.h +++ b/src2/creaImageIOWxTreeView.h @@ -79,6 +79,8 @@ namespace creaImageIO /// Updates the view of a level given the selected items of upper level /// Recursive method virtual void RecursiveUpdateLevel( int ); + ///Sets the color of a selected item + void SetColor(int level); ///Creates the color palette for the first level void CreateColorPalette(); ///Selects the lowest level (images) diff --git a/src2/creaImageIOWxViewer.cpp b/src2/creaImageIOWxViewer.cpp index d6871d9..f298a21 100644 --- a/src2/creaImageIOWxViewer.cpp +++ b/src2/creaImageIOWxViewer.cpp @@ -80,8 +80,7 @@ namespace creaImageIO mViewer->SetupInteractor ( mInteractor ); mCurrent = 0; - - mPlayer = 0; + mPlayer = 0; topsizer-> Add( mInteractor ,1,wxGROW ,0); SetSizer( topsizer ); @@ -96,34 +95,12 @@ namespace creaImageIO wxMutexLocker lock(mMutex); GimmickDebugMessage(1,"WxViewer::~WxViewer" <0) - { - GimmickDebugMessage(5,"WxViewer::SetImage "<UnRegister(NULL); - images[i] = im; - // if (im!=0) im->Register(NULL); - } - - } - - } - //================================================================ void WxViewer::SetImageVector(std::vector& pointers) { @@ -132,36 +109,6 @@ namespace creaImageIO imagePointers=pointers; } - - //================================================================ - - bool WxViewer::ImagesEmpty() - { - wxMutexLocker lock(mMutex); - return images.empty(); - } - //================================================================ - - //================================================================ - - void WxViewer::SetMovieSize(unsigned int si) - { - wxMutexLocker lock(mMutex); - GimmickDebugMessage(5,"WxViewer::SetMovieSize("<<(int)si<<")" - <UnRegister(NULL); - } - } - images.clear(); - for (unsigned int i=0;i0) { @@ -204,9 +151,6 @@ namespace creaImageIO } //================================================================ - - - //===================================================================== void WxViewer::ShowImage(vtkImageData* im) { @@ -261,24 +205,11 @@ namespace creaImageIO mViewer->GetRenderer()->ResetCameraClippingRange(bounds); - } - - //::wxWakeUpIdle(); + } } //================================================================ - //================================================== - void WxViewer::OnInternalIdle() - { - // mInteractor->Refresh(); - if(images.size()>0) - { -// mInteractor->Render(); - } - //mViewer->Render(); - } - //================================================================ bool WxViewer::RefreshIfNecessary() { @@ -311,9 +242,6 @@ namespace creaImageIO mPlayer->Run(); } - - - // BEGIN_EVENT_TABLE(WxGimmickFrame, wxDialog) // END_EVENT_TABLE() diff --git a/src2/creaImageIOWxViewer.h b/src2/creaImageIOWxViewer.h index e9ea7a1..e64704a 100644 --- a/src2/creaImageIOWxViewer.h +++ b/src2/creaImageIOWxViewer.h @@ -26,7 +26,6 @@ namespace creaImageIO { public: - // friend class ThreadedMovie; /// Ctor WxViewer(); WxViewer(wxWindow *parent, @@ -36,20 +35,8 @@ namespace creaImageIO const wxSize& size); /// Dtor virtual ~WxViewer(); - ///Shows the image in the vector as a movie - //void ShowImages(); - /// Sets the movie size - void SetMovieSize(unsigned int); - ///Sets the ith image of the movie - void SetImage(int i, vtkImageData* im); - ///Clears the selection of images - // void ClearImages(); - ///Returns true if the image vector is empty - bool ImagesEmpty(); /// void ShowNextImage(); - - void OnInternalIdle(); void StartPlayer(); @@ -74,8 +61,6 @@ namespace creaImageIO /// Current spacing double mspx,mspy,mspz; - /// The vector of images to show - std::vector images; /// int mCurrent; ///The threaded movie player