From 59359025264755b0054826df2f187d9d71bcd373 Mon Sep 17 00:00:00 2001 From: pkv Date: Wed, 12 Oct 2005 14:17:23 +0000 Subject: [PATCH] To allow updating parameters of the view just after "Apply" in Picking dialog box --- src/OBJECT/VISU_GaussPtsAct.cxx | 11 ++++++++++- src/OBJECT/VISU_GaussPtsDeviceActor.cxx | 25 ++++++++++++++++++++++--- src/OBJECT/VISU_GaussPtsDeviceActor.h | 8 +++++++- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 37824f73..13d127c7 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -452,6 +452,9 @@ VISU_GaussPtsAct myChangeMagnification = theEvent == VISU::SetSMIncreaseMagnificationEvent; myUpdatePrs3dSignal(this); break; + case VISU::UpdatePickingSettingsEvent: + UpdatePickingSettings(); + break; default: break; } @@ -751,7 +754,13 @@ VISU_GaussPtsAct ::UpdatePickingSettings() { // Update picking parameters using myPickingSettings object - + myTextActor->SetModePosition(myPickingSettings->GetInfoWindowPosition()); + myTextActor->SetTransparency(myPickingSettings->GetInfoWindowTransparency()); + float aHeight= + myGaussPointsPL->GetMaxPointSize()*myPickingSettings->GetPyramidHeight(); + myCursorPyramid->SetHeight(aHeight); + myCursorPyramidSelected->SetHeight(aHeight); + // Update(); } diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx index 49471bcf..fe4e22cf 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx @@ -184,7 +184,11 @@ VISU_CursorPyramid for(int i = 0; i < myNbCones; ++i) myActors[i]->SetVisibility(theVisibility); } - +//---------------------------------------------------------------------------- +void VISU_CursorPyramid::SetHeight(float theHeight) +{ + Init(theHeight, myRadius, myPos, myColor); +} //---------------------------------------------------------------------------- void VISU_CursorPyramid @@ -193,7 +197,14 @@ VISU_CursorPyramid float thePos[3], float theColor[3]) { - for(int i = 0; i < myNbCones; ++i){ + int i; + myHeight=theHeight; + myRadius=theRadius; + for (i=0; i<3; ++i){ + myPos[i]=thePos[i]; + myColor[i]=theColor[i]; + } + for(i = 0; i < myNbCones; ++i){ mySources[i]->SetHeight(theHeight); // Set the angle of the cone. As a side effect, the angle plus height sets // the base radius of the cone. @@ -229,7 +240,8 @@ VISU_CursorPyramid ::VISU_CursorPyramid(): myNbCones(6) { - for(int i = 0; i < myNbCones; i++){ + int i; + for(i = 0; i < myNbCones; i++){ vtkConeSource* aConeSource = vtkConeSource::New(); aConeSource->SetResolution(4); @@ -252,6 +264,13 @@ VISU_CursorPyramid myActors[1]->SetOrientation(0. ,180.,0.); myActors[3]->SetOrientation(0. , 0. ,180.); myActors[5]->SetOrientation(180., 0. ,0.); + // + myHeight=10.; + myRadius=5.; + for(i = 0; i < 3; ++i){ + myPos[i]=0.; + myColor[i]=1.; + } } #include diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.h b/src/OBJECT/VISU_GaussPtsDeviceActor.h index 8661a166..4f4d5e3e 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.h +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.h @@ -124,7 +124,8 @@ public: float theRadius, float thePos[3], float theColor[3]); - + + void SetHeight(float theHeight); protected: VISU_CursorPyramid(); @@ -133,6 +134,11 @@ protected: vtkSmartPointer mySources[6]; vtkSmartPointer myMappers[6]; vtkSmartPointer myActors[6]; + // + float myHeight; + float myRadius; + float myPos[3]; + float myColor[3]; }; //================================================================== // class VISU_FramedTextActor -- 2.39.2