]> OCCT Git - occt.git/commitdiff
0027944: Visualization, V3d_View - filter duplicates within ::AddClipPlane()
authorkgv <kgv@opencascade.com>
Sun, 9 Oct 2016 18:59:58 +0000 (21:59 +0300)
committerapn <apn@opencascade.com>
Thu, 13 Oct 2016 10:41:36 +0000 (13:41 +0300)
src/V3d/V3d_View_2.cxx

index 597c97a6a1314983a2d005eb614a9dfbb1659b5e..ce30c49bee5817a0696d924a4787d20a3a11b240 100644 (file)
@@ -150,6 +150,18 @@ void V3d_View::AddClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
   {
     aSeqOfPlanes = new Graphic3d_SequenceOfHClipPlane();
   }
+  else
+  {
+    for (Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (*aSeqOfPlanes); aPlaneIt.More(); aPlaneIt.Next())
+    {
+      const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
+      if (aPlane == thePlane)
+      {
+        // plane is already defined in view
+        return;
+      }
+    }
+  }
 
   aSeqOfPlanes->Append (thePlane);
   SetClipPlanes (aSeqOfPlanes);