1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: VISU_ScalarMapPL.cxx
21 // Author: Roman NIKOLAEV
25 #include "VISU_OptionalDeformationPL.hxx"
26 #include "VISU_PipeLineUtils.hxx"
29 #include <vtkDataSet.h>
30 #include <vtkPassThroughFilter.h>
31 #include <vtkWarpVector.h>
33 static int MYDEBUG = 0;
35 static int MYDEBUG = 0;
38 //----------------------------------------------------------------------------
39 VISU_OptionalDeformationPL::VISU_OptionalDeformationPL():
43 if(MYDEBUG) MESSAGE("VISU_OptionalDeformationPL()::VISU_OptionalDeformationPL() - "<<this);
46 //----------------------------------------------------------------------------
47 VISU_OptionalDeformationPL::~VISU_OptionalDeformationPL()
49 if(MYDEBUG) MESSAGE("VISU_OptionalDeformationPL()::~VISU_OptionalDeformationPL() - "<<this);
52 //----------------------------------------------------------------------------
54 VISU_OptionalDeformationPL::GetMTime(){
55 return Superclass::GetMTime();
58 //----------------------------------------------------------------------------
59 void VISU_OptionalDeformationPL::UseDeformation(bool flag){
60 if(myIsDeformed == flag)
70 //----------------------------------------------------------------------------
71 bool VISU_OptionalDeformationPL::IsDeformed(){
75 //----------------------------------------------------------------------------
76 void VISU_OptionalDeformationPL::OnDeformation(){
78 myCellDataToPointData->SetInput(myInputPassFilter->GetOutput());
79 myWarpVector->SetInput(myCellDataToPointData->GetOutput());
80 myOutputPassFiler->SetInput(myWarpVector->GetOutput());
83 //----------------------------------------------------------------------------
84 void VISU_OptionalDeformationPL::OffDeformation(){
85 myOutputPassFiler->SetInput(myInputPassFilter->GetOutput());
90 bool VISU_OptionalDeformationPL::CheckCanDeformate(vtkDataSet* theInput){
92 if(VISU::IsDataOnCells(theInput))
93 return theInput->GetCellData()->GetVectors() != NULL;
94 else if(VISU::IsDataOnPoints(theInput))
95 return theInput->GetPointData()->GetVectors() != NULL;