]> Creatis software - creaContours.git/commitdiff
#3400 nDimensions for JavaScript vtk9itk5wx3-macos
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 17 Jun 2025 13:13:11 +0000 (15:13 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 17 Jun 2025 13:13:11 +0000 (15:13 +0200)
bbtk/src/bbCreaContournDimensions.h
bbtk/src/bbcreaContoursOnSave.cxx
bbtk/src/bbcreaContourswxContourMainFrame_tool.cxx
bbtk/src/bbcreaContourswxContourMainFrame_tool.h

index dbd6e6e20f3f0d04bef5ded590cc319b249cbf56..0080cd17a45640e216cfb81f76eee5f393fd9084 100644 (file)
@@ -75,7 +75,7 @@ private:
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(nDimensions, bbtk::WxBlackBox);
   BBTK_NAME("nDimensions");
   BBTK_AUTHOR("car-prie@uniandes.edu.co");
-  BBTK_DESCRIPTION("With a given image, the box shows the nDimension application");
+  BBTK_DESCRIPTION("(C++) With a given image, the box shows the nDimension application");
   BBTK_CATEGORY("contours");
   BBTK_INPUT(nDimensions,WorkDir,"Working data directory where config and data files are located",std::string,"");
   BBTK_INPUT(nDimensions,In,"Image to be shown",vtkImageData*,"");
index b067e6e4feb20794c3c6ea609a7f2507ef51dd75..67f999cfaa617306c39078c591d9554c8c6b4cbf 100644 (file)
@@ -32,8 +32,6 @@ void OnSave::Process()
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
   
-
-
                if (wxContourMainFrame::getInstance()!=NULL)
                {
                        if ( wxContourMainFrame::getInstance()->GetFileLocation().empty()==false )
@@ -42,43 +40,39 @@ void OnSave::Process()
                        } // if FileLocation
                } // if getInstance
 }
-//===== 
+
+//=====
 // 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 OnSave::bbUserSetDefaultValues()
 {
-
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
 //   bbSetInputIn(0);
-  
 }
-//===== 
+
+//=====
 // 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 OnSave::bbUserInitializeProcessing()
 {
-
 //  THE INITIALIZATION METHOD BODY :
 //    Here does nothing 
 //    but this is where you should allocate the internal/output pointers 
-//    if any 
-
-  
+//    if any
 }
-//===== 
+
+//=====
 // 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 OnSave::bbUserFinalizeProcessing()
 {
-
 //  THE FINALIZATION METHOD BODY :
 //    Here does nothing 
 //    but this is where you should desallocate the internal/output pointers 
 //    if any
-  
 }
-}
-// EO namespace bbcreaContours
+
+}// EO namespace bbcreaContours
 
 
index ae33330d21fa6429307e313ecf3ddfdf2e725cd5..e71eb2ac0270fc12e28f1d6361fcf0bcfa5249ea 100644 (file)
@@ -4,8 +4,6 @@
 #include "bbcreaContourswxContourMainFrame_tool.h"
 #include "bbcreaContoursPackage.h"
 
-#include "wxContourMainFrame.h"
-
 namespace bbcreaContours
 {
 
@@ -16,7 +14,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(wxContourMainFrame_tool,bbtk::AtomicBlackBox);
 //===== 
 void wxContourMainFrame_tool::Process()
 {
-    printf("EED wxContourMainFrame_tool::Process start type=%d \n", bbGetInputType() );
 // THE MAIN PROCESSING METHOD BODY
 //   Here we simply set the input 'In' value to the output 'Out'
 //   And print out the output value
@@ -89,9 +86,34 @@ void wxContourMainFrame_tool::Process()
         {
             wxContourMainFrame::getInstance()->ResetCamera();
         } // Type 3
+        
+        // OnSave
+        if (bbGetInputType()==4)
+        {
+            if (wxContourMainFrame::getInstance()!=NULL)
+            {
+                if ( wxContourMainFrame::getInstance()->GetFileLocation().empty()==false )
+                {
+                    wxContourMainFrame::getInstance()->onSave();
+                } // if FileLocation
+            } // if getInstance
+        } // Type 4
+
+        // OnRead
+        if (bbGetInputType()==5)
+        {
+            // Todo....   implementd in JavaScript
+        } // Type 5
+
+        // GetContours
+        if (bbGetInputType()==6)
+        {
+            // Todo....   implementd in JavaScript
+        } // Type 6
+        
+
+
     } // if wxContourMainFrame::getInstance()!=NULL
-    
-    printf("EED wxContourMainFrame_tool::Process end\n" );
 
 }
 //===== 
@@ -103,6 +125,7 @@ void wxContourMainFrame_tool::bbUserSetDefaultValues()
 //    Here we initialize the input 'In' to 0
    bbSetInputType(0);
    bbSetInputImage(NULL);
+   bbSetInputwxContourMainFrame(NULL);
 }
 
 //=====
index ceb5410ae01e2c4aa12cf6e3cf721047df92dd8f..87fc72f816e4377a1e9ae3318552898682532cab 100644 (file)
@@ -9,6 +9,7 @@
 #include "iostream"
 
 #include "vtkImageData.h"
+#include "wxContourMainFrame.h"
 
 namespace bbcreaContours
 {
@@ -21,10 +22,16 @@ class bbcreaContours_EXPORT wxContourMainFrame_tool
 //===== 
 // 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)
 //===== 
-  BBTK_DECLARE_INPUT( Type  , int                       );
-  BBTK_DECLARE_INPUT( Param1, std::vector<double>       );
-  BBTK_DECLARE_INPUT( Image , vtkImageData*             );
-  BBTK_DECLARE_OUTPUT( Out , std::vector<std::string>   );
+  BBTK_DECLARE_INPUT( Type              , int                       );
+  BBTK_DECLARE_INPUT( Param1            , std::vector<double>       );
+  BBTK_DECLARE_INPUT( Param2            , std::vector<std::string>  );
+  BBTK_DECLARE_INPUT( Image             , vtkImageData*             );
+  BBTK_DECLARE_INPUT( wxContourMainFrame, wxContourMainFrame*       );
+  BBTK_DECLARE_OUTPUT( Out              , std::vector<std::string>  );
+  BBTK_DECLARE_OUTPUT( LstIndexs        , std::vector<int>          );
+  BBTK_DECLARE_OUTPUT( LstControlPointsX, std::vector<double>       );
+  BBTK_DECLARE_OUTPUT( LstControlPointsY, std::vector<double>       );
+  BBTK_DECLARE_OUTPUT( LstControlPointsZ, std::vector<double>       );
 
 //  BBTK_DECLARE_OUTPUT(Out,double);
   BBTK_PROCESS(Process);
@@ -37,12 +44,18 @@ class bbcreaContours_EXPORT wxContourMainFrame_tool
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(wxContourMainFrame_tool,bbtk::AtomicBlackBox);
   BBTK_NAME("wxContourMainFrame_tool");
   BBTK_AUTHOR("InfoDev");
-  BBTK_DESCRIPTION("No Description.");
+  BBTK_DESCRIPTION("(C++,JavaScript) (type4 in JavaScript) No Description.");
   BBTK_CATEGORY("empty");
-  BBTK_INPUT(wxContourMainFrame_tool,Type,"(default 0) Type 0:nothing  1:Isovalue segmentation of Image   2:Isovalue segmentation actual slice, 3:Reset Camera ",int,"");
-  BBTK_INPUT(wxContourMainFrame_tool,Param1,"List of parameters  Type1:[step,isovalue,sampling,method,x,y,min,max] Replace all old contours     Type2:[isovalue,sampling,method,iSlice,x,y] Replace acutal slice    ", std::vector<double>,"");
+  BBTK_INPUT(wxContourMainFrame_tool,Type,"(default 0) Type 0:nothing  1:Isovalue segmentation of Image,   2:Isovalue segmentation actual slice, 3:Reset Camera, 4:OnSave, 5:OnRead (JavaScript) 6:GetContours (JavaScript)",int,"");
+  BBTK_INPUT(wxContourMainFrame_tool,Param1,"List of parameters (vector double)  Type1:[step,isovalue,sampling,method,x,y,min,max] Replace all old contours     Type2:[isovalue,sampling,method,iSlice,x,y] Replace acutal slice    ", std::vector<double>,"");
+  BBTK_INPUT(wxContourMainFrame_tool,Param2,"List of parameters (vector string)  Type 4:Filename (JavaScript)  Type 5:FileName (JavaScript)  ", std::vector<std::string>,"");
   BBTK_INPUT(wxContourMainFrame_tool,Image,"Image", vtkImageData*,"");
-  BBTK_OUTPUT(wxContourMainFrame_tool,Out,"Type 4: Position of viewer ", std::vector<std::string>,"");
+  BBTK_INPUT(wxContourMainFrame_tool, wxContourMainFrame, "wxContourMainFrame (used in JavaScript)", wxContourMainFrame*, "");
+  BBTK_OUTPUT(wxContourMainFrame_tool,Out,"  ", std::vector<std::string>,"");
+  BBTK_OUTPUT(wxContourMainFrame_tool,LstIndexs,"  ", std::vector<int>,"");
+  BBTK_OUTPUT(wxContourMainFrame_tool,LstControlPointsX,"  ", std::vector<double>,"");
+  BBTK_OUTPUT(wxContourMainFrame_tool,LstControlPointsY,"  ", std::vector<double>,"");
+  BBTK_OUTPUT(wxContourMainFrame_tool,LstControlPointsZ,"  ", std::vector<double>,"");
 BBTK_END_DESCRIBE_BLACK_BOX(wxContourMainFrame_tool);
 //===== 
 // 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)