]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Working with PointSprite Mapper
authorouv <ouv@opencascade.com>
Wed, 14 Sep 2005 06:39:06 +0000 (06:39 +0000)
committerouv <ouv@opencascade.com>
Wed, 14 Sep 2005 06:39:06 +0000 (06:39 +0000)
src/PIPELINE/VISU_GaussPointsPL.cxx
src/PIPELINE/VISU_GaussPointsPL.hxx

index 4d4dc0d73110d64c1fa82d10b6f071de39ef65a1..eb73877371deca637d0e0b77644675c144a1be01 100644 (file)
@@ -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;
 }
 
index 4abcbb5e26d92d98a9ecc6784f1acec60483d33c..ac7468f6754ce6764ad549e1cb9d83caec05d0c0 100644 (file)
@@ -115,7 +115,7 @@ protected:
   vtkDataArray *myScalarArray;
   float mySourceScalarRange[2];
   float myDeltaScalarRange;
-  float myAverageCelllSize;
+  float myAverageCellSize;
   float myRelativeMinSize;
   float myRelativeMaxSize;
 };