]> Creatis software - creaContours.git/blobdiff - lib/Interface_Icons_NDimensions/interfToolsPanels.cxx
#3322 creaContours Feature New Normal - Show reference contour Befor After actual...
[creaContours.git] / lib / Interface_Icons_NDimensions / interfToolsPanels.cxx
index d2505d571232b1567926022f810977ba9b4c1d16..ea290acd2a6812d31c141fbbb5a1acd943c4c76f 100644 (file)
@@ -51,9 +51,20 @@ interfConfigurationPanel::interfConfigurationPanel(wxWindow * parent)
        _brithtnessWindowLevel                                  = new wxSlider(this, -1, windowlevel , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
        _brithtnessColorLevel                                   = new wxSlider(this, -1, colorwindow , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
 
-       _interpolationCheckBox = new wxCheckBox(this, -1, _T("Image interpolation") );
+       _interpolationCheckBox                                  = new wxCheckBox(this, -1, _T("Image Interpolation") );
        _interpolationCheckBox->SetValue(true);
 
+       _showTextContourCheckBox                                = new wxCheckBox(this, -1, _T("Labels Contours") );
+       _showTextContourCheckBox->SetValue(true);
+
+
+       _beforContourCheckBox                                   = new wxCheckBox(this, -1, _T("Befor Contour") );
+       _beforContourCheckBox->SetValue(false);
+
+       _afterContourCheckBox                                   = new wxCheckBox(this, -1, _T("After Contour") );
+       _afterContourCheckBox->SetValue(false);
+
+
        Connect( _withOfContourLine->GetId(),     wxEVT_SCROLL_CHANGED,           (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour);
        Connect( _withOfContourLine->GetId(),     wxEVT_SCROLL_THUMBTRACK,        (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour);
 
@@ -62,20 +73,31 @@ interfConfigurationPanel::interfConfigurationPanel(wxWindow * parent)
        Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_CHANGED,           (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
        Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_THUMBTRACK,        (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
        Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnInterpolation);
-
-       wxFlexGridSizer * sizer                                 = new wxFlexGridSizer(1);
-       sizer -> Add( new wxStaticText(this,-1, _T("Contour width"))  , 1, wxGROW );
-       sizer -> Add( _withOfContourLine                , 1, wxGROW );
-       sizer -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
-       sizer -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
-       sizer -> Add( new wxStaticText(this,-1, _T("Brightness of the image"))  , 1, wxGROW );
-       sizer -> Add( new wxStaticText(this,-1, _T("--Window level--"))  , 1, wxGROW );
-       sizer -> Add( _brithtnessWindowLevel            , 1, wxGROW );
-       sizer -> Add( new wxStaticText(this,-1, _T("--Color level--"))  , 1, wxGROW );
-       sizer -> Add( _brithtnessColorLevel, 1, wxGROW );
-       sizer -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
-       sizer -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
-       sizer -> Add( _interpolationCheckBox            , 1, wxGROW );
+       Connect( _showTextContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnShowTextContour);
+       Connect( _beforContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnBeforAfterContour);
+       Connect( _afterContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnBeforAfterContour);
+
+       wxFlexGridSizer * sizerA                                        = new wxFlexGridSizer(1);
+       sizerA -> Add( new wxStaticText(this,-1, _T("Contour width"))  , 1, wxGROW );
+       sizerA -> Add( _withOfContourLine               , 1, wxGROW );
+       sizerA -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
+       sizerA -> Add( new wxStaticText(this,-1, _T("Window level"))  , 1, wxGROW );
+       sizerA -> Add( _brithtnessWindowLevel           , 1, wxGROW );
+       sizerA -> Add( new wxStaticText(this,-1, _T("Color level"))  , 1, wxGROW );
+       sizerA -> Add( _brithtnessColorLevel, 1, wxGROW );
+       sizerA -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
+
+       wxFlexGridSizer * sizerB                                        = new wxFlexGridSizer(1);
+       sizerB -> Add( _interpolationCheckBox           , 1, wxGROW );
+       sizerB -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
+       sizerB -> Add( _showTextContourCheckBox         , 1, wxGROW );
+       sizerB -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
+       sizerB -> Add( _beforContourCheckBox            , 1, wxGROW );
+       sizerB -> Add( _afterContourCheckBox            , 1, wxGROW );
+
+       wxFlexGridSizer * sizer                                         = new wxFlexGridSizer(2);
+       sizer -> Add( sizerA            , 1, wxGROW );
+       sizer -> Add( sizerB            , 1, wxGROW );
 
        this->SetSizer( sizer );
        //JCP 13-10-08
@@ -91,8 +113,8 @@ interfConfigurationPanel::~interfConfigurationPanel()
 {
 }
 
-void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event){
-
+void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event)
+{
     double width = (double)_withOfContourLine->GetValue() / 2.0;
        interfMainPanel::getInstance()->onWidthOfContour(width);
 }
@@ -100,19 +122,25 @@ void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event){
 void interfConfigurationPanel::onBrigthnessColorWindowLevel(wxScrollEvent& event){
        int colorwindow                         = _brithtnessColorLevel->GetValue();
        int windowlevel                         = _brithtnessWindowLevel->GetValue();
-
        interfMainPanel::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
-
 }
 
 void interfConfigurationPanel::OnInterpolation(wxCommandEvent& event)
 {
-
        interfMainPanel::getInstance()->onInterpolation(_interpolationCheckBox->GetValue());
+}
 
+void interfConfigurationPanel::OnBeforAfterContour(wxCommandEvent& event)
+{
+       interfMainPanel::getInstance()->onBeforAfterContour(_beforContourCheckBox->GetValue() , _afterContourCheckBox->GetValue() );
+}
 
+void interfConfigurationPanel::OnShowTextContour(wxCommandEvent& event)
+{
+       interfMainPanel::getInstance()->onShowTextContour(_showTextContourCheckBox->GetValue() );
 }
 
+
 /**
 ** Begin of the spread panel
 **/
@@ -221,7 +249,8 @@ void interfSpreadPanel::setStringSpread(std::string stringtemp){
 ** Begin of information panel
 **/
 interfInformationPanel::interfInformationPanel(wxWindow * parent)
-: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+//: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+: wxPanel(parent, -1)
 {
 printf("EED interfInformationPanel::interfInformationPanel Start\n");
        //wxPanel *panel                                                                        = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxTAB_TRAVERSAL);
@@ -338,7 +367,7 @@ printf("EED interfInformationPanel::interfInformationPanel 3\n");
        _grid = new wxGrid( this,
                 wxID_ANY,
                 wxPoint( 0, 0 ),
-                wxSize( 200, 500 ) );
+                wxSize( 200, 250 ) );
        int i,gridCol=10,gridRow=sizeZ+2;
        _grid->CreateGrid( 0, 0 );
        _grid->AppendRows(gridRow);
@@ -402,19 +431,13 @@ printf("EED interfInformationPanel::interfInformationPanel 5.3\n");
        sizer->Add( new wxStaticText(this      ,1,_T("Gray Range"))     , 1, wxALL , 0 );
 printf("EED interfInformationPanel::interfInformationPanel 5.4\n");
        sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW        , 2 );
-printf("EED interfInformationPanel::interfInformationPanel 5.5\n");
-
+       
+       
        sizer->Add( sizerB                     , 1, wxEXPAND            , 0 );
-
-printf("EED interfInformationPanel::interfInformationPanel 5.6\n");
        sizer->Add( _staticTextInformation     , 1, wxEXPAND            , 0 );
-printf("EED interfInformationPanel::interfInformationPanel 5.7\n");
        sizer->Add( _grid                      , 1, wxEXPAND            , 0 );
-printf("EED interfInformationPanel::interfInformationPanel 5.8\n");
        this->SetSizer( sizer );
-printf("EED interfInformationPanel::interfInformationPanel 5.9\n");
        this->SetSize( wxSize(1500,1500) );
-       //this->SetBackgroundColour( wxColour(100,100,100) );
        this->SetAutoLayout( true );
 printf("EED interfInformationPanel::interfInformationPanel 5.10\n");
        this->Layout();