]> Creatis software - creaContours.git/blobdiff - lib/Interface_Icons_NDimensions/interfToolsPanels.cxx
#3161 creaContours Bug New Normal - Interpolate Image - Color and Threshold Layer...
[creaContours.git] / lib / Interface_Icons_NDimensions / interfToolsPanels.cxx
index fc28256cfa42ac89005724d16cf095cfb52da10c..32284ec4b05e0528c3df47c9b400992f9386df50 100644 (file)
@@ -107,7 +107,6 @@ void interfConfigurationPanel::onBrigthnessColorWindowLevel(wxScrollEvent& event
 
 void interfConfigurationPanel::OnInterpolation(wxCommandEvent& event)
 {
-
        interfMainPanel::getInstance()->onInterpolation(_interpolationCheckBox->GetValue());
 
 
@@ -213,7 +212,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)
 {
        //wxPanel *panel                                                                        = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxTAB_TRAVERSAL);
        wxString lstOptions[4];
@@ -310,7 +310,7 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        _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 );
@@ -350,13 +350,13 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW        , 2 );
        sizer->Add( new wxStaticText(this      ,-1,_T("Gray Range"))    , 1, wxALL , 0 );
        sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW        , 2 );
-       sizer->Add( sizerB                     , 1, wxEXPAND            , 0 );
-       sizer->Add( _staticTextInformation     , 1, wxEXPAND            , 0 );
+       sizer->Add( sizerB                     , 1, wxALL|wxGROW                , 0 );
+       sizer->Add( _staticTextInformation     , 1, wxALL|wxGROW                , 0 );
        sizer->Add( _grid                      , 1, wxEXPAND            , 0 );
 
        this->SetSizer( sizer );
-       this->SetSize( wxSize(1500,1500) );
-       //this->SetBackgroundColour( wxColour(100,100,100) );
+//     this->SetSize( wxSize(1500,1500) );
+//  this->SetBackgroundColour( wxColour(100,100,100) );
        this->SetAutoLayout( true );
        this->Layout();
        //return panel;
@@ -551,3 +551,55 @@ void interfCalibrationPanel::onCalibrate(wxCommandEvent& event)
 }
 //------------------------------------------------------------------------------------------------------------
 
+
+
+//////////////////////////////////////////////////////////////
+
+interfFlipPanel::interfFlipPanel(wxWindow* parent)
+: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+{
+       wxButton *buttonFlipX = new wxButton(this,wxID_ANY,_T("Flip Horizontally"), wxDefaultPosition, wxSize(200,35) );
+       wxButton *buttonFlipY = new wxButton(this,wxID_ANY,_T("Flip Vertically"), wxDefaultPosition, wxSize(200,35) );
+
+       wxString lstOptions[3];
+       lstOptions[0]=_T("Flip selected contours");
+       lstOptions[1]=_T("Flip all contours of actual slice");
+       lstOptions[2]=_T("Flip all contours");
+       _wichContoursRadioBox = new wxRadioBox(this, -1, _T("Transform"), wxDefaultPosition, wxDefaultSize, 3 , lstOptions,  1, wxRA_SPECIFY_COLS);
+       _wichContoursRadioBox->SetSelection(2);
+
+       
+       Connect( buttonFlipX->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfFlipPanel::onFlipXPressed );
+       Connect( buttonFlipY->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfFlipPanel::onFlipYPressed ); 
+       
+       wxFlexGridSizer * sizer         = new wxFlexGridSizer(1);
+       sizer -> Add( _wichContoursRadioBox, 1, wxGROW );
+       sizer -> Add( buttonFlipX, 1, wxGROW );
+       sizer -> Add( buttonFlipY, 1, wxGROW );
+
+       this->SetSizer( sizer );
+       this->SetAutoLayout( true );
+       this->Layout();
+}
+
+
+
+
+interfFlipPanel::~interfFlipPanel(){
+}
+
+void interfFlipPanel::onFlipXPressed(wxCommandEvent& event)
+{
+       std::cout << "interfToolsPanels.cxx  interfFlipPanel::onFlipXPressed     FlipX (btn)" << std::endl;
+       int typeContoursFlip = _wichContoursRadioBox->GetSelection(); 
+       interfMainPanel::getInstance()->FlipContours( typeContoursFlip , 0 );  // type, direction
+}
+
+void interfFlipPanel::onFlipYPressed(wxCommandEvent& event)
+{
+       std::cout << "interfToolsPanels.cxx   interfFlipPanel::onFlipYPressed FlipY  (btn)" << std::endl;
+       int typeContoursFlip = _wichContoursRadioBox->GetSelection(); 
+       interfMainPanel::getInstance()->FlipContours( typeContoursFlip , 1 );  // type, direction
+}
+
+