1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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:
apl
2013-11-18 21:48:50 +04:00
committed by bugmaster
parent 28cec2ba3e
commit 51b10cd466
27 changed files with 164 additions and 150 deletions

View File

@@ -64,7 +64,7 @@ uses
ListOfInteger from TColStd,
Location from TopLoc,
ClipPlane_Handle from Graphic3d,
SetOfHClipPlane from Graphic3d,
SequenceOfHClipPlane from Graphic3d,
-- ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate )
TransModeFlags from Graphic3d,
Pnt from gp,
@@ -266,7 +266,7 @@ is
---Purpose: Removes previously added clip plane.
-- @param thePlane [in] the clip plane to be removed from map of clip planes.
SetClipPlanes (me : mutable; thePlanes : SetOfHClipPlane from Graphic3d) is virtual;
SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d) is virtual;
---Purpose: Set clip planes for graphical clipping for all display mode presentations.
-- The composition of clip planes truncates the rendering space to convex
-- volume. Please be aware that number of supported clip plane is limited.
@@ -275,7 +275,7 @@ is
-- of these planes should be substracted from limit to predict the maximum
-- possible number of object clipping planes.
GetClipPlanes (me) returns SetOfHClipPlane from Graphic3d;
GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
---C++: inline
---C++: return const&
---Purpose: Get clip planes.
@@ -290,7 +290,7 @@ fields
myPresentations: Presentations from PrsMgr is protected;
myTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr is protected;
myLocation : Location from TopLoc is protected;
myClipPlanes : SetOfHClipPlane from Graphic3d is protected;
myClipPlanes : SequenceOfHClipPlane from Graphic3d is protected;
--myTransformPersistence : TransModeFlags from Graphic3d;
myTransformPersistence : CTransPersStruct from Graphic3d;

View File

@@ -378,9 +378,9 @@ Standard_Integer PrsMgr_PresentableObject::GetZLayer
// =======================================================================
void PrsMgr_PresentableObject::AddClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
{
myClipPlanes.Add (thePlane);
UpdateClipping(); // process changes
// add to collection and process changes
myClipPlanes.Append (thePlane);
UpdateClipping();
}
// =======================================================================
@@ -389,19 +389,28 @@ void PrsMgr_PresentableObject::AddClipPlane (const Handle(Graphic3d_ClipPlane)&
// =======================================================================
void PrsMgr_PresentableObject::RemoveClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
{
myClipPlanes.Remove (thePlane);
// remove from collection and process changes
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (myClipPlanes);
for (; aPlaneIt.More(); aPlaneIt.Next())
{
const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
if (aPlane != thePlane)
continue;
UpdateClipping(); // process changes
myClipPlanes.Remove (aPlaneIt);
UpdateClipping();
return;
}
}
// =======================================================================
// function : SetClipPlanes
// purpose :
// =======================================================================
void PrsMgr_PresentableObject::SetClipPlanes (const Graphic3d_SetOfHClipPlane& thePlanes)
void PrsMgr_PresentableObject::SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes)
{
// change collection and process changes
myClipPlanes = thePlanes;
UpdateClipping();
}

View File

@@ -26,7 +26,7 @@ inline PrsMgr_TypeOfPresentation3d PrsMgr_PresentableObject::TypeOfPresentation3
inline const TopLoc_Location& PrsMgr_PresentableObject::Location() const
{return myLocation;}
inline const Graphic3d_SetOfHClipPlane& PrsMgr_PresentableObject::GetClipPlanes() const
inline const Graphic3d_SequenceOfHClipPlane& PrsMgr_PresentableObject::GetClipPlanes() const
{
return myClipPlanes;
}