]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/CutModule/interface/CutModelView.cxx
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / CutModule / interface / CutModelView.cxx
index 0be3752353bdb0a32df9631f97b88c0fadbf68b2..265d327d3a6ffa9562cd0a30f3840144f260589c 100644 (file)
@@ -1,10 +1,35 @@
+/*# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+#                        pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+#  This software is governed by the CeCILL-B license under French law and
+#  abiding by the rules of distribution of free software. You can  use,
+#  modify and/ or redistribute the software under the terms of the CeCILL-B
+#  license as circulated by CEA, CNRS and INRIA at the following URL
+#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+#  or in the file LICENSE.txt.
+#
+#  As a counterpart to the access to the source code and  rights to copy,
+#  modify and redistribute granted by the license, users are provided only
+#  with a limited warranty  and the software's author,  the holder of the
+#  economic rights,  and the successive licensors  have only  limited
+#  liability.
+#
+#  The fact that you are presently reading this means that you have had
+#  knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ */
+
 /*=========================================================================
 
   Program:   wxMaracas
   Module:    $RCSfile: CutModelView.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/08/31 08:46:09 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2012/11/15 14:16:20 $
+  Version:   $Revision: 1.4 $
 
   Copyright: (c) 2002, 2003
   License:
@@ -28,6 +53,7 @@
 #include <OpenImage.xpm>
 #include <Color.xpm>
 #include <Ok1.xpm>
+#include <Statistics.xpm>
 
 #include "vtkBoxWidget.h"
 
@@ -85,21 +111,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 +155,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 +174,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 +216,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 +265,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();