1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +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

@ -68,5 +68,5 @@ Graphic3d_MarkerImage_Handle.hxx
Graphic3d_ClipPlane.hxx
Graphic3d_ClipPlane.cxx
Graphic3d_ClipPlane_Handle.hxx
Graphic3d_SetOfHClipPlane.hxx
Graphic3d_SetOfHClipPlane_Handle.hxx
Graphic3d_SequenceOfHClipPlane.hxx
Graphic3d_SequenceOfHClipPlane_Handle.hxx

View File

@ -587,9 +587,9 @@ is
imported ShaderProgram_Handle;
---Category: Instantiated classes
imported SetOfHClipPlane;
imported SequenceOfHClipPlane;
---Category: Instantiated classes
-- Set of handles on clip planes
-- Sequence of handles on clip planes
deferred class TextureRoot from Graphic3d;
deferred class TextureMap from Graphic3d;

View File

@ -20,7 +20,7 @@
#define _Graphic3d_CStructure_HeaderFile
#include <Graphic3d_CGroup.hxx>
#include <Graphic3d_SetOfHClipPlane.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
class Graphic3d_CStructure
{
@ -56,7 +56,7 @@ public:
CALL_DEF_TRANSFORM_PERSISTENCE TransformPersistence;
Graphic3d_SetOfHClipPlane ClipPlanes;
Graphic3d_SequenceOfHClipPlane ClipPlanes;
};
///typedef Graphic3d_CStructure CALL_DEF_STRUCTURE;

View File

@ -22,7 +22,7 @@
#include <InterfaceGraphic_Visual3d.hxx>
#include <Handle_Graphic3d_TextureEnv.hxx>
#include <Graphic3d_CLight.hxx>
#include <Graphic3d_SetOfHClipPlane.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
class CALL_DEF_VIEWCONTEXT
{
@ -74,7 +74,7 @@ public:
Handle(Graphic3d_TextureEnv) TextureEnv;
int SurfaceDetail;
Graphic3d_SetOfHClipPlane ClipPlanes;
Graphic3d_SequenceOfHClipPlane ClipPlanes;
};
class Graphic3d_CView

View File

@ -17,14 +17,13 @@
// purpose or non-infringement Please see the License for the specific terms
// and conditions governing the rights and limitations under the License
#ifndef _Graphic3d_SetOfHClipPlane_HeaderFile
#define _Graphic3d_SetOfHClipPlane_HeaderFile
#ifndef _Graphic3d_SequenceOfHClipPlane_HeaderFile
#define _Graphic3d_SequenceOfHClipPlane_HeaderFile
#include <NCollection_Set.hxx>
#include <NCollection_Sequence.hxx>
#include <Graphic3d_ClipPlane.hxx>
// CDL-header shortcut for set of graphical clipping planes. This is a compact
// way (compared to list) to store clippings, with mandatory uniqueness check.
typedef NCollection_Set<Handle(Graphic3d_ClipPlane)> Graphic3d_SetOfHClipPlane;
// CDL-header shortcut for sequence of graphical clipping planes.
typedef NCollection_Sequence<Handle(Graphic3d_ClipPlane)> Graphic3d_SequenceOfHClipPlane;
#endif

View File

@ -17,12 +17,12 @@
// purpose or non-infringement Please see the License for the specific terms
// and conditions governing the rights and limitations under the License
#ifndef _Graphic3d_SetOfHClipPlane_Handle_HeaderFile
#define _Graphic3d_SetOfHClipPlane_Handle_HeaderFile
#ifndef _Graphic3d_SequenceOfHClipPlane_Handle_HeaderFile
#define _Graphic3d_SequenceOfHClipPlane_Handle_HeaderFile
#include <NCollection_Handle.hxx>
#include <Graphic3d_SetOfHClipPlane.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
typedef NCollection_Handle<Graphic3d_SetOfHClipPlane> Handle(Graphic3d_SetOfHClipPlane);
typedef NCollection_Handle<Graphic3d_SequenceOfHClipPlane> Handle(Graphic3d_SequenceOfHClipPlane);
#endif

View File

@ -75,7 +75,7 @@ uses
Vertex from Graphic3d,
TransModeFlags from Graphic3d,
Pnt from gp,
SetOfHClipPlane from Graphic3d
SequenceOfHClipPlane from Graphic3d
raises
@ -271,11 +271,11 @@ is
---Purpose: Get Z layer ID of displayed structure. The method
-- returns -1 if the structure has no ID (deleted from graphic driver).
SetClipPlanes (me : mutable; thePlanes : SetOfHClipPlane from Graphic3d) is static;
---Purpose: Changes a set of clip planes slicing the structure on rendering.
SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d) is static;
---Purpose: Changes a sequence of clip planes slicing the structure on rendering.
-- @param thePlanes [in] the set of clip planes.
GetClipPlanes (me) returns SetOfHClipPlane from Graphic3d;
GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
---C++: return const&
---Purpose: Get clip planes slicing the structure on rendering.
-- @return set of clip planes.

View File

@ -2497,7 +2497,7 @@ Standard_Integer Graphic3d_Structure::GetZLayer () const
//function : SetClipPlanes
//purpose :
//=======================================================================
void Graphic3d_Structure::SetClipPlanes (const Graphic3d_SetOfHClipPlane& thePlanes)
void Graphic3d_Structure::SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes)
{
MyCStructure.ClipPlanes = thePlanes;
MyGraphicDriver->SetClipPlanes (MyCStructure);
@ -2507,7 +2507,7 @@ void Graphic3d_Structure::SetClipPlanes (const Graphic3d_SetOfHClipPlane& thePla
//function : GetClipPlanes
//purpose :
//=======================================================================
const Graphic3d_SetOfHClipPlane& Graphic3d_Structure::GetClipPlanes() const
const Graphic3d_SequenceOfHClipPlane& Graphic3d_Structure::GetClipPlanes() const
{
return MyCStructure.ClipPlanes;
}

View File

@ -74,8 +74,8 @@ void OpenGl_CappingAlgo::RenderCapping (const Handle(OpenGl_Workspace)& theWorks
// check whether algorithm need to be performed
Standard_Boolean isCapping = Standard_False;
const Graphic3d_SetOfHClipPlane& aContextPlanes = aContext->Clipping().Planes();
Graphic3d_SetOfHClipPlane::Iterator aCappingIt (aContextPlanes);
const Graphic3d_SequenceOfHClipPlane& aContextPlanes = aContext->Clipping().Planes();
Graphic3d_SequenceOfHClipPlane::Iterator aCappingIt (aContextPlanes);
for (; aCappingIt.More(); aCappingIt.Next())
{
const Handle(Graphic3d_ClipPlane)& aPlane = aCappingIt.Value();
@ -117,7 +117,7 @@ void OpenGl_CappingAlgo::RenderCapping (const Handle(OpenGl_Workspace)& theWorks
}
// enable only the rendering plane to generate stencil mask
Graphic3d_SetOfHClipPlane::Iterator aPlaneIt (aContextPlanes);
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (aContextPlanes);
for (; aPlaneIt.More(); aPlaneIt.Next())
{
const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();

View File

@ -53,7 +53,7 @@ void OpenGl_Clipping::Init (const Standard_Integer theMaxPlanes)
// function : Add
// purpose :
// =======================================================================
void OpenGl_Clipping::Add (Graphic3d_SetOfHClipPlane& thePlanes,
void OpenGl_Clipping::Add (Graphic3d_SequenceOfHClipPlane& thePlanes,
const EquationCoords& theCoordSpace,
const Handle(OpenGl_Workspace)& theWS)
{
@ -90,9 +90,9 @@ void OpenGl_Clipping::Add (Graphic3d_SetOfHClipPlane& thePlanes,
// function : Add
// purpose :
// =======================================================================
void OpenGl_Clipping::Add (Graphic3d_SetOfHClipPlane& thePlanes, const EquationCoords& theCoordSpace)
void OpenGl_Clipping::Add (Graphic3d_SequenceOfHClipPlane& thePlanes, const EquationCoords& theCoordSpace)
{
Graphic3d_SetOfHClipPlane::Iterator aPlaneIt (thePlanes);
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (thePlanes);
while (aPlaneIt.More() && myEmptyPlaneIds->Available() > 0)
{
const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
@ -103,7 +103,7 @@ void OpenGl_Clipping::Add (Graphic3d_SetOfHClipPlane& thePlanes, const EquationC
}
Standard_Integer anID = myEmptyPlaneIds->Next();
myPlanes.Add (aPlane);
myPlanes.Append (aPlane);
myPlaneStates.Bind (aPlane, PlaneProps (theCoordSpace, anID, Standard_True));
glEnable ((GLenum)anID);
@ -121,9 +121,9 @@ void OpenGl_Clipping::Add (Graphic3d_SetOfHClipPlane& thePlanes, const EquationC
// function : Remove
// purpose :
// =======================================================================
void OpenGl_Clipping::Remove (const Graphic3d_SetOfHClipPlane& thePlanes)
void OpenGl_Clipping::Remove (const Graphic3d_SequenceOfHClipPlane& thePlanes)
{
Graphic3d_SetOfHClipPlane::Iterator aPlaneIt (thePlanes);
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (thePlanes);
for (; aPlaneIt.More(); aPlaneIt.Next())
{
const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
@ -160,7 +160,7 @@ void OpenGl_Clipping::Remove (const Graphic3d_SetOfHClipPlane& thePlanes)
// purpose :
// =======================================================================
void OpenGl_Clipping::SetEnabled (const Handle(Graphic3d_ClipPlane)& thePlane,
const Standard_Boolean theIsEnabled)
const Standard_Boolean theIsEnabled)
{
if (!Contains (thePlane))
{

View File

@ -22,7 +22,7 @@
#include <Aspect_GenId.hxx>
#include <Graphic3d_ClipPlane.hxx>
#include <Graphic3d_SetOfHClipPlane.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
#include <NCollection_DataMap.hxx>
#include <NCollection_Handle.hxx>
#include <Standard_TypeDef.hxx>
@ -66,7 +66,7 @@ public: //! @name non-modifying getters
//! Get clip planes defined for context.
//! @return sequence of set clipping planes.
inline const Graphic3d_SetOfHClipPlane& Planes() const
inline const Graphic3d_SequenceOfHClipPlane& Planes() const
{
return myPlanes;
}
@ -97,7 +97,7 @@ public: //! @name clipping state modification commands
//! This list then can be used to fall back to previous state.
//! @param theCoordSpace [in] the equation definition space.
//! @param theWS [in] the workspace to access the matrices.
Standard_EXPORT void Add (Graphic3d_SetOfHClipPlane& thePlanes,
Standard_EXPORT void Add (Graphic3d_SequenceOfHClipPlane& thePlanes,
const EquationCoords& theCoordSpace,
const Handle(OpenGl_Workspace)& theWS);
@ -109,12 +109,12 @@ public: //! @name clipping state modification commands
//! The list then provides information on which planes were really added to clipping state.
//! This list then can be used to fall back to previous state.
//! @param theCoordSpace [in] the equation definition space.
Standard_EXPORT void Add (Graphic3d_SetOfHClipPlane& thePlanes,
Standard_EXPORT void Add (Graphic3d_SequenceOfHClipPlane& thePlanes,
const EquationCoords& theCoordSpace);
//! Remove the passed set of clipping planes from the context state.
//! @param thePlanes [in] the planes to remove from list.
Standard_EXPORT void Remove (const Graphic3d_SetOfHClipPlane& thePlanes);
Standard_EXPORT void Remove (const Graphic3d_SequenceOfHClipPlane& thePlanes);
//! Enable or disable clipping plane in the OpenGl context.
//! @param thePlane [in] the plane to affect.
@ -131,7 +131,7 @@ public: //! @name Short-cuts
//! The list then provides information on which planes were really added to clipping state.
//! This list then can be used to fall back to previous state.
//! @param theWS [in] the workspace to access the matrices.
inline void AddView (Graphic3d_SetOfHClipPlane& thePlanes, const Handle(OpenGl_Workspace)& theWS)
inline void AddView (Graphic3d_SequenceOfHClipPlane& thePlanes, const Handle(OpenGl_Workspace)& theWS)
{
Add (thePlanes, EquationCoords_View, theWS);
}
@ -142,7 +142,7 @@ public: //! @name Short-cuts
//! @param thePlanes [in/out] the list of planes to be added.
//! The list then provides information on which planes were really added to clipping state.
//! This list then can be used to fall back to previous state.
inline void AddView (Graphic3d_SetOfHClipPlane& thePlanes)
inline void AddView (Graphic3d_SequenceOfHClipPlane& thePlanes)
{
Add (thePlanes, EquationCoords_View);
}
@ -154,7 +154,7 @@ public: //! @name Short-cuts
//! The list then provides information on which planes were really added to clipping state.
//! This list then can be used to fall back to previous state.
//! @param theWS [in] the workspace to access the matrices.
inline void AddWorld (Graphic3d_SetOfHClipPlane& thePlanes, const Handle(OpenGl_Workspace)& theWS)
inline void AddWorld (Graphic3d_SequenceOfHClipPlane& thePlanes, const Handle(OpenGl_Workspace)& theWS)
{
Add (thePlanes, EquationCoords_World, theWS);
}
@ -165,7 +165,7 @@ public: //! @name Short-cuts
//! @param thePlanes [in/out] the list of planes to be added.
//! The list then provides information on which planes were really added to clipping state.
//! This list then can be used to fall back to previous state.
inline void AddWorld (Graphic3d_SetOfHClipPlane& thePlanes)
inline void AddWorld (Graphic3d_SequenceOfHClipPlane& thePlanes)
{
Add (thePlanes, EquationCoords_World);
}
@ -202,9 +202,9 @@ private:
typedef NCollection_DataMap<Handle(Graphic3d_ClipPlane), PlaneProps> OpenGl_MapOfPlaneStates;
typedef NCollection_Handle<Aspect_GenId> OpenGl_EmptyPlaneIds;
Graphic3d_SetOfHClipPlane myPlanes; //!< defined clipping planes.
OpenGl_MapOfPlaneStates myPlaneStates; //!< map of clip planes bound for the props.
OpenGl_EmptyPlaneIds myEmptyPlaneIds; //!< generator of empty ids.
Graphic3d_SequenceOfHClipPlane myPlanes; //!< defined clipping planes.
OpenGl_MapOfPlaneStates myPlaneStates; //!< map of clip planes bound for the props.
OpenGl_EmptyPlaneIds myEmptyPlaneIds; //!< generator of empty ids.
private:

View File

@ -512,7 +512,7 @@ void OpenGl_ShaderManager::PushClippingState (const Handle(OpenGl_ShaderProgram)
}
GLuint aPlanesNb = 0;
for (Graphic3d_SetOfHClipPlane::Iterator anIter (myContext->Clipping().Planes());
for (Graphic3d_SequenceOfHClipPlane::Iterator anIter (myContext->Clipping().Planes());
anIter.More(); anIter.Next())
{
const Handle(Graphic3d_ClipPlane)& aPlane = anIter.Value();
@ -531,7 +531,7 @@ void OpenGl_ShaderManager::PushClippingState (const Handle(OpenGl_ShaderProgram)
OpenGl_Vec4* anEquations = new OpenGl_Vec4[aPlanesNb];
GLint* aSpaces = new GLint [aPlanesNb];
GLuint aPlaneId = 0;
for (Graphic3d_SetOfHClipPlane::Iterator anIter (myContext->Clipping().Planes());
for (Graphic3d_SequenceOfHClipPlane::Iterator anIter (myContext->Clipping().Planes());
anIter.More(); anIter.Next())
{
const Handle(Graphic3d_ClipPlane)& aPlane = anIter.Value();

View File

@ -20,8 +20,6 @@
#ifndef _OpenGl_State_HeaderFile
#define _OpenGl_State_HeaderFile
#include <Graphic3d_SetOfHClipPlane.hxx>
#include <InterfaceGraphic_tgl_all.hxx>
#include <OpenGl_Element.hxx>

View File

@ -33,7 +33,7 @@
#include <OpenGl_View.hxx>
#include <OpenGl_Workspace.hxx>
#include <Graphic3d_SetOfHClipPlane_Handle.hxx>
#include <Graphic3d_SequenceOfHClipPlane_Handle.hxx>
//! Auxiliary class for bounding box presentation
class OpenGl_BndBoxPrs : public OpenGl_Element
@ -682,12 +682,12 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
const Handle(OpenGl_Context)& aContext = AWorkspace->GetGlContext();
// List of planes to be applied to context state
Handle(Graphic3d_SetOfHClipPlane) aUserPlanes;
Handle(Graphic3d_SequenceOfHClipPlane) aUserPlanes;
// Collect clipping planes of structure scope
if (!myClipPlanes.IsEmpty())
{
Graphic3d_SetOfHClipPlane::Iterator aClippingIt (myClipPlanes);
Graphic3d_SequenceOfHClipPlane::Iterator aClippingIt (myClipPlanes);
for (; aClippingIt.More(); aClippingIt.Next())
{
const Handle(Graphic3d_ClipPlane)& aClipPlane = aClippingIt.Value();
@ -698,10 +698,10 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
if (aUserPlanes.IsNull())
{
aUserPlanes = new Graphic3d_SetOfHClipPlane();
aUserPlanes = new Graphic3d_SequenceOfHClipPlane();
}
aUserPlanes->Add (aClipPlane);
aUserPlanes->Append (aClipPlane);
}
}

View File

@ -32,7 +32,7 @@
#include <OpenGl_Matrix.hxx>
#include <OpenGl_NamedStatus.hxx>
#include <Graphic3d_SetOfHClipPlane.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
class OpenGl_Structure;
@ -71,7 +71,7 @@ public:
Standard_Boolean IsVisible() const { return !(myNamedStatus & OPENGL_NS_HIDE); }
void SetClipPlanes (const Graphic3d_SetOfHClipPlane& thePlanes) { myClipPlanes = thePlanes; }
void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes) { myClipPlanes = thePlanes; }
void Connect (const OpenGl_Structure *astructure);
void Disconnect (const OpenGl_Structure *astructure);
@ -169,9 +169,9 @@ protected:
int myNamedStatus; //Structure_LABNameSet
int myZLayer;
OpenGl_ListOfStructure myConnected;
OpenGl_ListOfGroup myGroups;
Graphic3d_SetOfHClipPlane myClipPlanes;
OpenGl_ListOfStructure myConnected;
OpenGl_ListOfGroup myGroups;
Graphic3d_SequenceOfHClipPlane myClipPlanes;
#ifdef HAVE_OPENCL
mutable OpenGl_ListOfStructure myAncestorStructures;

View File

@ -37,7 +37,7 @@
#include <Graphic3d_CView.hxx>
#include <Graphic3d_CGraduatedTrihedron.hxx>
#include <Graphic3d_SetOfHClipPlane.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
#include <Visual3d_TypeOfSurfaceDetail.hxx>
#include <OpenGl_telem_view.hxx>
@ -115,7 +115,7 @@ class OpenGl_View : public MMgt_TShared
void SetBackfacing (const Standard_Integer AMode);
void SetLights (const CALL_DEF_VIEWCONTEXT &AContext);
void SetAntiAliasing (const Standard_Boolean AMode) { myAntiAliasing = AMode; }
void SetClipPlanes (const Graphic3d_SetOfHClipPlane &thePlanes) { myClipPlanes = thePlanes; }
void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane &thePlanes) { myClipPlanes = thePlanes; }
void SetVisualisation (const CALL_DEF_VIEWCONTEXT &AContext);
void SetClipLimit (const Graphic3d_CView& theCView);
@ -243,7 +243,7 @@ public:
OPENGL_EXTRA_REP myExtra;
//}
Graphic3d_SetOfHClipPlane myClipPlanes;
Graphic3d_SequenceOfHClipPlane myClipPlanes;
OPENGL_FOG myFog;
OpenGl_Trihedron* myTrihedron;

View File

@ -989,15 +989,15 @@ D = -[Px,Py,Pz] dot |Nx|
// do some "memory allocation"-wise optimization
if (!aPlaneBack.IsNull() || !aPlaneFront.IsNull())
{
Graphic3d_SetOfHClipPlane aSlicingPlanes;
Graphic3d_SequenceOfHClipPlane aSlicingPlanes;
if (!aPlaneBack.IsNull())
{
aSlicingPlanes.Add (aPlaneBack);
aSlicingPlanes.Append (aPlaneBack);
}
if (!aPlaneFront.IsNull())
{
aSlicingPlanes.Add (aPlaneFront);
aSlicingPlanes.Append (aPlaneFront);
}
// add planes at loaded view matrix state
@ -1008,14 +1008,14 @@ D = -[Px,Py,Pz] dot |Nx|
// Apply user clipping planes
if (!myClipPlanes.IsEmpty())
{
Graphic3d_SetOfHClipPlane aUserPlanes;
Graphic3d_SetOfHClipPlane::Iterator aClippingIt (myClipPlanes);
Graphic3d_SequenceOfHClipPlane aUserPlanes;
Graphic3d_SequenceOfHClipPlane::Iterator aClippingIt (myClipPlanes);
for (; aClippingIt.More(); aClippingIt.Next())
{
const Handle(Graphic3d_ClipPlane)& aClipPlane = aClippingIt.Value();
if (aClipPlane->IsOn())
{
aUserPlanes.Add (aClipPlane);
aUserPlanes.Append (aClipPlane);
}
}

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;
}

View File

@ -28,17 +28,17 @@ class ViewerSelector3d from StdSelect inherits ViewerSelector from SelectMgr
--
uses
View from V3d,
Selection from SelectMgr,
EntityOwner from SelectMgr,
Projector from Select3D,
Group from Graphic3d,
Structure from Graphic3d,
SetOfHClipPlane from Graphic3d,
Array1OfReal from TColStd,
Array1OfPnt2d from TColgp,
SensitivityMode from StdSelect,
Lin from gp
View from V3d,
Selection from SelectMgr,
EntityOwner from SelectMgr,
Projector from Select3D,
Group from Graphic3d,
Structure from Graphic3d,
SequenceOfHClipPlane from Graphic3d,
Array1OfReal from TColStd,
Array1OfPnt2d from TColgp,
SensitivityMode from StdSelect,
Lin from gp
is
@ -152,12 +152,12 @@ is
is static private;
---Level: Internal
SetClipping (me : mutable; thePlanes : SetOfHClipPlane from Graphic3d) is protected;
SetClipping (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d) is protected;
---Level: Internal
---Purpose: Set view clipping for the selector.
-- @param thePlanes [in] the view planes.
ComputeClipRange (me; thePlanes : SetOfHClipPlane from Graphic3d;
ComputeClipRange (me; thePlanes : SequenceOfHClipPlane from Graphic3d;
thePickLine : Lin from gp;
theDepthMin, theDepthMax : out Real from Standard)
is protected;
@ -207,12 +207,9 @@ fields
--areas verification...
myareagroup : Group from Graphic3d;
mysensgroup : Group from Graphic3d;
mystruct: Structure from Graphic3d;
myClipPlanes : SetOfHClipPlane from Graphic3d;
myareagroup : Group from Graphic3d;
mysensgroup : Group from Graphic3d;
mystruct : Structure from Graphic3d;
myClipPlanes : SequenceOfHClipPlane from Graphic3d;
end ViewerSelector3d;

View File

@ -33,7 +33,7 @@
#include <V3d_PerspectiveView.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Graphic3d_SetOfHClipPlane.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
#include <SelectMgr_SelectableObject.hxx>
#include <SelectMgr_DataMapIteratorOfDataMapOfIntegerSensitive.hxx>
#include <SelectBasics_ListOfBox2d.hxx>
@ -1048,7 +1048,7 @@ void StdSelect_ViewerSelector3d::ComputeAreasPrs (const Handle(SelectMgr_Selecti
//function : SetClipping
//purpose :
//=======================================================================
void StdSelect_ViewerSelector3d::SetClipping (const Graphic3d_SetOfHClipPlane& thePlanes)
void StdSelect_ViewerSelector3d::SetClipping (const Graphic3d_SequenceOfHClipPlane& thePlanes)
{
myClipPlanes = thePlanes;
}
@ -1057,7 +1057,7 @@ void StdSelect_ViewerSelector3d::SetClipping (const Graphic3d_SetOfHClipPlane& t
//function : ComputeClipRange
//purpose :
//=======================================================================
void StdSelect_ViewerSelector3d::ComputeClipRange (const Graphic3d_SetOfHClipPlane& thePlanes,
void StdSelect_ViewerSelector3d::ComputeClipRange (const Graphic3d_SequenceOfHClipPlane& thePlanes,
const gp_Lin& thePickLine,
Standard_Real& theDepthMin,
Standard_Real& theDepthMax) const
@ -1066,7 +1066,7 @@ void StdSelect_ViewerSelector3d::ComputeClipRange (const Graphic3d_SetOfHClipPla
theDepthMax = RealLast();
Standard_Real aPlaneA, aPlaneB, aPlaneC, aPlaneD;
Graphic3d_SetOfHClipPlane::Iterator aPlaneIt (thePlanes);
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (thePlanes);
for (; aPlaneIt.More(); aPlaneIt.Next())
{
const Handle(Graphic3d_ClipPlane)& aClipPlane = aPlaneIt.Value();

View File

@ -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

View File

@ -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();
}

View File

@ -38,15 +38,14 @@ class ContextView from Visual3d
uses
SequenceOfAddress from TColStd,
Light from Visual3d,
HSetOfLight from Visual3d,
TypeOfModel from Visual3d,
TypeOfVisualization from Visual3d,
TypeOfSurfaceDetail from Visual3d,
TextureEnv from Graphic3d,
SetOfHClipPlane from Graphic3d
SequenceOfAddress from TColStd,
Light from Visual3d,
HSetOfLight from Visual3d,
TypeOfModel from Visual3d,
TypeOfVisualization from Visual3d,
TypeOfSurfaceDetail from Visual3d,
TextureEnv from Graphic3d,
SequenceOfHClipPlane from Graphic3d
raises
@ -147,13 +146,14 @@ is
-- Clip Plane
---------------------------------------------------
SetClipPlanes (me : in out; thePlanes : SetOfHClipPlane from Graphic3d);
---Purpose: Set list of clip planes to the view context.
-- @param thePlanes [in] the clip planes to set.
GetClipPlanes (me) returns SetOfHClipPlane from Graphic3d;
ClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
---C++: return const&
---Purpose: Get clip planes.
---Purpose: Returns sequence of clip planes.
-- @return sequence of clip planes.
ChangeClipPlanes (me : in out) returns SequenceOfHClipPlane from Graphic3d;
---C++: return&
---Purpose: Change clip planes.
-- @return sequence of clip planes.
---------------------------------------------------
@ -440,6 +440,6 @@ fields
MyTextureEnv : TextureEnv from Graphic3d;
MySurfaceDetail : TypeOfSurfaceDetail from Visual3d;
myClipPlanes : SetOfHClipPlane from Graphic3d;
myClipPlanes : SequenceOfHClipPlane from Graphic3d;
end ContextView;

View File

@ -334,12 +334,20 @@ Visual3d_TypeOfSurfaceDetail Visual3d_ContextView::SurfaceDetail() const
return MySurfaceDetail;
}
void Visual3d_ContextView::SetClipPlanes (const Graphic3d_SetOfHClipPlane& thePlanes)
{
myClipPlanes = thePlanes;
}
const Graphic3d_SetOfHClipPlane& Visual3d_ContextView::GetClipPlanes() const
//=======================================================================
//function : ClipPlanes
//purpose :
//=======================================================================
const Graphic3d_SequenceOfHClipPlane& Visual3d_ContextView::ClipPlanes() const
{
return myClipPlanes;
}
//=======================================================================
//function : ChangeClipPlanes
//purpose :
//=======================================================================
Graphic3d_SequenceOfHClipPlane& Visual3d_ContextView::ChangeClipPlanes()
{
return myClipPlanes;
}

View File

@ -745,12 +745,13 @@ void Visual3d_View::UpdateLights()
MyCView.Context.ActiveLight = NULL;
}
void Visual3d_View::UpdatePlanes()
void Visual3d_View::UpdatePlanes()
{
MyCView.Context.ClipPlanes = MyContext.GetClipPlanes();
MyCView.Context.ClipPlanes = MyContext.ClipPlanes();
if (IsDeleted() || !IsDefined())
{
return;
}
MyGraphicDriver->SetClipPlanes (MyCView);
}