]> Creatis software - creaMaracasVisu.git/commitdiff
#3545 Save Load in TransformWidget2 box
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Wed, 18 Oct 2023 06:38:18 +0000 (08:38 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Wed, 18 Oct 2023 06:38:18 +0000 (08:38 +0200)
bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg
bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs
bbtk/src/bbcreaMaracasVisuTransformWidget2.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx

index 857daecbfb27fcb95c2f00049ea8cf75c6026e50..392cf41bbcf610b86fb621fb71a8e0c7492743ed 100644 (file)
@@ -72,7 +72,7 @@ COMPLEX_PORT
 freeplane_transform
 -320.924223:169.055148:-900.000000
 FIN_COMPLEX_PORT
-BOXES:102
+BOXES:104
 BOX
 creaMaracasVisu:ShowNPoints:showNpoints
 ISEXEC:FALSE
@@ -94,8 +94,8 @@ FIN_BOX
 BOX
 creaMaracasVisu:ManualContourModel_Box:Box06
 ISEXEC:FALSE
-35.216468:30.364799:-900.000000
-59.736468:27.864799:-900.000000
+36.048489:25.206269:-900.000000
+60.568489:22.706269:-900.000000
 PORT
 DoubleContour:"1"
 PORT
@@ -122,8 +122,8 @@ FIN_BOX
 BOX
 creaMaracasVisu:DrawAxisTree3D:Box30
 ISEXEC:FALSE
-71.195945:10.752752:-900.000000
-99.235945:8.252752:-900.000000
+71.029541:7.424668:-900.000000
+99.069541:4.924668:-900.000000
 PORT
 Colour:"0 0 1"
 PORT
@@ -138,8 +138,8 @@ FIN_BOX
 BOX
 creaMaracasVisu:ManualContourModel_Box:Box29
 ISEXEC:FALSE
-76.240145:29.637449:-900.000000
-100.760145:27.137449:-900.000000
+78.902612:24.978132:-900.000000
+103.422612:22.478132:-900.000000
 PORT
 NbPoints:"40"
 PORT
@@ -204,8 +204,8 @@ FIN_BOX
 BOX
 creaVtk:BooleanOperationPolyDataFilter:Box77
 ISEXEC:FALSE
--84.021341:-55.010494:-900.000000
--60.291341:-57.510494:-900.000000
+-84.222690:-57.628032:-900.000000
+-60.492690:-60.128032:-900.000000
 PORT
 BoxProcessMode:"Manual"
 PORT
@@ -217,7 +217,7 @@ ISEXEC:FALSE
 -158.791094:0.609690:-900.000000
 -132.511094:-1.890310:-900.000000
 PORT
-In:"Union Intersection Difference"
+In:"Union Intersection Difference Replace"
 FIN_BOX
 BOX
 wx:LayoutLine:Box79
@@ -484,16 +484,16 @@ FIN_BOX
 BOX
 creaVtk:PolyDataNormals:Box95
 ISEXEC:FALSE
-116.738582:-18.405915:-900.000000
-139.033582:-20.905915:-900.000000
+115.530488:-17.801868:-900.000000
+137.825488:-20.301868:-900.000000
 PORT
 Type:"1"
 FIN_BOX
 BOX
 creaVtk:LinearExtrusionFilter:Box96
 ISEXEC:FALSE
-126.138551:-32.318028:-900.000000
-148.648551:-34.818028:-900.000000
+124.326409:-32.116679:-900.000000
+146.836409:-34.616679:-900.000000
 FIN_BOX
 BOX
 creaMaracasVisu:PolyDataToActor_Widget:Box98
@@ -530,16 +530,16 @@ FIN_BOX
 BOX
 wx:LayoutLine:Box101
 ISEXEC:FALSE
-78.195133:-42.092223:-900.000000
-111.515133:-44.592223:-900.000000
+77.695920:-42.258627:-900.000000
+111.015920:-44.758627:-900.000000
 PORT
 Orientation:"V"
 FIN_BOX
 BOX
 wx:LayoutLine:Box102
 ISEXEC:FALSE
-47.580363:-71.654396:-900.000000
-80.900363:-74.154396:-900.000000
+38.095324:-75.814501:-900.000000
+71.415324:-78.314501:-900.000000
 PORT
 Orientation:"H"
 PORT
@@ -560,8 +560,8 @@ FIN_BOX
 BOX
 wx:LayoutTab:Box106
 ISEXEC:FALSE
-44.078139:-78.491084:-900.000000
-77.398139:-80.991084:-900.000000
+41.748480:-86.478485:-900.000000
+75.068480:-88.978485:-900.000000
 FIN_BOX
 BOX
 creaMaracasVisu:MeshContours_Widget:Box107
@@ -582,8 +582,8 @@ FIN_BOX
 BOX
 std:MagicBox:Box109
 ISEXEC:FALSE
-135.305882:-44.175286:-900.000000
-157.015882:-46.675286:-900.000000
+125.439777:-43.168541:-900.000000
+147.149777:-45.668541:-900.000000
 FIN_BOX
 BOX
 creaVtk:MeshReduction_QuadricDecimation:Box110
@@ -642,16 +642,16 @@ FIN_BOX
 BOX
 wx:Slider:Box118
 ISEXEC:FALSE
-71.035157:-27.538758:-900.000000
-100.835157:-30.038758:-900.000000
+70.369540:-25.708312:-900.000000
+100.169540:-28.208312:-900.000000
 PORT
 In:"0"
 PORT
 Label:"true"
 PORT
-Max:"50"
+Max:"150"
 PORT
-Min:"-50"
+Min:"-150"
 PORT
 ReactiveOnTrack:"true"
 PORT
@@ -893,7 +893,25 @@ ISEXEC:FALSE
 -326.072857:160.185314:-900.000000
 -304.362857:157.685314:-900.000000
 FIN_BOX
-CONNECTIONS:201
+BOX
+wx:LayoutLine:Box160
+ISEXEC:FALSE
+134.964613:21.874211:-900.000000
+168.284613:19.374211:-900.000000
+PORT
+Orientation:"H"
+PORT
+WinTitle:"Conf"
+FIN_BOX
+BOX
+wx:CheckBox:Box161
+ISEXEC:FALSE
+139.524925:32.934718:-900.000000
+161.264925:30.434718:-900.000000
+PORT
+Title:"Close Spline"
+FIN_BOX
+CONNECTIONS:205
 CONNECTION
 Box06:LstContourPointsX:Box04:LstX
 NumberOfControlPoints:0
@@ -1497,4 +1515,16 @@ NumberOfControlPoints:0
 CONNECTION
 Box151:Out:Box107:active_widget
 NumberOfControlPoints:0
+CONNECTION
+Box160:Widget:Box106:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box161:Widget:Box160:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box161:Out:Box06:OpenClose
+NumberOfControlPoints:0
+CONNECTION
+Box161:Out:Box29:OpenClose
+NumberOfControlPoints:0
 APP_END
index 4b346faf5d9d8fc95dbde125d3546bb72d57465b..9bed0b97b85e2f1831963f1251ee8b192eae3904 100644 (file)
@@ -74,7 +74,7 @@ new creaVtk:BooleanOperationPolyDataFilter Box77
   set Box77.ReorientDifferenceCells "false"
 
 new wx:ComboBox Box78
-  set Box78.In "Union Intersection Difference"
+  set Box78.In "Union Intersection Difference Replace"
 
 new wx:LayoutLine Box79
   set Box79.Orientation "V"
@@ -234,8 +234,8 @@ new wx:LayoutLine Box117
 new wx:Slider Box118
   set Box118.In "0"
   set Box118.Label "true"
-  set Box118.Max "50"
-  set Box118.Min "-50"
+  set Box118.Max "150"
+  set Box118.Min "-150"
   set Box118.ReactiveOnTrack "true"
   set Box118.Title "Extrusion"
 
@@ -326,6 +326,13 @@ new std:MagicBox Box158
 
 new std:MagicBox Box159
 
+new wx:LayoutLine Box160
+  set Box160.Orientation "H"
+  set Box160.WinTitle "Conf"
+
+new wx:CheckBox Box161
+  set Box161.Title "Close Spline"
+
 
 connect Box06.LstContourPointsX Box04.LstX
 connect showNpoints.lstIndexs Box06.LstIndexsIn
@@ -513,6 +520,10 @@ connect Box159.Out Box72.Freeplane_transform
 connect Box159.Out Box107.Freeplane_transform
 connect Box151.Out Box72.active_widget
 connect Box151.Out Box107.active_widget
+connect Box160.Widget Box106.Widget3
+connect Box161.Widget Box160.Widget2
+connect Box161.Out Box06.OpenClose
+connect Box161.Out Box29.OpenClose
 
 # Complex input ports
 input mesh Box67.In " "
index b632bc5ce813667d097345635641540653b42fbe..2bb4f19f95aac03c2fbe00c7ee3c06316fd4ebf8 100644 (file)
@@ -3,6 +3,9 @@
 //===== 
 #include "bbcreaMaracasVisuTransformWidget2.h"
 #include "bbcreaMaracasVisuPackage.h"
+
+#include <wx/filedlg.h>
+
 namespace bbcreaMaracasVisu
 {
 
@@ -35,6 +38,8 @@ public:
     void OnRadioButtonY(wxEvent& event);
     void OnRadioButtonZ(wxEvent& event);
     void OnRadioButtonN(wxEvent& event);
+    void OnSave(wxCommandEvent& event);
+    void OnLoad(wxCommandEvent& event);
     void OnReset(wxCommandEvent& event);
     void OnMoveDown(wxCommandEvent& event);
     void OnMoveUp(wxCommandEvent& event);
@@ -119,37 +124,48 @@ TransformWidgetPanel::TransformWidgetPanel(TransformWidget2* box, wxWindow *pare
     if (mBox->bbGetInputType()==1)
     {
         sizeSliderWidget.Set( 160 , -1 );
-        sizeButton.Set( 20 , -1 );
-        wxRadioButton *rBtnX     = new wxRadioButton( this, -1, _T("ri")         , wxDefaultPosition  , wxDefaultSize , wxRB_GROUP   );
-        wxRadioButton *rBtnY     = new wxRadioButton( this, -1, _T("rj")         , wxDefaultPosition  , wxDefaultSize , 0            );
-        wxRadioButton *rBtnZ     = new wxRadioButton( this, -1, _T("rk")         , wxDefaultPosition  , wxDefaultSize , 0            );
-        wxRadioButton *rBtnC     = new wxRadioButton( this, -1, _T("Cen")        , wxDefaultPosition  , wxDefaultSize , 0)           ;
+        sizeButton.Set( 15 , -1 );
+        wxRadioButton *rBtnC     = new wxRadioButton( this, -1, _T("Cen")        , wxDefaultPosition  , wxDefaultSize , wxRB_GROUP      );
+        wxRadioButton *rBtnX     = new wxRadioButton( this, -1, _T("ri")         , wxDefaultPosition  , wxDefaultSize , 0               );
+        wxRadioButton *rBtnY     = new wxRadioButton( this, -1, _T("rj")         , wxDefaultPosition  , wxDefaultSize , 0               );
+        wxRadioButton *rBtnZ     = new wxRadioButton( this, -1, _T("rk")         , wxDefaultPosition  , wxDefaultSize , 0               );
+        wxButton *BtnSave        = new wxButton     ( this, -1, _T("Save")       , wxDefaultPosition, sizeButton                                                                            );
+        wxButton *BtnLoad        = new wxButton     ( this, -1, _T("Load")       , wxDefaultPosition, sizeButton                                                                            );
         rBtnC->SetValue(true);        mTool = 3;
-        mSliderGeneral           = new wxSlider     ( this, -1, 0 , -180, 180    , wxDefaultPosition,sizeSliderWidget ,wxSL_HORIZONTAL, wxDefaultValidator                                   );
-        cbLocalReference         = new wxCheckBox   ( this,-1, _T("Loc Ref")     , wxDefaultPosition,wxDefaultSize    ,wxCHK_2STATE | wxALIGN_RIGHT                                          );
-        wxButton *BtnMoveDown    = new wxButton     ( this, -1, _T("-")          , wxDefaultPosition, sizeButton                                                                             );
-        wxButton *BtnMoveUp      = new wxButton     ( this, -1, _T("+")          , wxDefaultPosition, sizeButton                                                                             );
-        wxButton *BtnReset       = new wxButton     ( this, -1, _T("Init")      , wxDefaultPosition, sizeButton                                                                             );
-        wxButton *BtnMemory      = new wxButton     ( this, -1, _T("Set")       , wxDefaultPosition, sizeButton                                                                             );
-        wxButton *BtnMemoryGoBack= new wxButton     ( this, -1, _T("Reset")       , wxDefaultPosition, sizeButton                                                                             );
-        Connect( rBtnX->GetId()          , wxEVT_COMMAND_RADIOBUTTON_SELECTED    , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonX                );
-        Connect( rBtnY->GetId()          , wxEVT_COMMAND_RADIOBUTTON_SELECTED    , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonY                );
-        Connect( rBtnZ->GetId()          , wxEVT_COMMAND_RADIOBUTTON_SELECTED    , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonZ                );
-        Connect( rBtnC->GetId()          , wxEVT_COMMAND_RADIOBUTTON_SELECTED    , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonN                );
-        Connect( BtnReset->GetId()       , wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnReset                 );
-        Connect( BtnMoveDown->GetId()    , wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveDown              );
-        Connect( BtnMoveUp->GetId()      , wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveUp                );
-        Connect( BtnMemory->GetId()      , wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMemory                );
-        Connect( BtnMemoryGoBack->GetId(), wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMemoryGoBack          );
-        Connect( mSliderGeneral->GetId() , wxEVT_SCROLL_THUMBRELEASE             , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralRelease  );
-        Connect( mSliderGeneral->GetId() , wxEVT_SCROLL_THUMBTRACK               , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack    );
-        Connect( mSliderGeneral->GetId() , wxEVT_SCROLL_CHANGED                  , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack    );
+        mSliderGeneral           = new wxSlider     ( this, -1, 0 , -180, 180    , wxDefaultPosition,sizeSliderWidget ,wxSL_HORIZONTAL, wxDefaultValidator                                  );
+        cbLocalReference         = new wxCheckBox   ( this,-1, _T("Loc Ref")     , wxDefaultPosition,wxDefaultSize    ,wxCHK_2STATE | wxALIGN_RIGHT                                         );
+        wxButton *BtnMoveDown    = new wxButton     ( this, -1, _T("-")          , wxDefaultPosition, sizeButton                                                                            );
+        wxButton *BtnMoveUp      = new wxButton     ( this, -1, _T("+")          , wxDefaultPosition, sizeButton                                                                            );
+        wxButton *BtnReset       = new wxButton     ( this, -1, _T("Init")       , wxDefaultPosition, sizeButton                                                                            );
+        wxButton *BtnMemory      = new wxButton     ( this, -1, _T("Set")        , wxDefaultPosition, sizeButton                                                                            );
+        wxButton *BtnMemoryGoBack= new wxButton     ( this, -1, _T("Reset")      , wxDefaultPosition, sizeButton                                                                            );
+        Connect( rBtnX->GetId()          , wxEVT_COMMAND_RADIOBUTTON_SELECTED    , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonX               );
+        Connect( rBtnY->GetId()          , wxEVT_COMMAND_RADIOBUTTON_SELECTED    , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonY               );
+        Connect( rBtnZ->GetId()          , wxEVT_COMMAND_RADIOBUTTON_SELECTED    , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonZ               );
+        Connect( rBtnC->GetId()          , wxEVT_COMMAND_RADIOBUTTON_SELECTED    , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonN               );
+        Connect( BtnSave->GetId()        , wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnSave                       );
+        Connect( BtnLoad->GetId()        , wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnLoad                       );
+        Connect( BtnReset->GetId()       , wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnReset                );
+        Connect( BtnMoveDown->GetId()    , wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveDown             );
+        Connect( BtnMoveUp->GetId()      , wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveUp               );
+        Connect( BtnMemory->GetId()      , wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMemory               );
+        Connect( BtnMemoryGoBack->GetId(), wxEVT_COMMAND_BUTTON_CLICKED          , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMemoryGoBack         );
+        Connect( mSliderGeneral->GetId() , wxEVT_SCROLL_THUMBRELEASE             , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralRelease );
+        Connect( mSliderGeneral->GetId() , wxEVT_SCROLL_THUMBTRACK               , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack   );
+        Connect( mSliderGeneral->GetId() , wxEVT_SCROLL_CHANGED                  , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack   );
         
+        wxBoxSizer *sizerA1 = new wxBoxSizer(wxHORIZONTAL);
+        sizerA1->Add( rBtnC              , 1 );
+        sizerA1->Add( rBtnX              , 1 );
+        sizerA1->Add( rBtnY              , 1 );
+        sizerA1->Add( rBtnZ              , 1 );
+        wxBoxSizer *sizerA2 = new wxBoxSizer(wxHORIZONTAL);
+        sizerA2->Add( BtnSave            , 1 );
+        sizerA2->Add( BtnLoad            , 1 );
         wxBoxSizer *sizerA = new wxBoxSizer(wxHORIZONTAL);
-        sizerA->Add( rBtnC              , 1 );
-        sizerA->Add( rBtnX              , 1 );
-        sizerA->Add( rBtnY              , 1 );
-        sizerA->Add( rBtnZ              , 1 );
+        sizerA->Add( sizerA1            , 1 );
+        sizerA->Add( sizerA2            , 1 );
+
         wxBoxSizer *sizerB = new wxBoxSizer(wxHORIZONTAL);
         sizerB->Add( mSliderGeneral     , 1 );
         sizerB->Add( BtnMoveDown        , 0 );
@@ -163,10 +179,8 @@ TransformWidgetPanel::TransformWidgetPanel(TransformWidget2* box, wxWindow *pare
         sizer->Add( sizerA              , 0 );
         sizer->Add( sizerB              , 0 );
         sizer->Add( sizerC              , 0 );
-
         SetSizer(sizer);
     } // if
-    
 }
 
 TransformWidgetPanel::~TransformWidgetPanel()
@@ -391,6 +405,107 @@ void TransformWidgetPanel::OnMemory(wxCommandEvent& event)
     mMemoryMatrix->DeepCopy( t->GetMatrix() );
 }
 
+void TransformWidgetPanel::OnSave(wxCommandEvent& event)
+{
+    wxFileDialog* FD = new wxFileDialog( 0,
+                                        _T("Save free plane configuratin"),
+                                        _T(""),
+                                        _T(""),
+                                        _T("(*.fpConf)|*.fpConf"),
+                                        wxFD_SAVE | wxFD_OVERWRITE_PROMPT,
+                                        wxDefaultPosition);
+
+    int result_FD = FD->ShowModal();
+    // This line is need it by windows //EED
+    FD->SetReturnCode( result_FD );
+    if (FD->GetReturnCode()==wxID_OK)
+    {
+        std::string filename= (const char*) ( FD->GetPath().mb_str() );
+        FILE *ff;
+        ff = fopen( filename.c_str() , "w+" );
+        if (ff!=NULL)
+        {
+            fprintf(ff,"ActualPoint:\n");
+            fprintf(ff,"%f  %f  %f\n",mActualPoint[0], mActualPoint[1], mActualPoint[2] );
+            vtkMatrix4x4 *m = t->GetMatrix();
+            fprintf(ff,"Transform:\n");
+            fprintf(ff,"%f  %f  %f  %f  \n",m->GetElement(0,0), m->GetElement(1,0), m->GetElement(2,0), m->GetElement(3,0) );
+            fprintf(ff,"%f  %f  %f  %f  \n",m->GetElement(0,1), m->GetElement(1,1), m->GetElement(2,1), m->GetElement(3,1) );
+            fprintf(ff,"%f  %f  %f  %f  \n",m->GetElement(0,2), m->GetElement(1,2), m->GetElement(2,2), m->GetElement(3,2) );
+            fprintf(ff,"%f  %f  %f  %f\n\n",m->GetElement(0,3), m->GetElement(1,3), m->GetElement(2,3), m->GetElement(3,3) );
+            fclose(ff);
+        } else {   // else ff
+            printf("TransformWidgetPanel::OnSave  ...Error... creating file \n");
+        } //ff
+    }     // dialog box
+}
+
+void TransformWidgetPanel::OnLoad(wxCommandEvent& event)
+{
+    wxFileDialog* FD = new wxFileDialog( 0,
+                                         _T("Load groups of points .."),
+                                         _T(""),
+                                         _T(""),
+                                         _T("(*.fpConf)|*.fpConf"),
+                                         wxFD_OPEN | wxFD_FILE_MUST_EXIST,
+                                         wxDefaultPosition);
+
+    int result_FD = FD->ShowModal();
+    // This line is need it by windows //EED
+    FD->SetReturnCode( result_FD );
+    if (FD->GetReturnCode()==wxID_OK)
+    {
+        std::string filename= (const char*) ( FD->GetPath().mb_str() );
+        FILE *ff;
+        ff = fopen( filename.c_str() , "r" );
+        if (ff!=NULL)
+        {
+            char tmpStr[128];
+            float t0,t1,t2,t3;
+            fscanf(ff,"%s\n",tmpStr);  // ActualPoint:
+            fscanf(ff,"%f  %f  %f\n",&t0,&t1,&t2);
+            mActualPoint[0]=t0;
+            mActualPoint[1]=t1;
+            mActualPoint[2]=t2;
+
+            vtkMatrix4x4 *m = t->GetMatrix();
+            fscanf(ff,"%s\n",tmpStr); // Transform:
+            fscanf(ff,"%f %f  %f %f\n",&t0,&t1,&t2,&t3);
+            m->SetElement(0,0,t0);
+            m->SetElement(1,0,t1);
+            m->SetElement(2,0,t2);
+            m->SetElement(3,0,t3);
+            fscanf(ff,"%f %f  %f %f\n",&t0,&t1,&t2,&t3);
+            m->SetElement(0,1,t0);
+            m->SetElement(1,1,t1);
+            m->SetElement(2,1,t2);
+            m->SetElement(3,1,t3);
+            fscanf(ff,"%f %f  %f %f\n",&t0,&t1,&t2,&t3);
+            m->SetElement(0,2,t0);
+            m->SetElement(1,2,t1);
+            m->SetElement(2,2,t2);
+            m->SetElement(3,2,t3);
+            fscanf(ff,"%f %f  %f %f\n",&t0,&t1,&t2,&t3);
+            m->SetElement(0,3,t0);
+            m->SetElement(1,3,t1);
+            m->SetElement(2,3,t2);
+            m->SetElement(3,3,t3);
+            t->Update();
+
+            mBox->bbSetOutputActualPoint( mActualPoint );
+            mBox->bbSignalOutputModification(std::string("ActualPoint"));
+            mBox->bbSetOutputOut( t );
+            mBox->bbSignalOutputModification(std::string("Out"));
+
+            fclose(ff);
+        } else {   // else ff
+            printf("TransformWidgetPanel::OnLoad  ...Error... reading file \n");
+        } //ff
+    }     // dialog box
+
+}
+
+
 void TransformWidgetPanel::OnMemoryGoBack(wxCommandEvent& event)
 {
     mActualPoint = mMemoryPoint;
index f490cbbd2ad4caac60cbb25d59a290c87d73f335..93c0ed869bd8a2e73581abd089d730b6c79e4cf8 100644 (file)
@@ -54,6 +54,7 @@
 
        wxMaracas_ViewerWidget::wxMaracas_ViewerWidget(wxWindow *parent, vtkImageData* imagedata, int type, vtkMPRBaseData *vtkmprbasedata,bool TDxWindow)
                : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
+//EED 2023-10-10        : wxPanel( parent, -1, wxDefaultPosition, wxSize(10,10) , wxTAB_TRAVERSAL)
        {
                wxPanel                         *panel                                          = this;
                wxWindow                        *wxwindow                                       = NULL;
@@ -66,8 +67,6 @@
                //RaC 03-2010 Adding a tab
                wxPanel                         *controlPanelClippingVol3D      = NULL;
 
-               wxBoxSizer *sizer                                                               = 0;
-
                mType = type;
 
                if (vtkmprbasedata==NULL)
                        window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
 
 //--
-                       wxNotebook *notebook            = new wxNotebook(panelClipping3D, -1);
+//EED 2023-10-10                       wxNotebook *notebook            = new wxNotebook(panelClipping3D, -1,wxDefaultPosition, wxSize(10,10));
+            wxNotebook *notebook         = new wxNotebook(panelClipping3D, -1,wxDefaultPosition, wxSize(10,10));
 
                        // First tab
                        controlPanelMPR3D                       = mwxvtkmpr3Dview->CreateControlPanel(notebook, true);
                        wxWindow                *window3D                       = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
                        wxPanel                 *panelControl           = new wxPanel(panelClipping3D,-1);
                        wxPanel                 *controlPanelMPR3D      = mwxvtkmpr3Dview->CreateControlPanel(panelControl, true);
-                       wxFlexGridSizer *sizerCtrol             = new wxFlexGridSizer(1);
-                       sizerCtrol->Add(controlPanelMPR3D, 1, wxALL|wxEXPAND, 2);
-
+            
+//2023/1010                    wxFlexGridSizer *sizerCtrol             = new wxFlexGridSizer(1);
+//                     sizerCtrol->Add(controlPanelMPR3D, 1, wxALL|wxEXPAND, 2);
+            wxBoxSizer *sizerCtrol          = new wxBoxSizer(wxHORIZONTAL);
+            sizerCtrol->Add(controlPanelMPR3D, 1, wxGROW, 2);
+
+            
+            
                        panelControl->SetAutoLayout(true);
                        panelControl->SetSizer(sizerCtrol);
                        panelControl->SetSize(400,350);
                        wxwindow = (wxWindow*) mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
                }
 
-       sizer = new wxBoxSizer(wxVERTICAL);
+        wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
+        //EED 2023-10-10        wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
+
        sizer->Add( wxwindow, 1, wxGROW);
        panel->SetSizer(sizer);
        panel->SetAutoLayout(true);
index 55aa58f5de817d3fab15cce7c4471954bc7ddfd9..ef538d40f592b77b19cfa8cbde3a7e05bf82c1d8 100644 (file)
@@ -29,7 +29,8 @@
 #include <wx/combobox.h>
 
 wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DView *wxvtkmpr3Dview, bool align )
-: wxPanel(parent, -1)
+//: wxPanel(parent, -1,wxDefaultPosition,wxDefaultSize)
+: wxPanel(parent, -1,wxDefaultPosition,wxSize(10,10) )
 {
        wxPanel *panel  = this;
        _wxvtkmpr3Dview = wxvtkmpr3Dview;
@@ -56,13 +57,13 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV
        _ckBoxX                                         = new wxCheckBox(panel,-1,_T("X   "));
        _positionX                                      = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
        _ckBoxY                                         = new wxCheckBox(panel,-1,_T("Y   "));
-       _positionY                                      = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
+    _positionY                    = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
        _ckBoxZ                                         = new wxCheckBox(panel,-1,_T("Z   "));
-       _positionZ                                      = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
+        _positionZ                    = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
 
        _ckBoxXYZ                                       = new wxCheckBox(panel,-1,_T("3D Axis  "));
        _ckBoxFixAxis2D                         = new wxCheckBox(panel,-1,_T("2D Fix Axis"));
-       _opacityAxis                            = new wxSlider(panel,-1,99,0,100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
+    _opacityAxis                               = new wxSlider(panel,-1,99,0,100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
 
        _ckBoxPlane                                     = new wxCheckBox(panel,-1,_T("Plane"));
 ////EED 05Nov2012      _ckBox_BW_Color_Plane           = new wxCheckBox(panel,-1,_T("GL/Color"));
@@ -113,9 +114,9 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV
        _rdBackGroundBlack->SetValue(false);
        _rdBackGroundWhite->SetValue(false);
 
-       _positionX->SetSize(400,20);
-       _positionY->SetSize(400,20);
-       _positionZ->SetSize(400,20);
+//     _positionX->SetSize(400,20);
+//     _positionY->SetSize(400,20);
+//     _positionZ->SetSize(400,20);
 
        // Stereo
        _cbStereo = new wxComboBox(panel, -1, _T(""), wxDefaultPosition, wxDefaultSize, 0, NULL,wxCB_READONLY );        
@@ -324,15 +325,15 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV
 
        panel->ClearBackground();
 //     panel->SetSize(400,50);
-       sizer->FitInside(panel);
-       panel->SetAutoLayout(true);
+//     sizer->FitInside(panel);
        panel->SetSizer(sizer);
+    panel->SetAutoLayout(true);
        panel->Layout();
 
        panel->SetEventHandler((wxEvtHandler*)this);
        
        //this->UpdateControlPanel();
-               
+    Layout();
 }
 
 //-------------------------------------------------------------------