]> Creatis software - bbtk.git/commitdiff
#3518 Python descrition vtk9itk5wx3-macos
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Wed, 29 May 2024 08:34:20 +0000 (10:34 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Wed, 29 May 2024 08:34:20 +0000 (10:34 +0200)
kernel/src/bbtkWxBlackBox.cxx
packages/std/src/bbstdMagicBox.h
packages/std/src/bbstdReplaceCleanString.h
packages/vtk/src/bbvtkPlaneClipPolyData.cxx
packages/vtk/src/bbvtkTransform.cxx
packages/vtk/src/bbvtkTransform.h

index 8bf6f65548908d4d958790acfa8e046dae704bf6..46ed9b0f0b14eca3d4cdfeb0894396a3aa9b250b 100644 (file)
@@ -95,8 +95,8 @@ namespace bbtk
             wxCLOSE_BOX |
             wxMAXIMIZE_BOX | 
             wxMINIMIZE_BOX | 
-            wxCAPTION  
-            ),
+            wxCAPTION
+        ),
     mBox(b)
   {   
     bbtkDebugMessage("widget",9,"["<<b->bbGetName()<<"] WxFrame()"
@@ -304,9 +304,9 @@ printf("EED WxFrame::~WxFrame\n");
                     std2wx( ConstructWinTitle() ),
                     wxSize( bbGetInputWinWidth() , 
                             bbGetInputWinHeight() ) );
-    w->Show();
-
-
+    w->SetFocus();  // focus on my window
+    w->Raise();  // bring window to front
+    w->Show(true);
    }
 
   //==================================================================    
index 99d27e872937bd25399a12388379f56eb1ead0e5..20c964f72f4178e5d8d5a8013aaffc3598bded2b 100644 (file)
@@ -117,7 +117,7 @@ namespace bbstd
     (&MagicBox::bbGetInputIn),
     new MagicBoxSetFunctor (&MagicBox::bbSetInputIn) ) );
 
-  BBTK_INPUT(MagicBox, Active, "Active True/False (default True)",bool,"");  
+  BBTK_INPUT(MagicBox, Active, "(default True) Active True/False",bool,"");  
 
 
   AddOutputDescriptor
index d4c931b0c806b93db54a6d1da6fa364fbc92c35d..ebd2718c49d055f7ab2f2637aabf9e21d4bba191 100644 (file)
@@ -33,7 +33,7 @@ class bbstd_EXPORT ReplaceCleanString
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReplaceCleanString,bbtk::AtomicBlackBox);
  BBTK_NAME("ReplaceCleanString");
  BBTK_AUTHOR("InfoDev");
- BBTK_DESCRIPTION("No Description.");
+ BBTK_DESCRIPTION("(C++,Python) No Description.");
  BBTK_CATEGORY("empty");
  BBTK_INPUT(ReplaceCleanString,In,"Input string",std::string,"");
  BBTK_INPUT(ReplaceCleanString,Replace,"New string to be put",std::string,"");
index 9e63987690a16c1fcd6fb8757738a5505ffb18ca..07eafb70cd47c87542ae39e522b28aa2708621aa 100644 (file)
@@ -41,32 +41,29 @@ void PlaneClipPolyData::Process()
     bbSetOutputClippedPolyData(outPolydata);
 
    // std::cout << "RaC PlaneClipPolyData::Process END "<<polydataCopy<< std::endl;
-  
 }
-//===== 
+
+//=====
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
 void PlaneClipPolyData::bbUserSetDefaultValues()
 {
-
-  
 }
-//===== 
+
+//=====
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
 void PlaneClipPolyData::bbUserInitializeProcessing()
 {
-
-  
 }
-//===== 
+
+//=====
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
 void PlaneClipPolyData::bbUserFinalizeProcessing()
 {
-  
 }
-}
-// EO namespace bbvtk
+
+}// EO namespace bbvtk
 
 
index 8b71e0052137ffced07620883c868fcabab315e4..1b29f8b33f29ea910afc72bc93f180de6ad6f3ee 100644 (file)
 
 #include "bbvtkTransform.h"
 #include "bbvtkPackage.h"
+
 #include "vtkMath.h"
+#include "vtkMatrix4x4.h"
+
 namespace bbvtk
 {
   BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Transform);
@@ -130,16 +133,48 @@ namespace bbvtk
           result->RotateWXYZ( ang  , v3[0], v3[1], v3[2] );
       } // if rotation size >=4
 
+      if (bbGetInputManualMatrixIn().size()==16)
+      {
+          std::vector<double> manaulMatrixIn = bbGetInputManualMatrixIn();
+          vtkMatrix4x4* m = result->GetMatrix();
+          int i,j,ii=0;
+          for (j=0;j<4;j++)
+          {
+              for (i=0;i<4;i++)
+              {
+                  m->SetElement(i,j,manaulMatrixIn[ii]);
+                  ii++;
+              }// for i
+          } // for j
+          m->Modified();
+          result->Update();
+      } // ManualMatrix
+      
+      vtkTransform * finalTransform;
          if (bbGetInputInverse()==false)
          {
-               bbSetOutputOut(result);
+        finalTransform = result;
          } else {
                vtkMatrix4x4 *matrix;
                matrix=vtkMatrix4x4::New();
                result->GetInverse(matrix);
                resultInverse->SetMatrix( matrix );
-               bbSetOutputOut(resultInverse);
+               finalTransform = resultInverse;
          }  // if Inverse
+      
+      bbSetOutputOut(finalTransform);
+
+      std::vector<double> manualMatrixOut;
+      vtkMatrix4x4* m = finalTransform->GetMatrix();
+      int i,j,ii=0;
+      for (j=0;j<4;j++)
+      {
+          for (i=0;i<4;i++)
+          {
+              manualMatrixOut.push_back( m->GetElement(i,j) );
+          }// for i
+      } // for j
+      bbSetOutputManualMatrixOut( manualMatrixOut );
   }
   
 }// EO namespace bbvtk
index 46e1c766c6c83da018be478fd8bf05f3bfa6bca8..2a8d0cd7886accf5438c5e6c5083e88630ad2a92 100644 (file)
@@ -48,7 +48,9 @@ namespace bbvtk
     BBTK_DECLARE_INPUT(Translate,std::vector<double>);
     BBTK_DECLARE_INPUT(Spacing,std::vector<double>);
     BBTK_DECLARE_INPUT(RotateToNormal,std::vector<double>);
+    BBTK_DECLARE_INPUT(ManualMatrixIn,std::vector<double>);
     BBTK_DECLARE_OUTPUT(Out,vtkLinearTransform *);
+    BBTK_DECLARE_OUTPUT(ManualMatrixOut,std::vector<double>);
     BBTK_PROCESS(Process);
     void Process();
     
@@ -73,8 +75,10 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(Transform,bbtk::AtomicBlackBox);
   BBTK_INPUT(Transform,Spacing,"vector with spacingX spacingY spacingZ",std::vector<double>,"");
   BBTK_INPUT(Transform,RotateWXYZ,"vector with Angle Vx Vy Vz",std::vector<double>,"");
   BBTK_INPUT(Transform,RotateToNormal,"(default is EMPTY) Normal vector [nx,ny,nz]",std::vector<double>,"");
+  BBTK_INPUT(Transform,ManualMatrixIn,"(default EMPTY) The 16 elements of a 4x4 matrix",std::vector<double>,"");
 
   BBTK_OUTPUT(Transform,Out,"vtkTransform result",vtkLinearTransform *,"");
+  BBTK_OUTPUT(Transform,ManualMatrixOut,"The 16 elements of the 4x4 matrix",std::vector<double>,"");
 
 BBTK_END_DESCRIBE_BLACK_BOX(Transform);
 }