mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027816: Visualization - provide an API for overriding clipping planes list
Graphic3d_SequenceOfHClipPlane now inherits Standard_Transient. PrsMgr_PresentableObject, Graphic3d_Structure, Graphic3d_CStructure, V3d_View, OpenGl_View now manages the plane list by Handle. The getters ::GetClipPlanes() has been removed, setters taking non-handle ::SetClipPlanes() has been marked deprecated. OpenGl_Structure::Render() and SelectMgr_ViewerSelector::checkOverlap() now disable global (view) clipping planes for objects with flags Graphic3d_TMF_TriedronPers and Graphic3d_TMF_2d or with new flag Graphic3d_SequenceOfHClipPlane::ToOverrideGlobal(). OpenGl_Clipping now implements interface for managing clipping planes without copying the sequences. The filtering of duplicates is no more performed by OpenGl_Clipping - application is responsible to not do this. OpenGl_Clipping tries avoiding unnecessary allocations for managing list of active planes. MFC sample has been updated to use V3d_View::ClipPlanes() method.
This commit is contained in:
@@ -47,13 +47,13 @@ public:
|
||||
}
|
||||
|
||||
//! @return associated clip planes
|
||||
const Graphic3d_SequenceOfHClipPlane& ClipPlanes() const
|
||||
const Handle(Graphic3d_SequenceOfHClipPlane)& ClipPlanes() const
|
||||
{
|
||||
return myClipPlanes;
|
||||
}
|
||||
|
||||
//! Pass clip planes to the associated graphic driver structure
|
||||
void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes) { myClipPlanes = thePlanes; }
|
||||
void SetClipPlanes (const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes) { myClipPlanes = thePlanes; }
|
||||
|
||||
//! @return bounding box of this presentation
|
||||
const Graphic3d_BndBox4f& BoundingBox() const
|
||||
@@ -155,7 +155,7 @@ protected:
|
||||
Handle(Graphic3d_GraphicDriver) myGraphicDriver;
|
||||
Graphic3d_SequenceOfGroup myGroups;
|
||||
Graphic3d_BndBox4f myBndBox;
|
||||
Graphic3d_SequenceOfHClipPlane myClipPlanes;
|
||||
Handle(Graphic3d_SequenceOfHClipPlane) myClipPlanes;
|
||||
|
||||
public:
|
||||
|
||||
|
@@ -456,10 +456,10 @@ public:
|
||||
virtual void SetLights (const Graphic3d_ListOfCLight& theLights) = 0;
|
||||
|
||||
//! Returns list of clip planes set for the view.
|
||||
virtual const Graphic3d_SequenceOfHClipPlane& ClipPlanes() const = 0;
|
||||
virtual const Handle(Graphic3d_SequenceOfHClipPlane)& ClipPlanes() const = 0;
|
||||
|
||||
//! Sets list of clip planes for the view.
|
||||
virtual void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes) = 0;
|
||||
virtual void SetClipPlanes (const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes) = 0;
|
||||
|
||||
//! Fill in the dictionary with diagnostic info.
|
||||
//! Should be called within rendering thread.
|
||||
|
@@ -17,9 +17,32 @@
|
||||
#define _Graphic3d_SequenceOfHClipPlane_HeaderFile
|
||||
|
||||
#include <NCollection_Sequence.hxx>
|
||||
#include <NCollection_Shared.hxx>
|
||||
#include <Graphic3d_ClipPlane.hxx>
|
||||
|
||||
// CDL-header shortcut for sequence of graphical clipping planes.
|
||||
typedef NCollection_Sequence<Handle(Graphic3d_ClipPlane)> Graphic3d_SequenceOfHClipPlane;
|
||||
//! Class defining the sequence of clipping planes.
|
||||
class Graphic3d_SequenceOfHClipPlane : public Standard_Transient, public NCollection_Sequence<Handle(Graphic3d_ClipPlane)>
|
||||
{
|
||||
DEFINE_STANDARD_RTTI_INLINE(Graphic3d_SequenceOfHClipPlane,Standard_Transient)
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
DEFINE_NCOLLECTION_ALLOC
|
||||
|
||||
#endif
|
||||
//! Empty constructor.
|
||||
Graphic3d_SequenceOfHClipPlane() : myToOverrideGlobal (Standard_False) {}
|
||||
|
||||
//! Return true if local properties should override global properties.
|
||||
Standard_Boolean ToOverrideGlobal() const { return myToOverrideGlobal; }
|
||||
|
||||
//! Setup flag defining if local properties should override global properties.
|
||||
void SetOverrideGlobal (const Standard_Boolean theToOverride) { myToOverrideGlobal = theToOverride; }
|
||||
|
||||
private:
|
||||
|
||||
Standard_Boolean myToOverrideGlobal;
|
||||
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_SequenceOfHClipPlane, Standard_Transient)
|
||||
|
||||
#endif // _Graphic3d_SequenceOfHClipPlane_HeaderFile
|
||||
|
@@ -1595,7 +1595,7 @@ Graphic3d_ZLayerId Graphic3d_Structure::GetZLayer() const
|
||||
//function : SetClipPlanes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Graphic3d_Structure::SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes)
|
||||
void Graphic3d_Structure::SetClipPlanes (const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes)
|
||||
{
|
||||
myCStructure->SetClipPlanes (thePlanes);
|
||||
}
|
||||
@@ -1604,7 +1604,7 @@ void Graphic3d_Structure::SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& t
|
||||
//function : GetClipPlanes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Graphic3d_SequenceOfHClipPlane& Graphic3d_Structure::GetClipPlanes() const
|
||||
const Handle(Graphic3d_SequenceOfHClipPlane)& Graphic3d_Structure::ClipPlanes() const
|
||||
{
|
||||
return myCStructure->ClipPlanes();
|
||||
}
|
||||
|
@@ -161,11 +161,11 @@ public:
|
||||
|
||||
//! Changes a sequence of clip planes slicing the structure on rendering.
|
||||
//! @param thePlanes [in] the set of clip planes.
|
||||
Standard_EXPORT void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes);
|
||||
Standard_EXPORT void SetClipPlanes (const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes);
|
||||
|
||||
//! Get clip planes slicing the structure on rendering.
|
||||
//! @return set of clip planes.
|
||||
Standard_EXPORT const Graphic3d_SequenceOfHClipPlane& GetClipPlanes() const;
|
||||
Standard_EXPORT const Handle(Graphic3d_SequenceOfHClipPlane)& ClipPlanes() const;
|
||||
|
||||
//! Modifies the visibility indicator to Standard_True or
|
||||
//! Standard_False for the structure <me>.
|
||||
|
Reference in New Issue
Block a user