X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_ClippingDlg.cxx;h=93410883f140e5c749f714b6ded4de2a26622ffe;hb=7191b0d7359a31f9dee70d1020d8c0c7d8386e31;hp=ac190be77b4c17d6a890f56631cf20e4e67b2fd2;hpb=d8f644ca3d4ce62f2ef41d4aacb52f5bb1221df3;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx index ac190be77..93410883f 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx @@ -113,7 +113,7 @@ SMESH::OrientedPlane::OrientedPlane(SVTK_ViewWindow* theViewWindow): myDistance(0.5) { Init(); - myViewWindow->AddActor(myActor); + myViewWindow->AddActor(myActor, false, false); // don't adjust actors } SMESH::OrientedPlane::OrientedPlane(): @@ -194,7 +194,8 @@ private: struct TSetVisibility { TSetVisibility(int theIsVisible): myIsVisible(theIsVisible){} void operator()(SMESH::TPlaneData& thePlaneData){ - thePlaneData.Plane.GetPointer()->myActor->SetVisibility(myIsVisible); + bool anIsEmpty = thePlaneData.ActorList.empty(); + thePlaneData.Plane.GetPointer()->myActor->SetVisibility(myIsVisible && !anIsEmpty); } int myIsVisible; }; @@ -261,11 +262,22 @@ SMESH::OrientedPlane* SMESHGUI_ClippingDlg::AddPlane (SMESH::TActorList vtkFloatingPointType aBounds[6]; vtkFloatingPointType anOrigin[3]; - bool anIsOk = SMESH::ComputeClippingPlaneParameters( theActorList, - aNormal, - theDistance, - aBounds, - anOrigin ); + + bool anIsOk = false; + if( theActorList.empty() ) { + // to support planes with empty actor list we should create + // a nullified plane that will be initialized later + anOrigin[0] = anOrigin[1] = anOrigin[2] = 0; + aBounds[0] = aBounds[2] = aBounds[4] = 0; + aBounds[1] = aBounds[3] = aBounds[5] = 0; + anIsOk = true; + } + else + anIsOk = SMESH::ComputeClippingPlaneParameters( theActorList, + aNormal, + theDistance, + aBounds, + anOrigin ); if( !anIsOk ) return NULL; @@ -545,8 +557,10 @@ void SMESHGUI_ClippingDlg::ClickOnApply() SMESH::TPlaneData aPlaneData = *anIter2; SMESH::TPlane aPlane = aPlaneData.Plane; SMESH::TActorList anActorList = aPlaneData.ActorList; - if( anActorList.empty() ) - continue; + + // the check is disabled to support planes with empty actor list + //if( anActorList.empty() ) + // continue; SMESH::OrientedPlane* anOrientedPlane = SMESH::OrientedPlane::New(myViewWindow); anOrientedPlane->ShallowCopy(aPlane.GetPointer());