Salome HOME
Bug 0020164: EDF 954 VISU : Constant field with Gauss points.
[modules/visu.git] / src / OBJECT / VISU_VectorsAct.cxx
index 428cbb50e8f3bcd0fb1027c25599bf2fc6435ae7..0742a57a90efa6ca4c5f8e8c8e4550ee6a62418c 100644 (file)
@@ -1,33 +1,32 @@
-//  VISU OBJECT : interactive object for VISU entities implementation
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  VISU OBJECT : interactive object for VISU entities implementation
 //  File   : VISU_VectorsAct.cxx
 //  Author : Laurent CORNABE with help of Nicolas REJNERI
 //  Module : VISU
-//  $Header$
 
 #include "VISU_VectorsAct.h"
 #include "VISU_VectorsPL.hxx"
+#include <SVTK_Actor.h>
  
 // VTK Includes
 #include <vtkObjectFactory.h>
@@ -35,6 +34,9 @@
 #include <vtkPolyDataMapper.h>
 #include <vtkPolyData.h>
 #include <vtkPassThroughFilter.h>
+#include <VISU_UsedPointsFilter.hxx>
+#include <vtkUnstructuredGrid.h>
+#include <VISU_MergeFilter.hxx>
 
 //----------------------------------------------------------------------------
 vtkStandardNewMacro(VISU_VectorsAct);
@@ -58,8 +60,9 @@ void
 VISU_VectorsAct
 ::SetPipeLine(VISU_PipeLine* thePipeLine) 
 {
-  myVectorsPL = dynamic_cast<VISU_VectorsPL*>(thePipeLine);
-  VISU_Actor::SetPipeLine(myVectorsPL.GetPointer());
+  myVectorsPL = dynamic_cast<VISU_VectorsPL*>( thePipeLine );
+
+  Superclass::SetPipeLine( myVectorsPL.GetPointer() );
 }
 
 
@@ -77,8 +80,9 @@ void
 VISU_VectorsAct
 ::SetTransform(VTKViewer_Transform* theTransform)
 {
-  Superclass::SetTransform(theTransform);
-  myVectorsPL->SetTransform(theTransform);
+  // To perform only vector's specific action,
+  // there is nothing to be done for the Superclass
+  myVectorsPL->SetTransform( theTransform );
 }
 
 
@@ -101,6 +105,7 @@ VISU_VectorsAct
     else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper))
       aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput());
   }
+
   vtkLODActor::SetMapper(theMapper);
 }
 
@@ -116,3 +121,24 @@ VISU_VectorsAct
 
   return aSize;
 }
+
+//----------------------------------------------------------------------------
+vtkDataSet*
+VISU_VectorsAct
+::GetValLabelsInput()
+{
+  VISU_VectorsPL* aPL = dynamic_cast<VISU_VectorsPL*>( GetPipeLine() );
+  if ( aPL )
+  {
+    return aPL->GetMergedInput();
+    /*VISU_UsedPointsFilter* aFilter = aPL->GetUsedPointsFilter();
+    vtkSmartPointer< VISU_MergeFilter > aFilter = aPL->myMergeFilter;
+    if ( aFilter )
+    {
+      aFilter->Update();
+      return aFilter->GetOutput();
+    }*/
+  }
+
+  return Superclass::GetValLabelsInput();
+}