mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0024321: Use List collection instead of NCollection_Set for collection of Handle(Graphic3d_ClipPlane)
- The NCollection_Sequence (Graphic3d_SequenceOfHClipPlane) is used for handling ordered lists of clipping planes instead of NCollection_Set (Graphic3d_SetOfHClipPlane).
This commit is contained in:
@@ -137,7 +137,7 @@ uses
|
||||
ExtendedString from TCollection,
|
||||
PrintAlgo from Aspect,
|
||||
ClipPlane_Handle from Graphic3d,
|
||||
SetOfHClipPlane from Graphic3d
|
||||
SequenceOfHClipPlane from Graphic3d
|
||||
raises
|
||||
|
||||
BadValue from V3d, TypeMismatch from Standard,
|
||||
@@ -1566,8 +1566,8 @@ is
|
||||
---Purpose: Removes clip plane from the view.
|
||||
-- @param thePlane [in] the clip plane to be removed from view.
|
||||
|
||||
SetClipPlanes (me : mutable; thePlanes : SetOfHClipPlane from Graphic3d);
|
||||
---Purpose: Set clip planes to the view. The planes that have been set
|
||||
SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d);
|
||||
---Purpose: Sets sequence of clip planes to the view. The planes that have been set
|
||||
-- before are removed from the view. The composition of clip planes
|
||||
-- truncates the rendering space to convex volume. Number of supported
|
||||
-- clip planes can be consulted by PlaneLimit method of associated
|
||||
@@ -1575,7 +1575,7 @@ is
|
||||
-- are igonred during rendering.
|
||||
-- @param thePlanes [in] the clip planes to set.
|
||||
|
||||
GetClipPlanes (me) returns SetOfHClipPlane from Graphic3d;
|
||||
GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
|
||||
---C++: return const&
|
||||
---Purpose: Get clip planes.
|
||||
-- @return sequence clip planes that have been set for the view
|
||||
|
@@ -146,12 +146,8 @@ Standard_Boolean V3d_View::IfMoreLights() const {
|
||||
//=======================================================================
|
||||
void V3d_View::AddClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
|
||||
{
|
||||
Graphic3d_SetOfHClipPlane aCurrPlanes = MyViewContext.GetClipPlanes();
|
||||
if (!aCurrPlanes.Add (thePlane))
|
||||
return;
|
||||
|
||||
MyViewContext.SetClipPlanes (aCurrPlanes);
|
||||
MyView->SetContext (MyViewContext) ;
|
||||
MyViewContext.ChangeClipPlanes().Append (thePlane);
|
||||
MyView->SetContext (MyViewContext);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -160,29 +156,35 @@ void V3d_View::AddClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
|
||||
//=======================================================================
|
||||
void V3d_View::RemoveClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
|
||||
{
|
||||
Graphic3d_SetOfHClipPlane aCurrPlanes = MyViewContext.GetClipPlanes();
|
||||
if (!aCurrPlanes.Remove (thePlane))
|
||||
return;
|
||||
Graphic3d_SequenceOfHClipPlane& aSeqOfPlanes = MyViewContext.ChangeClipPlanes();
|
||||
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (aSeqOfPlanes);
|
||||
for (; aPlaneIt.More(); aPlaneIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
|
||||
if (aPlane != thePlane)
|
||||
continue;
|
||||
|
||||
MyViewContext.SetClipPlanes (aCurrPlanes);
|
||||
MyView->SetContext (MyViewContext) ;
|
||||
aSeqOfPlanes.Remove (aPlaneIt);
|
||||
MyView->SetContext (MyViewContext);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetClipPlanes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void V3d_View::SetClipPlanes (const Graphic3d_SetOfHClipPlane& thePlanes)
|
||||
void V3d_View::SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes)
|
||||
{
|
||||
MyViewContext.SetClipPlanes (thePlanes);
|
||||
MyView->SetContext (MyViewContext) ;
|
||||
MyViewContext.ChangeClipPlanes() = thePlanes;
|
||||
MyView->SetContext (MyViewContext);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetClipPlanes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Graphic3d_SetOfHClipPlane& V3d_View::GetClipPlanes() const
|
||||
const Graphic3d_SequenceOfHClipPlane& V3d_View::GetClipPlanes() const
|
||||
{
|
||||
return MyViewContext.GetClipPlanes();
|
||||
return MyViewContext.ClipPlanes();
|
||||
}
|
||||
|
Reference in New Issue
Block a user