]> 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 9a7c6600681ca7a618ac19a22b5d146b881272c0..27a43f46cf24e3627d878902f262d83fdd938058 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 379860abb8c5278fb65c1690b38acb2c58525ebe..4a32c0fa3ded1b974b6a3e73ac8f5a3e9d63a502 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 dfc847270e8e5f066b60dfd036eae91d10b3cf4d..3fdede1c3321314b05106ab65e8687c7c9ee42a4 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 4047fc9636920d00efcac3ef5985def86e91977a..de5b86cf3560cfdc5d3d4bede2e5854748bd4c9b 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 42b8651bc6ebbdc11f01436c6df7ae6d04269f05..4d9a3ed0511d8ccbcf71438aa15091091cdcf6e5 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 784f2e682eb24f60dab743f4422a95f09c047d71..2e3b7121c2f7ecee97b437e10473d4fe9a0b3cc7 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 6c589886394c482446749aaa14f6726f947623c7..763931dea7f461185bc2d0df530b6495fc4e6563 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 54d036f6f4fa5e24800dcca748bed976277ea5b8..24515d083c1e07209f0f0572df9b02734052af11 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;