1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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
22 // VISU OBJECT : interactive object for VISU entities implementation
23 // File : VISU_VectorsAct.cxx
24 // Author : Laurent CORNABE with help of Nicolas REJNERI
27 #include "VISU_VectorsAct.h"
28 #include "VISU_VectorsPL.hxx"
29 #include <SVTK_Actor.h>
32 #include <vtkObjectFactory.h>
33 #include <vtkDataSetMapper.h>
34 #include <vtkPolyDataMapper.h>
35 #include <vtkPolyData.h>
36 #include <vtkPassThroughFilter.h>
37 #include <VISU_UsedPointsFilter.hxx>
38 #include <vtkUnstructuredGrid.h>
39 #include <VISU_MergeFilter.hxx>
41 //----------------------------------------------------------------------------
42 vtkStandardNewMacro(VISU_VectorsAct);
45 //----------------------------------------------------------------------------
52 //----------------------------------------------------------------------------
58 //----------------------------------------------------------------------------
61 ::SetPipeLine(VISU_PipeLine* thePipeLine)
63 myVectorsPL = dynamic_cast<VISU_VectorsPL*>( thePipeLine );
65 Superclass::SetPipeLine( myVectorsPL.GetPointer() );
69 //----------------------------------------------------------------------------
74 return GetCurrentPL()->GetOutput();
78 //----------------------------------------------------------------------------
81 ::SetTransform(VTKViewer_Transform* theTransform)
83 // To perform only vector's specific action,
84 // there is nothing to be done for the Superclass
85 myVectorsPL->SetTransform( theTransform );
89 //----------------------------------------------------------------------------
92 ::SetMapper(vtkMapper* theMapper)
95 myPassFilter[0]->SetInput(theMapper->GetInput());
97 myPassFilter[1]->SetInput(myPassFilter[0]->GetPolyDataOutput());
99 myPassFilter[2]->SetInput(myPassFilter[1]->GetPolyDataOutput());
101 myPassFilter[3]->SetInput(myPassFilter[2]->GetPolyDataOutput());
103 if(vtkDataSetMapper* aMapper = dynamic_cast<vtkDataSetMapper*>(theMapper))
104 aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput());
105 else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper))
106 aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput());
109 vtkLODActor::SetMapper(theMapper);
113 //----------------------------------------------------------------------------
118 unsigned long int aSize = Superclass::GetMemorySize();
120 aSize += GetPipeLine()->GetMemorySize();
125 //----------------------------------------------------------------------------
128 ::GetValLabelsInput()
130 VISU_VectorsPL* aPL = dynamic_cast<VISU_VectorsPL*>( GetPipeLine() );
133 return aPL->GetMergedInput();
134 /*VISU_UsedPointsFilter* aFilter = aPL->GetUsedPointsFilter();
135 vtkSmartPointer< VISU_MergeFilter > aFilter = aPL->myMergeFilter;
139 return aFilter->GetOutput();
143 return Superclass::GetValLabelsInput();