1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
28 #include "VISU_DataSetActor.h"
29 #include "VISU_UnstructuredGridPL.hxx"
30 #include "VISU_PipeLineUtils.hxx"
32 #include <vtkDataSetMapper.h>
33 #include <vtkObjectFactory.h>
35 #include <boost/bind.hpp>
40 static int MYDEBUG = 0;
42 static int MYDEBUG = 0;
45 //----------------------------------------------------------------------------
46 vtkStandardNewMacro(VISU_DataSetActor);
48 //----------------------------------------------------------------------------
50 ::VISU_DataSetActor():
51 myMapper(vtkDataSetMapper::New())
53 if(MYDEBUG) MESSAGE("VISU_DataSetActor::VISU_DataSetActor - this = "<<this);
58 //----------------------------------------------------------------------------
60 ::~VISU_DataSetActor()
62 if(MYDEBUG) MESSAGE("~VISU_DataSetActor() - this = "<<this);
65 //----------------------------------------------------------------------------
68 ::ShallowCopyPL(VISU_PipeLine* thePipeLine)
70 Superclass::ShallowCopyPL(thePipeLine);
72 if(VISU_UnstructuredGridPL* aPipeLine = dynamic_cast<VISU_UnstructuredGridPL*>(thePipeLine)){
73 vtkDataSetMapper* aTarget = GetDataSetMapper();
74 vtkDataSetMapper* aSource = aPipeLine->GetDataSetMapper();
75 VISU::CopyDataSetMapper(aTarget, aSource, true);
76 aTarget->SetLookupTable(aSource->GetLookupTable());
80 //----------------------------------------------------------------------------
83 ::SetMapperInput(vtkDataSet* theDataSet)
85 myMapper->SetInput(theDataSet);
86 SetMapper(myMapper.GetPointer());
89 //----------------------------------------------------------------------------
94 return myMapper.GetPointer();