From: apo Date: Thu, 1 Dec 2005 11:48:43 +0000 (+0000) Subject: To implement picking for geometrical spheres represntation X-Git-Tag: TG-D5-38-2003_D2005-20-12~87 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f5595f93e1c2df6fc2b6a615a162174421bd2cd4;p=modules%2Fvisu.git To implement picking for geometrical spheres represntation --- diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 2d579106..592ccf2b 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -192,8 +192,6 @@ VISU_GaussPtsAct Superclass::ShallowCopyPL(thePipeLine); VISU_GaussPointsPL* aPipeLine = dynamic_cast(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(thePipeLine); - //myInsideDeviceActor->ShallowCopyPL(aPipeLine); - //myInsideDeviceActor->GetPipeLine()->SetMagnification( aPipeLine->GetMagnification() ); - myDeviceActor->ShallowCopyPL(aPipeLine); // Restore implicit function diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index d3e46480..0ec6d3a9 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -166,6 +166,13 @@ VISU_GaussPointsPL return myPSMapper; } +vtkDataSet* +VISU_GaussPointsPL +::GetPickableDataSet() +{ + return myGeomFilter->GetOutput(); +} + //---------------------------------------------------------------------------- void VISU_GaussPointsPL diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index 37c8a796..19e00796 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -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