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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : VISU_VectorsAct.cxx
25 // Author : Laurent CORNABE with help of Nicolas REJNERI
29 #include "VISU_VectorsAct.h"
30 #include "VISU_VectorsPL.hxx"
31 #include "SALOME_PassThroughFilter.h"
34 #include <vtkObjectFactory.h>
35 #include <vtkDataSetMapper.h>
36 #include <vtkPolyDataMapper.h>
37 #include <vtkPolyData.h>
41 //=======================================================================
43 vtkStandardNewMacro(VISU_VectorsAct);
46 VISU_VectorsAct::VISU_VectorsAct(){}
49 VISU_VectorsAct::~VISU_VectorsAct(){}
52 void VISU_VectorsAct::SetPipeLine(VISU_PipeLine* thePipeLine) {
53 if((myPipeLine = dynamic_cast<VISU_VectorsPL*>(thePipeLine))){
54 VISU_Actor::SetPipeLine(myPipeLine);
60 void VISU_VectorsAct::SetTransform(SALOME_Transform* theTransform){
61 myPipeLine->SetTransform(theTransform);
66 void VISU_VectorsAct::SetMapper(vtkMapper* theMapper){
68 myPassFilter[0]->SetInput(theMapper->GetInput());
69 myPassFilter[0]->Update();
70 myPassFilter[1]->SetInput(myPassFilter[0]->GetPolyDataOutput());
71 myPassFilter[1]->Update();
72 myPassFilter[2]->SetInput(myPassFilter[1]->GetPolyDataOutput());
73 myPassFilter[2]->Update();
74 myPassFilter[3]->SetInput(myPassFilter[2]->GetPolyDataOutput());
75 myPassFilter[3]->Update();
76 if(vtkDataSetMapper* aMapper = dynamic_cast<vtkDataSetMapper*>(theMapper))
77 aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput());
78 else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper))
79 aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput());
81 vtkLODActor::SetMapper(theMapper);