-// VISU OBJECT : interactive object for VISU entities implementation
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// 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
// 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 OBJECT : interactive object for VISU entities implementation
// File: VISU_PipeLine.cxx
// Author: Alexey PETROV
// Module : VISU
-
-
+//
#include "VISU_DeformedShapePL.hxx"
#include "VISU_PipeLineUtils.hxx"
#include "VTKViewer_Transform.h"
//----------------------------------------------------------------------------
VISU_DeformedShapePL
::VISU_DeformedShapePL():
- myScaleFactor(0.0)
+ myScaleFactor(0.0),
+ myMapScaleFactor(1.0)
{
SetIsShrinkable(true);
+ SetIsFeatureEdgesAllowed(true);
myWarpVector = vtkWarpVector::New();
myCellDataToPointData = vtkCellDataToPointData::New();
void
VISU_DeformedShapePL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
aVolume *= aVol;
}
}
+ if( aNbElem == 0 || fabs(idim) < 1.0 / VTK_LARGE_FLOAT )
+ return 0.0; // to avoid division by zero
aVolume /= aNbElem;
return pow(aVolume, vtkFloatingPointType(1.0/idim));
}
{
if(VISU::CheckIsSameValue(myWarpVector->GetScaleFactor(), theScale))
return;
-
- myWarpVector->SetScaleFactor(theScale);
+
+ myWarpVector->SetScaleFactor(theScale*myMapScaleFactor);
myScaleFactor = theScale;
}
::InsertCustomPL()
{
VISU::CellDataToPoint(myWarpVector,
- myCellDataToPointData,
- GetMergedInput());
+ myCellDataToPointData,
+ GetMergedInput());
return myWarpVector->GetOutput();
}
VISU_DeformedShapePL
::SetMapScale(vtkFloatingPointType theMapScale)
{
+ myMapScaleFactor = theMapScale;
Superclass::SetMapScale(theMapScale);
- myWarpVector->SetScaleFactor(myScaleFactor*theMapScale);
+ vtkFloatingPointType aMapScale = myScaleFactor * theMapScale;
+ if(VISU::CheckIsSameValue(myWarpVector->GetScaleFactor(), aMapScale))
+ return;
+
+ myWarpVector->SetScaleFactor( aMapScale );
}