1 // Copyright (C) 2007-2012 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
23 // VISU OBJECT : interactive object for VISU entities implementation
24 // File : VISU_VectorsAct.cxx
25 // Author : Laurent CORNABE with help of Nicolas REJNERI
28 #include "VISU_VectorsAct.h"
29 #include "VISU_VectorsPL.hxx"
30 #include <SVTK_Actor.h>
33 #include <vtkObjectFactory.h>
34 #include <vtkDataSetMapper.h>
35 #include <vtkPolyDataMapper.h>
36 #include <vtkPolyData.h>
37 #include <vtkPassThroughFilter.h>
38 #include <VISU_UsedPointsFilter.hxx>
39 #include <vtkUnstructuredGrid.h>
40 #include <VISU_MergeFilter.hxx>
42 //----------------------------------------------------------------------------
43 vtkStandardNewMacro(VISU_VectorsAct);
46 //----------------------------------------------------------------------------
53 //----------------------------------------------------------------------------
59 //----------------------------------------------------------------------------
62 ::SetPipeLine(VISU_PipeLine* thePipeLine)
64 myVectorsPL = dynamic_cast<VISU_VectorsPL*>( thePipeLine );
66 Superclass::SetPipeLine( myVectorsPL.GetPointer() );
70 //----------------------------------------------------------------------------
75 return GetCurrentPL()->GetOutput();
79 //----------------------------------------------------------------------------
82 ::SetTransform(VTKViewer_Transform* theTransform)
84 // To perform only vector's specific action,
85 // there is nothing to be done for the Superclass
86 myVectorsPL->SetTransform( theTransform );
90 //----------------------------------------------------------------------------
93 ::SetMapper(vtkMapper* theMapper)
96 myPassFilter[0]->SetInputData(theMapper->GetInput());
98 //myPassFilter[1]->SetInput(myPassFilter[0]->GetPolyDataOutput());
99 myPassFilter[1]->SetInputConnection(myPassFilter[0]->GetOutputPort()); // OUV_PORTING: to check
101 //myPassFilter[2]->SetInput(myPassFilter[1]->GetPolyDataOutput());
102 myPassFilter[2]->SetInputConnection(myPassFilter[1]->GetOutputPort()); // OUV_PORTING: to check
104 //myPassFilter[3]->SetInput(myPassFilter[2]->GetPolyDataOutput());
105 myPassFilter[3]->SetInputConnection(myPassFilter[2]->GetOutputPort()); // OUV_PORTING: to check
107 // OUV_PORTING: to check
109 if(vtkDataSetMapper* aMapper = dynamic_cast<vtkDataSetMapper*>(theMapper))
110 aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput());
111 else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper))
112 aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput());
114 theMapper->SetInputConnection(myPassFilter[3]->GetOutputPort());
117 vtkLODActor::SetMapper(theMapper);
121 //----------------------------------------------------------------------------
126 unsigned long int aSize = Superclass::GetMemorySize();
128 aSize += GetPipeLine()->GetMemorySize();
133 //----------------------------------------------------------------------------
136 ::GetValLabelsInput()
138 VISU_VectorsPL* aPL = dynamic_cast<VISU_VectorsPL*>( GetPipeLine() );
141 return aPL->GetMergedInput();
142 /*VISU_UsedPointsFilter* aFilter = aPL->GetUsedPointsFilter();
143 vtkSmartPointer< VISU_MergeFilter > aFilter = aPL->myMergeFilter;
147 return aFilter->GetOutput();
151 return Superclass::GetValLabelsInput();
154 //--------------------------------------------------------------------------------------
155 vtkDataSet* VISU_VectorsAct::GetHighlightedDataSet() {
156 return myPassFilter[3]->GetOutput();