X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2FCutModule%2Finterface%2FCutModelView.cxx;h=a01bec6e73e499af0390fd27133ff1826a3dbeee;hb=8aa8568d0fa7b4e2c8f92372de3859a03c4072d0;hp=0be3752353bdb0a32df9631f97b88c0fadbf68b2;hpb=2d5984d688d7b149aa7706a0a0bf8c4b4556d788;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/CutModule/interface/CutModelView.cxx b/lib/maracasVisuLib/src/CutModule/interface/CutModelView.cxx index 0be3752..a01bec6 100644 --- a/lib/maracasVisuLib/src/CutModule/interface/CutModelView.cxx +++ b/lib/maracasVisuLib/src/CutModule/interface/CutModelView.cxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: CutModelView.cxx,v $ Language: C++ - Date: $Date: 2009/08/31 08:46:09 $ - Version: $Revision: 1.1 $ + Date: $Date: 2011/02/07 09:16:28 $ + Version: $Revision: 1.3 $ Copyright: (c) 2002, 2003 License: @@ -28,6 +28,7 @@ #include #include #include +#include #include "vtkBoxWidget.h" @@ -85,21 +86,28 @@ wxSizer* CutModelView::getBoxControls(wxWindow* parent,double* range){ _sliderrange = new wxSlider(parent, -1, range[0],range[0],range[1],wxDefaultPosition,wxDefaultSize,wxSL_LABELS|wxSL_SELRANGE); wxBoxSizer* sizergreyv = new wxBoxSizer(wxVERTICAL); sizergreyv->Add(labelgreyv,wxSizerFlags().FixedMinSize()); - sizergreyv->Add(_sliderrange,wxSizerFlags().FixedMinSize()); - sizer->Add(sizergreyv,wxSizerFlags().FixedMinSize().Border()); - - wxString choices[2]; - choices[0] = _T("Cut"); - choices[1] = _T("Statistics"); - _radiocutstat = new wxRadioBox(parent,-1,_T(""), wxDefaultPosition, wxDefaultSize,2,choices); - sizer->Add(_radiocutstat,wxSizerFlags().FixedMinSize()); - + sizergreyv->Add(_sliderrange,1, wxGROW); + sizer->Add(sizergreyv, 1, wxGROW); + wxString choices0[2]; choices0[0] = _T("inside"); choices0[1] = _T("outside"); _radioinsideout = new wxRadioBox(parent,-1,_T(""), wxDefaultPosition, wxDefaultSize,2,choices0); sizer->Add(_radioinsideout,wxSizerFlags().FixedMinSize()); + /*wxString choices[2]; + choices[0] = _T("Cut"); + choices[1] = _T("Statistics"); + _radiocutstat = new wxRadioBox(parent,-1,_T(""), wxDefaultPosition, wxDefaultSize,2,choices); + sizer->Add(_radiocutstat,wxSizerFlags().FixedMinSize());*/ + + wxBitmap bitmap(Statistics_xpm); + wxBitmapButton* statbut = new wxBitmapButton(parent, -1, bitmap,wxDefaultPosition,wxSize(30,30)); + Connect(statbut->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)(&CutModelViewEventHandler::onStatistics)); + sizer->Add(statbut,wxSizerFlags().FixedMinSize()); + + + return sizer; } wxSizer* CutModelView::getActorProperties(wxWindow* parent){ @@ -122,11 +130,13 @@ wxSizer* CutModelView::getOpacityActor(wxWindow* parent){ wxBoxSizer* sizeropacity = new wxBoxSizer(wxVERTICAL); wxStaticText* labelopacity = new wxStaticText(parent, -1, wxString(_T("Opacity"))); - wxSlider* slider0 = new wxSlider(parent, -1, 40,0,100,wxDefaultPosition,wxDefaultSize,wxSL_LABELS); + wxSlider* slider0 = new wxSlider(parent, -1, 60,0,100,wxDefaultPosition,wxDefaultSize,wxSL_LABELS); Connect(slider0->GetId(), wxEVT_SCROLL_THUMBRELEASE,(wxObjectEventFunction)(&CutModelViewEventHandler::onOpacityChange)); - sizeropacity->Add(labelopacity,wxSizerFlags().FixedMinSize()); - sizeropacity->Add(slider0,wxSizerFlags().FixedMinSize()); + //sizeropacity->Add(labelopacity,1, wxGROWwxSizerFlags().FixedMinSize()); + sizeropacity->Add(labelopacity,1, wxGROW); + //sizeropacity->Add(slider0,wxSizerFlags().FixedMinSize()); + sizeropacity->Add(slider0, 1, wxGROW); return sizeropacity; } @@ -139,6 +149,7 @@ wxSizer* CutModelView::getColorChooseActor(wxWindow* parent){ Connect(colorchoose->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, f); _currentcolor = new wxStaticText(parent,-1,_T(""),wxDefaultPosition,wxSize(20,20)); + this->SetCurrentColor(wxColour(255.0,0.0,0.0)); sizercolor->Add(colorchoose,wxSizerFlags().FixedMinSize()); sizercolor->AddSpacer(5); @@ -180,7 +191,8 @@ double* CutModelView::getRange(){ return x; } bool CutModelView::isCut(){ - return _radiocutstat->GetSelection()==0; + return true; + //return _radiocutstat->GetSelection()==0; } bool CutModelView::isInside(){ return _radioinsideout->GetSelection()==0; @@ -228,6 +240,10 @@ void CutModelViewEventHandler::onShapeChange(wxCommandEvent& event){ CutModelMainPanel::getInstance()->ChangeShape(parent->getId(),event.GetSelection()); //} } +void CutModelViewEventHandler::onStatistics(wxCommandEvent& event){ + CutModelView* parent = (CutModelView*)((wxWindow*)event.GetEventObject())->GetParent(); + CutModelMainPanel::getInstance()->ShowStatistics(parent->getId()); +} void CutModelViewEventHandler::onExecute(wxCommandEvent& event){ CutModelView* parent = (CutModelView*)((wxWindow*)event.GetEventObject())->GetParent();