<<"'"<<level
<<std::endl);
int _id=1;
- int colorId=0;
-
-
+
//Adds items (other than the first) and sets their attributes
GetTreeHandler()->LoadChildren(*i,1);
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);
}
}
+ //================================================================
+ 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()
{
/// 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)
mViewer->SetupInteractor ( mInteractor );
mCurrent = 0;
-
- mPlayer = 0;
+ mPlayer = 0;
topsizer-> Add( mInteractor ,1,wxGROW ,0);
SetSizer( topsizer );
wxMutexLocker lock(mMutex);
GimmickDebugMessage(1,"WxViewer::~WxViewer"
<<std::endl);
- SetMovieSize(0);
// TO DO : desallocate cleanly
// delete mPlayer;
// delete mInteractor;
}
//=====================================================================
-
- //================================================================
-
- void WxViewer::SetImage(int i, vtkImageData* im)
- {
- wxMutexLocker lock(mMutex);
- if(images.size()>0)
- {
- GimmickDebugMessage(5,"WxViewer::SetImage "<<i+1<<"/"<<images.size()
- <<std::endl);
- if (i<images.size())
- {
- // if (images[i]!=0) images[i]->UnRegister(NULL);
- images[i] = im;
- // if (im!=0) im->Register(NULL);
- }
-
- }
-
- }
-
//================================================================
void WxViewer::SetImageVector(std::vector<ImagePointerHolder*>& pointers)
{
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<<")"
- <<std::endl);
- for (unsigned int i=0;i<images.size();++i)
- {
- if (images[i]!=0)
- {
- // images[i]->UnRegister(NULL);
- }
- }
- images.clear();
- for (unsigned int i=0;i<si;++i) images.push_back(0);
- mCurrent = 0;
- }
- //================================================================
-
//================================================================
void WxViewer::ShowNextImage()
GimmickMessage(10,"WxViewer::ShowNextImage() "
<<mCurrent+1<<"/"
- <<images.size()<<std::endl);
+ <<imagePointers.size()<<std::endl);
if(imagePointers.size()>0)
{
}
//================================================================
-
-
-
//=====================================================================
void WxViewer::ShowImage(vtkImageData* im)
{
mViewer->GetRenderer()->ResetCameraClippingRange(bounds);
- }
-
- //::wxWakeUpIdle();
+ }
}
//================================================================
- //==================================================
- void WxViewer::OnInternalIdle()
- {
- // mInteractor->Refresh();
- if(images.size()>0)
- {
-// mInteractor->Render();
- }
- //mViewer->Render();
- }
-
//================================================================
bool WxViewer::RefreshIfNecessary()
{
mPlayer->Run();
}
-
-
-
// BEGIN_EVENT_TABLE(WxGimmickFrame, wxDialog)
// END_EVENT_TABLE()
{
public:
- // friend class ThreadedMovie;
/// Ctor
WxViewer();
WxViewer(wxWindow *parent,
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();
/// Current spacing
double mspx,mspy,mspz;
- /// The vector of images to show
- std::vector<vtkImageData*> images;
///
int mCurrent;
///The threaded movie player