Salome HOME
22517: [CEA 1079] Filter Multi-connections can not be created with the graphical...
[modules/smesh.git] / src / OBJECT / SMESH_DeviceActor.cxx
index 4a46932cc7f52eb89953f21da815187f584dc8b0..4785155d80478fffa598fa2f65c66c8da1519838 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  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
@@ -6,7 +6,7 @@
 // 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.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -63,6 +63,8 @@
 
 #include <vtkRenderer.h>
 
+#include <vtkPlaneCollection.h>
+
 #include "utilities.h"
 
 #ifdef _DEBUG_
@@ -90,6 +92,7 @@ SMESH_DeviceActor
 
   myProperty = vtkProperty::New();
   myMapper = VTKViewer_PolyDataMapper::New();
+  myPlaneCollection = vtkPlaneCollection::New();
 
   vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
                                                                  myPolygonOffsetUnits);
@@ -256,12 +259,20 @@ SMESH_DeviceActor
 
     anId++; // 5
     myMapper->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
+    if( myPlaneCollection->GetNumberOfItems() )
+      myMapper->SetClippingPlanes( myPlaneCollection );
 
     vtkLODActor::SetMapper( myMapper );
     Modified();
   }
 }
 
+void
+SMESH_DeviceActor
+::SetPlaneCollection( vtkPlaneCollection* theCollection )
+{
+  myPlaneCollection = theCollection;
+}
 
 VTKViewer_ExtractUnstructuredGrid* 
 SMESH_DeviceActor