VISU_ScalarMapPL::Init();
float aScalarRange[2];
GetSourceRange(aScalarRange);
- SetScale(GetScaleFactor(GetInput2())/aScalarRange[1]);
+
+ vtkDataSet* aDataSet = GetInput2();
+ float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
+
+ static double EPS = 1.0 / VTK_LARGE_FLOAT;
+ if(std::abs(aScalarRange[1]) > EPS)
+ SetScale(aScaleFactor / aScalarRange[1]);
}
VISU_ScalarMapPL::THook* VISU_DeformedShapePL::DoHook(){
GetSourceRange(aScalarRange);
vtkDataSet* aDataSet = GetParentMesh();
float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
- SetScale( aScaleFactor / aScalarRange[1] );
+
+ static double EPS = 1.0 / VTK_LARGE_FLOAT;
+ if(std::abs(aScalarRange[1]) > EPS)
+ SetScale( aScaleFactor / aScalarRange[1] );
+ else
+ SetScale(0.0);
// Deformed Shape
myPassFilter[0]->SetInput(myCellDataToPointData->GetUnstructuredGridOutput());