]> Creatis software - creaMaracasVisu.git/commitdiff
#3475 wxVtkBaseView export parameters Point Normal
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 29 Nov 2021 14:20:44 +0000 (15:20 +0100)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 29 Nov 2021 14:20:44 +0000 (15:20 +0100)
bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx
bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h

index 9a7c660..27a43f4 100644 (file)
@@ -33,10 +33,10 @@ void wxVtkBaseView_Info::Process()
        {
                bbSetOutputvtkRenderer( bbGetInputwxVtkBaseView()->GetRenderer() );
                bbSetOutputDirection( bbGetInputwxVtkBaseView()->GetDirection() );
-
                vtkBaseData *vtkbasedata = bbGetInputwxVtkBaseView()->GetVtkBaseData();
                if (vtkbasedata!=NULL)
                {
+                   printf(" wxVtkBaseView_Info::Process %f %f %f\n",  vtkbasedata->GetX(), vtkbasedata->GetY(), vtkbasedata->GetZ() );
                        marImageData *marimagedata = vtkbasedata->GetMarImageData();
                        if (marimagedata!=NULL)
                        {
@@ -46,22 +46,32 @@ void wxVtkBaseView_Info::Process()
                        LstWindowColorLevel.push_back( vtkbasedata->GetColorWindow() );
                        LstWindowColorLevel.push_back( vtkbasedata->GetColorLevel() );
                        bbSetOutputWindowColorLevel( LstWindowColorLevel );
-                       bbSetOutputInterpolation( vtkbasedata->GetInterpolate() );
                        
+                       std::vector<double> lstPoint;
+                       lstPoint.push_back( vtkbasedata->GetX() );
+                       lstPoint.push_back( vtkbasedata->GetY() );
+                       lstPoint.push_back( vtkbasedata->GetZ() );
+                       bbSetOutputPoint( lstPoint );
+
+                       double normal[3];
+                       std::vector<double> lstNormal;
+                       bbGetInputwxVtkBaseView()->GetNormal( normal );
+                       lstNormal.push_back( normal[0] );
+                       lstNormal.push_back( normal[1] );
+                       lstNormal.push_back( normal[2] );
+                       bbSetOutputNormal( lstNormal );
+                       
+                       bbSetOutputInterpolation( vtkbasedata->GetInterpolate() );                      
                }  // BaseData
        }
-
-
 }
 //===== 
 // 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 wxVtkBaseView_Info::bbUserSetDefaultValues()
 {
-
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
-
        std::vector<double> LstWindowColorLevel;
        LstWindowColorLevel.push_back( 1000 );
        LstWindowColorLevel.push_back( 500 );
@@ -69,7 +79,6 @@ void wxVtkBaseView_Info::bbUserSetDefaultValues()
     bbSetOutputDirection(2);
     bbSetOutputInterpolation(true);
     bbSetOutputvtkRenderer(NULL);
-  
 }
 //===== 
 // 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 379860a..4a32c0f 100644 (file)
@@ -27,6 +27,8 @@ class bbcreaMaracasVisu_EXPORT wxVtkBaseView_Info
   BBTK_DECLARE_OUTPUT(Image,vtkImageData*);
   BBTK_DECLARE_OUTPUT(WindowColorLevel,std::vector<double>);
   BBTK_DECLARE_OUTPUT(Interpolation,bool);
+  BBTK_DECLARE_OUTPUT(Point,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Normal,std::vector<double>);
   
   BBTK_PROCESS(Process);
   void Process();
@@ -48,6 +50,8 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(wxVtkBaseView_Info,bbtk::AtomicBlackBox);
   BBTK_OUTPUT(wxVtkBaseView_Info,Image,"vtkImageData",vtkImageData*,"");
   BBTK_OUTPUT(wxVtkBaseView_Info,WindowColorLevel,"List [Window, Level]",std::vector<double>,"");
   BBTK_OUTPUT(wxVtkBaseView_Info,Interpolation,"(default true) true/false",bool,"");
+  BBTK_OUTPUT(wxVtkBaseView_Info,Point,"Axis positon of the viewer",std::vector<double>,"");
+  BBTK_OUTPUT(wxVtkBaseView_Info,Normal,"Normal of plane viewe",std::vector<double>,"");
 
 BBTK_END_DESCRIBE_BLACK_BOX(wxVtkBaseView_Info);
 //===== 
index dfc8472..3fdede1 100644 (file)
@@ -151,6 +151,18 @@ int vtkBaseData::GetT()
        return _t;
 }
 
+//-------------------------------------------------------------------
+double vtkBaseData::GetX()  // virtual
+{
+       return 0;
+}
+//-------------------------------------------------------------------
+double vtkBaseData::GetY()  // virtual
+{
+       return 0;
+}
+
+
 //-------------------------------------------------------------------
 void vtkBaseData::SetT(double t)
 {
index 4047fc9..de5b86c 100644 (file)
@@ -44,6 +44,8 @@ public:
        void                    SetZ(double z);
        int                             GetT();
        void                    SetT(double t);
+       virtual                 double GetX();
+       virtual                 double GetY();
        void                    SetColorWindow(double colorWindow);
        void                    SetColorLevel(double colorLevel);       
        double                  GetColorWindow();
@@ -58,6 +60,7 @@ public:
        double                  GetCameraParallelScale();
        void                    SetCameraParallelScale(double value);
 
+
 protected:
        marImageData    *_marImageData;
        double                  _z;
index 42b8651..4d9a3ed 100644 (file)
@@ -418,6 +418,30 @@ int wxVtk2DBaseView::GetDirection() // virtual
     return 2;
 }
 
+//-------------------------------------------------------------------
+void wxVtk2DBaseView::GetNormal(double normal[3] ) // virtual
+{
+       if (GetDirection()==0 ) 
+       {
+               normal[0]=1;
+               normal[1]=0;
+               normal[2]=0;
+       } // if
+       if (GetDirection()==1 ) 
+       {
+               normal[0]=0;
+               normal[1]=1;
+               normal[2]=0;
+       } // if
+       if (GetDirection()==2 ) 
+       {
+               normal[0]=0;
+               normal[1]=0;
+               normal[2]=1;
+       } // if
+}
+
+
 //-------------------------------------------------------------------
 void wxVtk2DBaseView::SetOpacityText(double opacity)
 {
index 784f2e6..2e3b712 100644 (file)
@@ -61,7 +61,9 @@ public:
        void SetColorLevel(double level);
        void SetInterpolate(bool iterpolate);
        
-   virtual int GetDirection();
+    virtual int GetDirection();
+    virtual void GetNormal(double normal[3] );
+    
        void SetImageToVtkViewer(vtkImageData *imageData);
        
        //EED 01nov2012
index 6c58988..763931d 100644 (file)
@@ -210,11 +210,17 @@ void wxVtkBaseView::SetInteractorStyleBaseView( vtkInteractorStyleImage*  interac
 
 void wxVtkBaseView::GetSpacing(double spc[3])  // virtual
 {
-       spc[0]=1;
-       spc[1]=1;
-       spc[2]=1;
+       spc[0] = 1;
+       spc[1] = 1;
+       spc[2] = 1;
 }
 
+void wxVtkBaseView::GetNormal(double normal[3])  // virtual
+{
+       normal[0] = 0;
+       normal[1] = 0;
+       normal[2] = 0;
+}
 
 //---------------------------------------------------------------------------
 int  wxVtkBaseView::GetDirection()   // virtual 
index 54d036f..24515d0 100644 (file)
@@ -93,6 +93,7 @@ public:
        virtual int                                     GetDirection();
        vtkBaseData*                            GetVtkBaseData();
        void                                            SetVtkBaseData(vtkBaseData *vtkbasedata);
+       virtual void                            GetNormal(double nomal[3]);
 
 private:
        wxWindow                                                        *_parent;