-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU DeformedShapeAndScalarMapPL
// File: VISU_DeformedShapeAndScalarMapPL.cxx
// Author: Eugeny Nikolaev
#include <vtkImplicitBoolean.h>
#include <vtkImplicitFunction.h>
#include <vtkUnstructuredGrid.h>
-#include <vtkCellDataToPointData.h>
#include <vtkPointDataToCellData.h>
#include <vtkImplicitFunctionCollection.h>
+#ifdef WNT
+#include <float.h>
+#define isnan _isnan
+#endif
//----------------------------------------------------------------------------
vtkStandardNewMacro(VISU_DeformedShapeAndScalarMapPL)
myScalarsFieldTransform = VISU_FieldTransform::New();
- myCellDataToPointData = vtkCellDataToPointData::New();
+ myCellDataToPointData = VISU_CellDataToPointData::New();
myScalarsElnoDisassembleFilter = VISU_ElnoDisassembleFilter::New();
vtkImplicitBoolean* anImplicitBoolean = vtkImplicitBoolean::New();
GetMapper()->ScalarVisibilityOn();
VISU::CellDataToPoint(myWarpVector,
- myCellDataToPointData,
- GetMergedInput());
+ myCellDataToPointData,
+ GetMergedInput());
- myScalars = GetMergedInput();
+ myScalars = vtkUnstructuredGrid::SafeDownCast(GetMergedInput());
UpdateScalars();
void
VISU_DeformedShapeAndScalarMapPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if(GetScalars() == theScalars)
return;
- myScalars = theScalars;
+ myScalars = vtkUnstructuredGrid::SafeDownCast(theScalars);
UpdateScalars();
}
VISU_DeformedShapeAndScalarMapPL
::SetScalarRange(vtkFloatingPointType theRange[2])
{
+ if (isnan(theRange[0]) || isnan(theRange[1]))
+ throw std::runtime_error("NAN values in the presentation");
+
if(VISU::CheckIsSameRange(theRange, GetScalarRange()))
return;
{
myScalarsExtractor->Update();
myScalarsExtractor->GetUnstructuredGridOutput()->GetScalarRange(theRange);
+
+ if (isnan(theRange[0]) || isnan(theRange[1]))
+ throw std::runtime_error("NAN values in the presentation");
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetGaussMetric(VISU::TGaussMetric theGaussMetric)
+{
+ if(GetGaussMetric() == theGaussMetric)
+ return;
+
+ myScalarsExtractor->SetGaussMetric(theGaussMetric);
+}
+
+
+//----------------------------------------------------------------------------
+VISU::TGaussMetric
+VISU_DeformedShapeAndScalarMapPL
+::GetGaussMetric()
+{
+ return myScalarsExtractor->GetGaussMetric();
}