]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To implement picking for geometrical spheres represntation
authorapo <apo@opencascade.com>
Thu, 1 Dec 2005 11:48:43 +0000 (11:48 +0000)
committerapo <apo@opencascade.com>
Thu, 1 Dec 2005 11:48:43 +0000 (11:48 +0000)
src/OBJECT/VISU_GaussPtsAct.cxx
src/PIPELINE/VISU_GaussPointsPL.cxx
src/PIPELINE/VISU_GaussPointsPL.hxx

index 2d579106683ad738f64dde6b102beae8ca008041..592ccf2b8e1398c37cf878cc5e0f72b24c9a9b19 100644 (file)
@@ -192,8 +192,6 @@ VISU_GaussPtsAct
   Superclass::ShallowCopyPL(thePipeLine);
 
   VISU_GaussPointsPL* aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
-  //myDeviceActor->ShallowCopyPL(aPipeLine);
-  //myDeviceActor->GetPipeLine()->SetMagnification( aPipeLine->GetMagnification() );
 }
 
 
@@ -202,14 +200,14 @@ vtkMapper*
 VISU_GaussPtsAct
 ::GetMapper()
 {
-  return GetCurrentPL()->GetMapper();
+  return Superclass::GetMapper();
 }
 
 float* 
 VISU_GaussPtsAct
 ::GetBounds()
 {
-  return myDeviceActor->GetBounds();
+  return GetMapper()->GetBounds();
 }
 
 vtkDataSet* 
@@ -348,6 +346,9 @@ VISU_GaussPtsAct
 
   myDeviceActor->SetPipeLine(GetGaussPointsPL());
   myCurrentPL = myDeviceActor->GetPipeLine();
+
+  myMapper->SetInput(myCurrentPL->GetPickableDataSet());
+  SetMapper(myMapper.GetPointer());
 }
 
 void
@@ -494,9 +495,11 @@ bool VISU_GaussPtsAct::IsInfinitive()
 }
 
 //----------------------------------------------------------------------------
-bool VISU_GaussPtsAct::PreHighlight(vtkInteractorStyle* theInteractorStyle, 
-                                   SVTK_SelectionEvent* theSelectionEvent,
-                                   bool theIsHighlight)
+bool
+VISU_GaussPtsAct
+::PreHighlight(vtkInteractorStyle* theInteractorStyle, 
+              SVTK_SelectionEvent* theSelectionEvent,
+              bool theIsHighlight)
 {
   myPreHighlightActor->SetVisibility(false);
   myCursorPyramid->SetVisibility(false);  
@@ -594,9 +597,11 @@ ChangeZoom(VISU_PickingSettings *thePickingSettings,
   
 }
 
-bool VISU_GaussPtsAct::Highlight(vtkInteractorStyle* theInteractorStyle, 
-                                SVTK_SelectionEvent* theSelectionEvent,
-                                bool theIsHighlight)
+bool
+VISU_GaussPtsAct
+::Highlight(vtkInteractorStyle* theInteractorStyle, 
+           SVTK_SelectionEvent* theSelectionEvent,
+           bool theIsHighlight)
 { 
   Handle(SALOME_InteractiveObject) anIO = getIO();
   int anInitialHasIndex = mySelector->HasIndex(anIO);
@@ -790,7 +795,7 @@ VISU_GaussPtsAct
     }
     //
     // myTextActor
-    std::string aString=aStr.str();
+    std::string aString = aStr.str();
     myTextActor->SetModePosition(myPickingSettings->GetInfoWindowPosition());
     myTextActor->SetTransparency(myPickingSettings->GetInfoWindowTransparency());
     myTextActor->SetWorldPoint(aWorldCoord);
@@ -948,9 +953,6 @@ VISU_GaussPtsAct1
 
   VISU_GaussPointsPL* aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
 
-  //myInsideDeviceActor->ShallowCopyPL(aPipeLine);
-  //myInsideDeviceActor->GetPipeLine()->SetMagnification( aPipeLine->GetMagnification() );
-
   myDeviceActor->ShallowCopyPL(aPipeLine);
 
   // Restore implicit function
index d3e46480ecb3c7f2cc505ef5f744c16059126a63..0ec6d3a9b8ac398c691ff902cd6cda80ec074df8 100644 (file)
@@ -166,6 +166,13 @@ VISU_GaussPointsPL
   return myPSMapper;
 }
 
+vtkDataSet* 
+VISU_GaussPointsPL
+::GetPickableDataSet()
+{
+  return myGeomFilter->GetOutput();
+}
+
 //----------------------------------------------------------------------------
 void
 VISU_GaussPointsPL
index 37c8a796c19740937ac01a1dd45b7f841ea47070..19e0079642ed51e9ec5353ff9b371408ff13af53 100644 (file)
@@ -79,6 +79,10 @@ public:
   VISU_OpenGLPointSpriteMapper*
   GetPSMapper();
 
+  //! Get an intermediate dataset that can be picked  
+  vtkDataSet*
+  GetPickableDataSet();
+
   //! Redefined method for initialization of the pipeline.
   virtual
   void