myExtractGeometry->SetExtractInside(0);
myPSMapper = VISU_OpenGLPointSpriteMapper::New();
+ myPSMapper->SetColorModeToMapScalars();
+ myPSMapper->ScalarVisibilityOn();
myGeomFilter = vtkGeometryFilter::New();
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::Build()
+::Init()
{
- myPSMapper->SetColorModeToMapScalars();
- myPSMapper->ScalarVisibilityOn();
-
myExtractor->SetInput( GetInput2() );
myFieldTransform->SetInput( myExtractor->GetOutput() );
- myFieldTransform->Update();
myCellDataToPointData->SetInput( myFieldTransform->GetUnstructuredGridOutput() );
if( myIsDeformed )
myPSMapper->SetInput( myGeomFilter->GetOutput() );
- SetSourceRange();
+ VISU_ScalarMapPL::Init();
+
+ float aScalarRange[2];
+ GetSourceRange(aScalarRange);
+ vtkDataSet* aDataSet = GetParentMesh();
+ SetScale( VISU_DeformedShapePL::GetScaleFactor( aDataSet ) / aScalarRange[1] );
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPointsPL
+::Build()
+{
+ if( myIsDeformed )
+ {
+ myWarpVector->SetInput( myCellDataToPointData->GetUnstructuredGridOutput() );
+ myGeomFilter->SetInput( myWarpVector->GetOutput() );
+ }
+ else
+ {
+ myGeomFilter->SetInput( myCellDataToPointData->GetUnstructuredGridOutput() );
+ }
}
//----------------------------------------------------------------------------
vtkMapper* aMapper = GetMapper();
vtkDataSet* aDataSet = aMapper->GetInput();
+ //vtkDataSet* aDataSet = GetParentMesh();
myAverageCellSize = VISU_DeformedShapePL::GetScaleFactor(aDataSet);
vtkCellData* aCellData = aDataSet->GetCellData();
this->myGeomFilter = NULL;
}
- myWarpVector->UnRegisterAllOutputs();
myWarpVector->Delete();
- myCellDataToPointData->UnRegisterAllOutputs();
myCellDataToPointData->Delete();
}
{
myGaussPtsIDMapper = theGaussPtsIDMapper;
SetIDMapper(myGaussPtsIDMapper);
+ Init();
}
const VISU::PGaussPtsIDMapper&
return myGaussPtsIDMapper;
}
+VISU::TVTKOutput*
+VISU_GaussPointsPL
+::GetParentMesh() const
+{
+ VISU::TNamedIDMapper* aNamedIDMapper = myGaussPtsIDMapper->GetParent();
+ return aNamedIDMapper->GetVTKOutput();
+}
+
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
void VISU_GaussPointsPL::SetScale( float theScale )
{
myWarpVector->SetScaleFactor( theScale );
- myScaleFactor = theScale;
+ myScaleFactor = GetScale();
Modified();
}
float VISU_GaussPointsPL::GetScale()
{
- if( !myScaleFactor )
- myScaleFactor = VISU_DeformedShapePL::GetScaleFactor( GetMapper()->GetInput() );
-
- return myScaleFactor;
-}
-
-vtkPointSet* VISU_GaussPointsPL::doHook()
-{
- VISU::CellDataToPoint( myWarpVector, myCellDataToPointData, GetInput2(), myFieldTransform );
- return myWarpVector->GetOutput();
+ return myWarpVector->GetScaleFactor();
}
void VISU_GaussPointsPL::SetMapScale( float theMapScale )