]> Creatis software - creaVtk.git/blobdiff - bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.cxx
#3150 PointPicker box
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkPointPicker.cxx
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)