From: kgv Date: Sun, 9 Oct 2016 18:59:58 +0000 (+0300) Subject: 0027944: Visualization, V3d_View - filter duplicates within ::AddClipPlane() X-Git-Tag: V7_1_0_beta~95 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=b88b0cf7fc86ccf53d0f833ea54a47e6995f6d65;p=occt.git 0027944: Visualization, V3d_View - filter duplicates within ::AddClipPlane() --- diff --git a/src/V3d/V3d_View_2.cxx b/src/V3d/V3d_View_2.cxx index 597c97a6a1..ce30c49bee 100644 --- a/src/V3d/V3d_View_2.cxx +++ b/src/V3d/V3d_View_2.cxx @@ -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);