From 46b3ffdbd603a9d8d5ac3ea07263a55d945731ed Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 19 Sep 2005 09:16:09 +0000 Subject: [PATCH] Magnification and increment parameters added --- src/PIPELINE/VISU_GaussPointsPL.cxx | 88 +++++++++++++++++++++++++++-- src/PIPELINE/VISU_GaussPointsPL.hxx | 25 ++++++++ 2 files changed, 107 insertions(+), 6 deletions(-) diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 9abe2e09..19fd0260 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -44,7 +44,8 @@ vtkStandardNewMacro(VISU_GaussPointsPL); VISU_GaussPointsPL ::VISU_GaussPointsPL(): myRelativeMinSize(0.03), - myRelativeMaxSize(0.30) + myRelativeMaxSize(0.30), + myMagnificationIncrement(0.1) { myPSMapper = VISU_OpenGLPointSpriteMapper::New(); //myPSMapper->DebugOn(); @@ -198,15 +199,46 @@ VISU_GaussPointsPL return myMapperTable->GetBicolor(); } +//---------------------------------------------------------------------------- +void +VISU_GaussPointsPL +::SetClamp(float theClamp) +{ + cout << "VISU_GaussPointsPL::SetClamp " << theClamp << endl;; + myPSMapper->SetPointSpriteClamp( theClamp ); + + Modified(); +} + +//---------------------------------------------------------------------------- +float +VISU_GaussPointsPL +::GetClamp() +{ + return 200.0; +} + +//---------------------------------------------------------------------------- +float +VISU_GaussPointsPL +::GetMaximumSupportedSize() +{ + return myPSMapper->GetMaximumSupportedSize(); +} + //---------------------------------------------------------------------------- void VISU_GaussPointsPL ::SetRelativeMinSize(float theRelativeMinSize) { myRelativeMinSize = theRelativeMinSize; - - //myPSMapper->SetShaderVariable( "minSize", myAverageCellSize * myRelativeMinSize ); - //cout << "MIN : " << myAverageCellSize * myRelativeMinSize << endl; + /* + cout << "VISU_GaussPointsPL::SetRelativeMinSize "; + cout << myAverageCellSize << " * "; + cout << myRelativeMinSize << " * 1000.0 = "; + cout << 1000.0 * myAverageCellSize * myRelativeMinSize << endl; + */ + myPSMapper->SetPointSpriteMinSize( 1000.0 * myAverageCellSize * myRelativeMinSize ); Modified(); } @@ -217,13 +249,57 @@ VISU_GaussPointsPL ::SetRelativeMaxSize(float theRelativeMaxSize) { myRelativeMaxSize = theRelativeMaxSize; + /* + cout << "VISU_GaussPointsPL::SetRelativeMaxSize "; + cout << myAverageCellSize << " * "; + cout << myRelativeMaxSize << " * 1000.0 = "; + cout << 1000.0 * myAverageCellSize * myRelativeMaxSize << endl; + */ + myPSMapper->SetPointSpriteMaxSize( 1000.0 * myAverageCellSize * myRelativeMaxSize ); + + Modified(); +} - //myPSMapper->SetShaderVariable( "maxSize", myAverageCellSize * myRelativeMaxSize ); - //cout << "MAX : " << myAverageCellSize * myRelativeMaxSize << endl; +//---------------------------------------------------------------------------- +void +VISU_GaussPointsPL +::SetMagnification(float theMagnification) +{ + //cout << "VISU_GaussPointsPL::SetMagnification " << theMagnification << endl;; + myPSMapper->SetPointSpriteMagnification( theMagnification ); Modified(); } +//---------------------------------------------------------------------------- +float +VISU_GaussPointsPL +::GetMagnification() +{ + return myPSMapper->GetPointSpriteMagnification(); +} +//---------------------------------------------------------------------------- +void +VISU_GaussPointsPL +::SetMagnificationIncrement(float theIncrement) +{ + myMagnificationIncrement = theIncrement; +} +//---------------------------------------------------------------------------- +float +VISU_GaussPointsPL +::GetMagnificationIncrement() +{ + return myMagnificationIncrement; +} +//---------------------------------------------------------------------------- +void +VISU_GaussPointsPL +::ChangeMagnification( bool up ) +{ + float anIncrement = up ? myMagnificationIncrement : -myMagnificationIncrement; + SetMagnification( GetMagnification() + anIncrement ); +} //---------------------------------------------------------------------------- float VISU_GaussPointsPL diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index 7b704235..5d3e8b93 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -86,6 +86,15 @@ public: bool GetBicolor(); + void + SetClamp(float theClamp); + + float + GetClamp(); + + float + GetMaximumSupportedSize(); + void SetRelativeMinSize(float theRelativeMinSize); @@ -107,6 +116,21 @@ public: float GetMaxPointSize(); + void + SetMagnification(float theMagnification); + + float + GetMagnification(); + + void + SetMagnificationIncrement(float theIncrement); + + float + GetMagnificationIncrement(); + + void + ChangeMagnification( bool up ); + float GetPointSize(vtkIdType theID); @@ -124,6 +148,7 @@ protected: float myAverageCellSize; float myRelativeMinSize; float myRelativeMaxSize; + float myMagnificationIncrement; }; #endif -- 2.39.2