]> Creatis software - creaVtk.git/commitdiff
#3150 PointPicker box
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 17 Nov 2021 12:44:33 +0000 (13:44 +0100)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 17 Nov 2021 12:44:33 +0000 (13:44 +0100)
bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.h

index 0d75b953cdbb85b06199b70e5e6d4834c2d8e1d8..69c4c02eb71c54d4044dbec818573c41f26b4271 100644 (file)
@@ -14,12 +14,12 @@ namespace bbcreaVtk
 
 creaVtkCallbackPointPicker::creaVtkCallbackPointPicker(void)
 {
-       boxPointPicker=NULL;
+       boxPointPicker = NULL;
 }
 
 void creaVtkCallbackPointPicker::setBox(PointPicker *box)
 {
-       boxPointPicker=box;
+       boxPointPicker = box;
 }
 
 void creaVtkCallbackPointPicker::Execute(vtkObject *caller, unsigned long, void*)
@@ -33,6 +33,13 @@ void creaVtkCallbackPointPicker::Execute(vtkObject *caller, unsigned long, void*
                        int* pos = iren->GetEventPosition();
                    vtkCellPicker *picker = vtkCellPicker::New();
                    picker->SetTolerance(0.0005);
+                   
+                   if (boxPointPicker->bbGetInputProp3D()!=NULL ) 
+                   {
+                       picker->AddPickList( boxPointPicker->bbGetInputProp3D() );
+                       picker->PickFromListOn();
+                       }                   
+                   
                    picker->Pick(pos[0], pos[1], 0, iren->GetRenderWindow()->GetRenderers()->GetFirstRenderer() );
                        double point[3];
 
@@ -217,6 +224,7 @@ void PointPicker::bbUserSetDefaultValues()
        bbSetOutputCellId(-1);
        firsttime=true;
        callPicker=NULL;
+       bbSetInputProp3D(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 94c9d376d7ececb1d289e03e7e19a44497269f2c..7d3d8538615821c84da3a2e7cdaa58d5eab18394 100644 (file)
@@ -52,6 +52,7 @@ class bbcreaVtk_EXPORT PointPicker
   BBTK_DECLARE_INPUT(Active,bool);
   BBTK_DECLARE_INPUT(TypeEvent,int );
   BBTK_DECLARE_INPUT(Renderer,vtkRenderer*);
+  BBTK_DECLARE_INPUT(Prop3D,vtkProp3D*);
   BBTK_DECLARE_OUTPUT(Point,std::vector<double>);
   BBTK_DECLARE_OUTPUT(Mesh,vtkProp3D*);
   BBTK_DECLARE_OUTPUT(PointId,longInt);
@@ -76,6 +77,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(PointPicker,bbtk::AtomicBlackBox);
   BBTK_INPUT(PointPicker,Active,"(true default)  true/false",bool,"");
   BBTK_INPUT(PointPicker,TypeEvent,"(0 default) 0:NOTHING,  1:MouseMoveEvent  2:LeftButtonPressEvent  3:LeftButtonDoubleClickEvent",int,"");
   BBTK_INPUT(PointPicker,Renderer,"vtk Renderer",vtkRenderer*,"");
+  BBTK_INPUT(PointPicker,Prop3D,"vtkProp3D de reference. If this parameter is empty all actors in the render are used",vtkProp3D*,"");
 
   BBTK_OUTPUT(PointPicker,Point,"Point (double)",std::vector<double>,"");
   BBTK_OUTPUT(PointPicker,Mesh,"Mesh",vtkProp3D*,"");