]> Creatis software - creaMaracasVisu.git/blobdiff - bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx
#3481 wxVtkBaseView_Info add events mouse observer
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuwxVtkBaseView_Info.cxx
index afbdaaafad8a17159394d7dba998e2141f932e20..6e1f6cd0cd32ca22393c2f19584b01ddf1723f45 100644 (file)
@@ -50,10 +50,8 @@ InteractorwxVtkBaseView::~InteractorwxVtkBaseView()
 
 bool InteractorwxVtkBaseView::OnLeftButtonDown()
 {
-    printf("EED InteractorwxVtkBaseView::OnLeftButtonDown \n");
     if ( _box->bbGetInputInteractionType()==8 )
     {
-        printf("EED InteractorwxVtkBaseView::OnLeftButtonDown 1\n");
         flagDrag=true;
     }
     if ( (_box->bbGetInputInteractionType()==1 ) && (_wxvtkbaseview!=NULL) )
@@ -67,10 +65,8 @@ bool InteractorwxVtkBaseView::OnLeftButtonDown()
 
 bool InteractorwxVtkBaseView::OnLeftButtonUp()
 {
-    printf("EED InteractorwxVtkBaseView::OnLeftButtonUp \n");
     if ( _box->bbGetInputInteractionType()==8 )
     {
-        printf("EED InteractorwxVtkBaseView::OnLeftButtonUp 1\n");
         flagDrag=false;
     }
     if ( (_box->bbGetInputInteractionType()==2 ) && (_wxvtkbaseview!=NULL) )
@@ -86,7 +82,6 @@ bool InteractorwxVtkBaseView::OnMouseMove()
 {
     int intFlag;
     if (flagDrag==true) intFlag=1; else intFlag=0;
-    printf("EED InteractorwxVtkBaseView::OnMouseMove Start this=%p  type=%d  flag=%d\n", this, _box->bbGetInputInteractionType() ,intFlag);
     bool ok=false;
     if ( (_box->bbGetInputInteractionType()==3 ) && (_wxvtkbaseview!=NULL) )
     {
@@ -102,12 +97,10 @@ bool InteractorwxVtkBaseView::OnMouseMove()
     } // if InteractionType 9
     if (ok==true)
     {
-        printf("EED InteractorwxVtkBaseView::OnMouseMove 1\n");
         _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
         _box->bbSignalOutputModification();
         return false;
     } // if ok
-    printf("EED InteractorwxVtkBaseView::OnMouseMove End\n");
     return true;
 }
 
@@ -144,10 +137,8 @@ bool InteractorwxVtkBaseView::OnRightButtonUp()
 
 bool InteractorwxVtkBaseView::OnLeftDClick()
 {
-    printf("EED InteractorwxVtkBaseView::OnLeftDClick Start this=%p\n", this);
     if ( (_box->bbGetInputInteractionType()==6 ) && (_wxvtkbaseview!=NULL) )
     {
-        printf("EED InteractorwxVtkBaseView::OnLeftDClick 1\n");
         _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
         _box->bbSignalOutputModification();
         return false;
@@ -157,10 +148,8 @@ bool InteractorwxVtkBaseView::OnLeftDClick()
 
 bool InteractorwxVtkBaseView::OnRightDClick()
 {
-    printf("EED InteractorwxVtkBaseView::OnRightDClick Start\n");
     if ( (_box->bbGetInputInteractionType()==7 ) && (_wxvtkbaseview!=NULL) )
     {
-        printf("EED InteractorwxVtkBaseView::OnRightDClick 1\n");
         _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
         _box->bbSignalOutputModification();
         return false;
@@ -177,8 +166,6 @@ void wxVtkBaseView_Info::SetwxVtkBaseViewOutputs(wxVtkBaseView *wxvtkbaseview )
 {
     if (wxvtkbaseview!=NULL)
     {
-        printf("EED wxVtkBaseView_Info::SetwxVtkBaseViewOutputs this=%p\n",this);
-        printf("EED wxVtkBaseView_Info::SetwxVtkBaseViewOutputs %s \n", bbGetFullName().c_str() );
         bbSetOutputvtkRenderer( wxvtkbaseview->GetRenderer() );
         bbSetOutputDirection( wxvtkbaseview->GetDirection() );
         vtkBaseData *vtkbasedata = wxvtkbaseview->GetVtkBaseData();
@@ -199,7 +186,14 @@ void wxVtkBaseView_Info::SetwxVtkBaseViewOutputs(wxVtkBaseView *wxvtkbaseview )
             lstPoint.push_back( vtkbasedata->GetY() );
             lstPoint.push_back( vtkbasedata->GetZ() );
             bbSetOutputPoint( lstPoint );
-            printf("EED wxVtkBaseView_Info::SetwxVtkBaseViewOutputs point = %f %f %f\n",lstPoint[0],lstPoint[1],lstPoint[2] );
+
+            int pointMouseX,pointMouseY,pointMouseZ;
+            vtkbasedata->GetPointMouse(pointMouseX,pointMouseY,pointMouseZ); 
+            std::vector<double> lstPointMouse;
+            lstPointMouse.push_back( pointMouseX );
+            lstPointMouse.push_back( pointMouseY );
+            lstPointMouse.push_back( pointMouseZ );
+            bbSetOutputPointMouse( lstPointMouse );
 
             double normal[3];
             std::vector<double> lstNormal;
@@ -230,23 +224,16 @@ void wxVtkBaseView_Info::Process()
 //      (the one provided in the attribute 'name' of the tag 'input')
 //    * TYPE is the C++ type of the input/output
 //      (the one provided in the attribute 'type' of the tag 'input')
-    
-    
-   
-    printf("EED wxVtkBaseView_Info::Process Start\n");
-
     if (bbGetInputInteractionType()==0)
     {
         SetwxVtkBaseViewOutputs( bbGetInputwxVtkBaseView() );
     }
-    
     if (firsttime==true)
     {
         firsttime=false;
         if (bbGetInputInteractionType()!=0)
         {
             SetwxVtkBaseViewOutputs( bbGetInputwxVtkBaseView() );
-
             if (bbGetInputwxVtkBaseView()!=NULL)
             {
                 InteractorwxVtkBaseView     *interactorwxvtkbaseview    = new InteractorwxVtkBaseView( this, bbGetInputwxVtkBaseView()  );
@@ -267,9 +254,6 @@ void wxVtkBaseView_Info::Process()
             } // if wxVtkBaseView3
         } // if InteractionType !=0
     } // if firsttime
-
-    printf("EED wxVtkBaseView_Info::Process end\n");
-
 }
 
 //=====