]> Creatis software - creaContours.git/commitdiff
Clean code
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 4 Nov 2024 12:21:33 +0000 (13:21 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 4 Nov 2024 12:21:33 +0000 (13:21 +0100)
bbtk/src/bbcreaContoursSetViewerPosition.cxx
bbtk/src/bbcreaContourswxContourMainFrame_tool.h
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h

index ac9b9b91e9af9ee13726577914c0a187b3500870..88b7058769b0c6de1ff1719f36fe40def14f56e1 100644 (file)
@@ -29,12 +29,13 @@ void SetViewerPosition::Process()
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
   
-       if (bbGetInputPosition().size()==3 )
+       if ( bbGetInputPosition().size()==3 )
        {
                int x = bbGetInputPosition()[0];
                int y = bbGetInputPosition()[1];
                int z = bbGetInputPosition()[2];
-               if ((backX!=x) || (backY!=y) || (backZ!=z) )   // this prevent to finish contour before start  :-)
+
+        if ((backX!=x) || (backY!=y) || (backZ!=z) )   // this prevent to finish contour before start  :-)
                {
                        if (bbGetInputwxContourMainFrame()!=NULL)
                        {
@@ -57,6 +58,7 @@ void SetViewerPosition::Process()
                                        slice = round( slice/bbGetInputJump() ) * bbGetInputJump() + bbGetInputShift();
                                        bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", slice );
                                        bbGetInputwxContourMainFrame()->SetXY(x,dimY-z-1);
+                    printf("EED SetViewerPosition::Process flag2    %d %d %d\n",x,y,z);
                                } // if Direction1
 
                                if (bbGetInputDirection()==2)
@@ -69,9 +71,9 @@ void SetViewerPosition::Process()
                                bbGetInputwxContourMainFrame()->showAxis(true);
                                bbGetInputwxContourMainFrame()->changeInstant();
                                bbGetInputwxContourMainFrame()->RefreshInterface();
-                               backX=x;
-                               backY=y;
-                               backZ=z;
+                               backX = x;
+                               backY = y;
+                               backZ = z;
                        } // if bbGetInputPosition
                } // if bbGetInputwxContourMainFrame
        } // if backX  backY  backZ
index edb6748a95eb47bd6ebabcc183433a6a185cb64e..ceb5410ae01e2c4aa12cf6e3cf721047df92dd8f 100644 (file)
@@ -21,9 +21,10 @@ 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_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_OUTPUT(Out,double);
   BBTK_PROCESS(Process);
@@ -38,10 +39,10 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(wxContourMainFrame_tool,bbtk::AtomicBlackBox);
   BBTK_AUTHOR("InfoDev");
   BBTK_DESCRIPTION("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",int,"");
+  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,Image,"Image", vtkImageData*,"");
-//  BBTK_OUTPUT(wxContourMainFrame_tool,Out,"First output",double,"");
+  BBTK_OUTPUT(wxContourMainFrame_tool,Out,"Type 4: Position of viewer ", std::vector<std::string>,"");
 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)
index 7d6bc02239c86aaff95eb781777a456e97d84c07..56414a17aba74019d4b7be38636efe851de5cc58 100644 (file)
 #include <vtkLookupTable.h>
 #include <vtkCommand.h>
 
-//#include "vtkMetaImageReader.h"
-
 //------------------------------------------------------------------------------------------------------------
 // Events declaration
 //------------------------------------------------------------------------------------------------------------
@@ -329,11 +327,9 @@ class wxContourMainFrame : public wxPanel {
        std::string GetStringTypeImage( vtkImageData* image);
 
 //------------------------------------------------------------------------------------------------------------
-       void SetXY(int x,int y);
-    
-    //------------------------------------------------------------------------------------------------------------
-    void                        ResetCamera();
-
+    // Use by BBTK boxes
+       void    SetXY(int x,int y);
+    void    ResetCamera();
 
 private:
        //------------------------------------------------------------------------------------------------------------