]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/CutModule/interface/CutModelView.cxx
Undo Redo
[creaMaracasVisu.git] / lib / maracasVisuLib / src / CutModule / interface / CutModelView.cxx
index 0be3752353bdb0a32df9631f97b88c0fadbf68b2..b95a815a835d42ac0b41e937c5801eccf33aaead 100644 (file)
@@ -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: 2009/09/01 14:01:35 $
+  Version:   $Revision: 1.2 $
 
   Copyright: (c) 2002, 2003
   License:
@@ -28,6 +28,7 @@
 #include <OpenImage.xpm>
 #include <Color.xpm>
 #include <Ok1.xpm>
+#include <Statistics.xpm>
 
 #include "vtkBoxWidget.h"
 
@@ -87,19 +88,26 @@ wxSizer* CutModelView::getBoxControls(wxWindow* parent,double* range){
        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());
-
+       
        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,7 +130,7 @@ 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());
@@ -139,6 +147,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 +189,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 +238,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();