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>
32 #include <vtkCellDataToPointData.h>
34 static int MYDEBUG = 0;
36 static int MYDEBUG = 0;
39 //----------------------------------------------------------------------------
40 VISU_OptionalDeformationPL::VISU_OptionalDeformationPL():
44 if(MYDEBUG) MESSAGE("VISU_OptionalDeformationPL()::VISU_OptionalDeformationPL() - "<<this);
47 //----------------------------------------------------------------------------
48 VISU_OptionalDeformationPL::~VISU_OptionalDeformationPL()
50 if(MYDEBUG) MESSAGE("VISU_OptionalDeformationPL()::~VISU_OptionalDeformationPL() - "<<this);
53 //----------------------------------------------------------------------------
55 VISU_OptionalDeformationPL::GetMTime(){
56 return Superclass::GetMTime();
59 //----------------------------------------------------------------------------
60 void VISU_OptionalDeformationPL::UseDeformation(bool flag){
61 if(myIsDeformed == flag)
71 //----------------------------------------------------------------------------
72 bool VISU_OptionalDeformationPL::IsDeformed(){
76 //----------------------------------------------------------------------------
77 void VISU_OptionalDeformationPL::OnDeformation(){
79 myCellDataToPointData->SetInput(myInputPassFilter->GetOutput());
80 myWarpVector->SetInput(myCellDataToPointData->GetOutput());
81 myOutputPassFiler->SetInput(myWarpVector->GetOutput());
84 //----------------------------------------------------------------------------
85 void VISU_OptionalDeformationPL::OffDeformation(){
86 myOutputPassFiler->SetInput(myInputPassFilter->GetOutput());
91 bool VISU_OptionalDeformationPL::CheckCanDeformate(vtkDataSet* theInput){
93 if(VISU::IsDataOnCells(theInput))
94 return theInput->GetCellData()->GetVectors() != NULL;
95 else if(VISU::IsDataOnPoints(theInput))
96 return theInput->GetPointData()->GetVectors() != NULL;