From: ouv Date: Wed, 14 Sep 2005 06:39:06 +0000 (+0000) Subject: Working with PointSprite Mapper X-Git-Tag: BR-D5-38-2003_D2005-12-10~199 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b328fa4cca6d1027dc9bd257fa5d2f56baceb5cd;p=modules%2Fvisu.git Working with PointSprite Mapper --- diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 4d4dc0d7..eb738773 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -98,11 +98,17 @@ VISU_GaussPointsPL myExtractor->SetInput( GetInput2() ); myFieldTransform->SetInput( myExtractor->GetOutput() ); + //myPSMapper->SetQuadraticPointDistanceAttenuation( 1.0, 20.0, 0.0 ); + myPSMapper->SetImmediateModeRendering( 1 ); myPSMapper->SetColorModeToMapScalars(); myPSMapper->ScalarVisibilityOn(); myGeomFilter->SetInput( myFieldTransform->GetUnstructuredGridOutput() ); myPSMapper->SetInput( myGeomFilter->GetOutput() ); + + //vtkXMLImageDataReader* aReader = vtkXMLImageDataReader::New(); + //aReader->SetFileName( "/dn06/salome/ouv/SALOME3/TextureAlphaChannel.vti" ); + //myPSMapper->InitTexture( aReader->GetOutput() ); } //---------------------------------------------------------------------------- @@ -117,7 +123,7 @@ Init() vtkMapper* aMapper = GetMapper(); vtkDataSet* aDataSet = aMapper->GetInput(); - myAverageCelllSize = VISU_DeformedShapePL::GetScaleFactor(aDataSet); + myAverageCellSize = VISU_DeformedShapePL::GetScaleFactor(aDataSet); vtkCellData* aCellData = aDataSet->GetCellData(); myScalarArray = aCellData->GetScalars(); @@ -179,6 +185,10 @@ VISU_GaussPointsPL ::SetRelativeMinSize(float theRelativeMinSize) { myRelativeMinSize = theRelativeMinSize; + + //myPSMapper->SetShaderVariable( "minSize", myAverageCellSize * myRelativeMinSize ); + //cout << "MIN : " << myAverageCellSize * myRelativeMinSize << endl; + Modified(); } @@ -188,6 +198,10 @@ VISU_GaussPointsPL ::SetRelativeMaxSize(float theRelativeMaxSize) { myRelativeMaxSize = theRelativeMaxSize; + + //myPSMapper->SetShaderVariable( "maxSize", myAverageCellSize * myRelativeMaxSize ); + //cout << "MAX : " << myAverageCellSize * myRelativeMaxSize << endl; + Modified(); } @@ -196,8 +210,8 @@ float VISU_GaussPointsPL ::GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray) { - float aMaxSize = myAverageCelllSize*myRelativeMaxSize; - float aMinSize = myAverageCelllSize*myRelativeMinSize; + float aMaxSize = myAverageCellSize*myRelativeMaxSize; + float aMinSize = myAverageCellSize*myRelativeMinSize; float aDelta = aMaxSize - aMinSize; float aVal = theScalarArray->GetTuple1(theID); @@ -221,6 +235,6 @@ float VISU_GaussPointsPL ::GetMaxPointSize() { - return myAverageCelllSize*myRelativeMaxSize; + return myAverageCellSize*myRelativeMaxSize; } diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index 4abcbb5e..ac7468f6 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -115,7 +115,7 @@ protected: vtkDataArray *myScalarArray; float mySourceScalarRange[2]; float myDeltaScalarRange; - float myAverageCelllSize; + float myAverageCellSize; float myRelativeMinSize; float myRelativeMaxSize; };