mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-06-30 12:14:08 +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:
parent
28cec2ba3e
commit
51b10cd466
@ -68,5 +68,5 @@ Graphic3d_MarkerImage_Handle.hxx
|
|||||||
Graphic3d_ClipPlane.hxx
|
Graphic3d_ClipPlane.hxx
|
||||||
Graphic3d_ClipPlane.cxx
|
Graphic3d_ClipPlane.cxx
|
||||||
Graphic3d_ClipPlane_Handle.hxx
|
Graphic3d_ClipPlane_Handle.hxx
|
||||||
Graphic3d_SetOfHClipPlane.hxx
|
Graphic3d_SequenceOfHClipPlane.hxx
|
||||||
Graphic3d_SetOfHClipPlane_Handle.hxx
|
Graphic3d_SequenceOfHClipPlane_Handle.hxx
|
||||||
|
@ -587,9 +587,9 @@ is
|
|||||||
imported ShaderProgram_Handle;
|
imported ShaderProgram_Handle;
|
||||||
---Category: Instantiated classes
|
---Category: Instantiated classes
|
||||||
|
|
||||||
imported SetOfHClipPlane;
|
imported SequenceOfHClipPlane;
|
||||||
---Category: Instantiated classes
|
---Category: Instantiated classes
|
||||||
-- Set of handles on clip planes
|
-- Sequence of handles on clip planes
|
||||||
|
|
||||||
deferred class TextureRoot from Graphic3d;
|
deferred class TextureRoot from Graphic3d;
|
||||||
deferred class TextureMap from Graphic3d;
|
deferred class TextureMap from Graphic3d;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#define _Graphic3d_CStructure_HeaderFile
|
#define _Graphic3d_CStructure_HeaderFile
|
||||||
|
|
||||||
#include <Graphic3d_CGroup.hxx>
|
#include <Graphic3d_CGroup.hxx>
|
||||||
#include <Graphic3d_SetOfHClipPlane.hxx>
|
#include <Graphic3d_SequenceOfHClipPlane.hxx>
|
||||||
|
|
||||||
class Graphic3d_CStructure
|
class Graphic3d_CStructure
|
||||||
{
|
{
|
||||||
@ -56,7 +56,7 @@ public:
|
|||||||
|
|
||||||
CALL_DEF_TRANSFORM_PERSISTENCE TransformPersistence;
|
CALL_DEF_TRANSFORM_PERSISTENCE TransformPersistence;
|
||||||
|
|
||||||
Graphic3d_SetOfHClipPlane ClipPlanes;
|
Graphic3d_SequenceOfHClipPlane ClipPlanes;
|
||||||
};
|
};
|
||||||
|
|
||||||
///typedef Graphic3d_CStructure CALL_DEF_STRUCTURE;
|
///typedef Graphic3d_CStructure CALL_DEF_STRUCTURE;
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <InterfaceGraphic_Visual3d.hxx>
|
#include <InterfaceGraphic_Visual3d.hxx>
|
||||||
#include <Handle_Graphic3d_TextureEnv.hxx>
|
#include <Handle_Graphic3d_TextureEnv.hxx>
|
||||||
#include <Graphic3d_CLight.hxx>
|
#include <Graphic3d_CLight.hxx>
|
||||||
#include <Graphic3d_SetOfHClipPlane.hxx>
|
#include <Graphic3d_SequenceOfHClipPlane.hxx>
|
||||||
|
|
||||||
class CALL_DEF_VIEWCONTEXT
|
class CALL_DEF_VIEWCONTEXT
|
||||||
{
|
{
|
||||||
@ -74,7 +74,7 @@ public:
|
|||||||
Handle(Graphic3d_TextureEnv) TextureEnv;
|
Handle(Graphic3d_TextureEnv) TextureEnv;
|
||||||
int SurfaceDetail;
|
int SurfaceDetail;
|
||||||
|
|
||||||
Graphic3d_SetOfHClipPlane ClipPlanes;
|
Graphic3d_SequenceOfHClipPlane ClipPlanes;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Graphic3d_CView
|
class Graphic3d_CView
|
||||||
|
@ -17,14 +17,13 @@
|
|||||||
// purpose or non-infringement Please see the License for the specific terms
|
// purpose or non-infringement Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License
|
// and conditions governing the rights and limitations under the License
|
||||||
|
|
||||||
#ifndef _Graphic3d_SetOfHClipPlane_HeaderFile
|
#ifndef _Graphic3d_SequenceOfHClipPlane_HeaderFile
|
||||||
#define _Graphic3d_SetOfHClipPlane_HeaderFile
|
#define _Graphic3d_SequenceOfHClipPlane_HeaderFile
|
||||||
|
|
||||||
#include <NCollection_Set.hxx>
|
#include <NCollection_Sequence.hxx>
|
||||||
#include <Graphic3d_ClipPlane.hxx>
|
#include <Graphic3d_ClipPlane.hxx>
|
||||||
|
|
||||||
// CDL-header shortcut for set of graphical clipping planes. This is a compact
|
// CDL-header shortcut for sequence of graphical clipping planes.
|
||||||
// way (compared to list) to store clippings, with mandatory uniqueness check.
|
typedef NCollection_Sequence<Handle(Graphic3d_ClipPlane)> Graphic3d_SequenceOfHClipPlane;
|
||||||
typedef NCollection_Set<Handle(Graphic3d_ClipPlane)> Graphic3d_SetOfHClipPlane;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -17,12 +17,12 @@
|
|||||||
// purpose or non-infringement Please see the License for the specific terms
|
// purpose or non-infringement Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License
|
// and conditions governing the rights and limitations under the License
|
||||||
|
|
||||||
#ifndef _Graphic3d_SetOfHClipPlane_Handle_HeaderFile
|
#ifndef _Graphic3d_SequenceOfHClipPlane_Handle_HeaderFile
|
||||||
#define _Graphic3d_SetOfHClipPlane_Handle_HeaderFile
|
#define _Graphic3d_SequenceOfHClipPlane_Handle_HeaderFile
|
||||||
|
|
||||||
#include <NCollection_Handle.hxx>
|
#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
|
#endif
|
@ -75,7 +75,7 @@ uses
|
|||||||
Vertex from Graphic3d,
|
Vertex from Graphic3d,
|
||||||
TransModeFlags from Graphic3d,
|
TransModeFlags from Graphic3d,
|
||||||
Pnt from gp,
|
Pnt from gp,
|
||||||
SetOfHClipPlane from Graphic3d
|
SequenceOfHClipPlane from Graphic3d
|
||||||
|
|
||||||
raises
|
raises
|
||||||
|
|
||||||
@ -271,11 +271,11 @@ is
|
|||||||
---Purpose: Get Z layer ID of displayed structure. The method
|
---Purpose: Get Z layer ID of displayed structure. The method
|
||||||
-- returns -1 if the structure has no ID (deleted from graphic driver).
|
-- returns -1 if the structure has no ID (deleted from graphic driver).
|
||||||
|
|
||||||
SetClipPlanes (me : mutable; thePlanes : SetOfHClipPlane from Graphic3d) is static;
|
SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d) is static;
|
||||||
---Purpose: Changes a set of clip planes slicing the structure on rendering.
|
---Purpose: Changes a sequence of clip planes slicing the structure on rendering.
|
||||||
-- @param thePlanes [in] the set of clip planes.
|
-- @param thePlanes [in] the set of clip planes.
|
||||||
|
|
||||||
GetClipPlanes (me) returns SetOfHClipPlane from Graphic3d;
|
GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
|
||||||
---C++: return const&
|
---C++: return const&
|
||||||
---Purpose: Get clip planes slicing the structure on rendering.
|
---Purpose: Get clip planes slicing the structure on rendering.
|
||||||
-- @return set of clip planes.
|
-- @return set of clip planes.
|
||||||
|
@ -2497,7 +2497,7 @@ Standard_Integer Graphic3d_Structure::GetZLayer () const
|
|||||||
//function : SetClipPlanes
|
//function : SetClipPlanes
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void Graphic3d_Structure::SetClipPlanes (const Graphic3d_SetOfHClipPlane& thePlanes)
|
void Graphic3d_Structure::SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes)
|
||||||
{
|
{
|
||||||
MyCStructure.ClipPlanes = thePlanes;
|
MyCStructure.ClipPlanes = thePlanes;
|
||||||
MyGraphicDriver->SetClipPlanes (MyCStructure);
|
MyGraphicDriver->SetClipPlanes (MyCStructure);
|
||||||
@ -2507,7 +2507,7 @@ void Graphic3d_Structure::SetClipPlanes (const Graphic3d_SetOfHClipPlane& thePla
|
|||||||
//function : GetClipPlanes
|
//function : GetClipPlanes
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
const Graphic3d_SetOfHClipPlane& Graphic3d_Structure::GetClipPlanes() const
|
const Graphic3d_SequenceOfHClipPlane& Graphic3d_Structure::GetClipPlanes() const
|
||||||
{
|
{
|
||||||
return MyCStructure.ClipPlanes;
|
return MyCStructure.ClipPlanes;
|
||||||
}
|
}
|
||||||
|
@ -74,8 +74,8 @@ void OpenGl_CappingAlgo::RenderCapping (const Handle(OpenGl_Workspace)& theWorks
|
|||||||
|
|
||||||
// check whether algorithm need to be performed
|
// check whether algorithm need to be performed
|
||||||
Standard_Boolean isCapping = Standard_False;
|
Standard_Boolean isCapping = Standard_False;
|
||||||
const Graphic3d_SetOfHClipPlane& aContextPlanes = aContext->Clipping().Planes();
|
const Graphic3d_SequenceOfHClipPlane& aContextPlanes = aContext->Clipping().Planes();
|
||||||
Graphic3d_SetOfHClipPlane::Iterator aCappingIt (aContextPlanes);
|
Graphic3d_SequenceOfHClipPlane::Iterator aCappingIt (aContextPlanes);
|
||||||
for (; aCappingIt.More(); aCappingIt.Next())
|
for (; aCappingIt.More(); aCappingIt.Next())
|
||||||
{
|
{
|
||||||
const Handle(Graphic3d_ClipPlane)& aPlane = aCappingIt.Value();
|
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
|
// enable only the rendering plane to generate stencil mask
|
||||||
Graphic3d_SetOfHClipPlane::Iterator aPlaneIt (aContextPlanes);
|
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (aContextPlanes);
|
||||||
for (; aPlaneIt.More(); aPlaneIt.Next())
|
for (; aPlaneIt.More(); aPlaneIt.Next())
|
||||||
{
|
{
|
||||||
const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
|
const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
|
||||||
|
@ -53,7 +53,7 @@ void OpenGl_Clipping::Init (const Standard_Integer theMaxPlanes)
|
|||||||
// function : Add
|
// function : Add
|
||||||
// purpose :
|
// purpose :
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
void OpenGl_Clipping::Add (Graphic3d_SetOfHClipPlane& thePlanes,
|
void OpenGl_Clipping::Add (Graphic3d_SequenceOfHClipPlane& thePlanes,
|
||||||
const EquationCoords& theCoordSpace,
|
const EquationCoords& theCoordSpace,
|
||||||
const Handle(OpenGl_Workspace)& theWS)
|
const Handle(OpenGl_Workspace)& theWS)
|
||||||
{
|
{
|
||||||
@ -90,9 +90,9 @@ void OpenGl_Clipping::Add (Graphic3d_SetOfHClipPlane& thePlanes,
|
|||||||
// function : Add
|
// function : Add
|
||||||
// purpose :
|
// 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)
|
while (aPlaneIt.More() && myEmptyPlaneIds->Available() > 0)
|
||||||
{
|
{
|
||||||
const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
|
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();
|
Standard_Integer anID = myEmptyPlaneIds->Next();
|
||||||
myPlanes.Add (aPlane);
|
myPlanes.Append (aPlane);
|
||||||
myPlaneStates.Bind (aPlane, PlaneProps (theCoordSpace, anID, Standard_True));
|
myPlaneStates.Bind (aPlane, PlaneProps (theCoordSpace, anID, Standard_True));
|
||||||
|
|
||||||
glEnable ((GLenum)anID);
|
glEnable ((GLenum)anID);
|
||||||
@ -121,9 +121,9 @@ void OpenGl_Clipping::Add (Graphic3d_SetOfHClipPlane& thePlanes, const EquationC
|
|||||||
// function : Remove
|
// function : Remove
|
||||||
// purpose :
|
// 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())
|
for (; aPlaneIt.More(); aPlaneIt.Next())
|
||||||
{
|
{
|
||||||
const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
|
const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
|
||||||
@ -160,7 +160,7 @@ void OpenGl_Clipping::Remove (const Graphic3d_SetOfHClipPlane& thePlanes)
|
|||||||
// purpose :
|
// purpose :
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
void OpenGl_Clipping::SetEnabled (const Handle(Graphic3d_ClipPlane)& thePlane,
|
void OpenGl_Clipping::SetEnabled (const Handle(Graphic3d_ClipPlane)& thePlane,
|
||||||
const Standard_Boolean theIsEnabled)
|
const Standard_Boolean theIsEnabled)
|
||||||
{
|
{
|
||||||
if (!Contains (thePlane))
|
if (!Contains (thePlane))
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include <Aspect_GenId.hxx>
|
#include <Aspect_GenId.hxx>
|
||||||
#include <Graphic3d_ClipPlane.hxx>
|
#include <Graphic3d_ClipPlane.hxx>
|
||||||
#include <Graphic3d_SetOfHClipPlane.hxx>
|
#include <Graphic3d_SequenceOfHClipPlane.hxx>
|
||||||
#include <NCollection_DataMap.hxx>
|
#include <NCollection_DataMap.hxx>
|
||||||
#include <NCollection_Handle.hxx>
|
#include <NCollection_Handle.hxx>
|
||||||
#include <Standard_TypeDef.hxx>
|
#include <Standard_TypeDef.hxx>
|
||||||
@ -66,7 +66,7 @@ public: //! @name non-modifying getters
|
|||||||
|
|
||||||
//! Get clip planes defined for context.
|
//! Get clip planes defined for context.
|
||||||
//! @return sequence of set clipping planes.
|
//! @return sequence of set clipping planes.
|
||||||
inline const Graphic3d_SetOfHClipPlane& Planes() const
|
inline const Graphic3d_SequenceOfHClipPlane& Planes() const
|
||||||
{
|
{
|
||||||
return myPlanes;
|
return myPlanes;
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ public: //! @name clipping state modification commands
|
|||||||
//! This list then can be used to fall back to previous state.
|
//! This list then can be used to fall back to previous state.
|
||||||
//! @param theCoordSpace [in] the equation definition space.
|
//! @param theCoordSpace [in] the equation definition space.
|
||||||
//! @param theWS [in] the workspace to access the matrices.
|
//! @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 EquationCoords& theCoordSpace,
|
||||||
const Handle(OpenGl_Workspace)& theWS);
|
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.
|
//! 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.
|
//! This list then can be used to fall back to previous state.
|
||||||
//! @param theCoordSpace [in] the equation definition space.
|
//! @param theCoordSpace [in] the equation definition space.
|
||||||
Standard_EXPORT void Add (Graphic3d_SetOfHClipPlane& thePlanes,
|
Standard_EXPORT void Add (Graphic3d_SequenceOfHClipPlane& thePlanes,
|
||||||
const EquationCoords& theCoordSpace);
|
const EquationCoords& theCoordSpace);
|
||||||
|
|
||||||
//! Remove the passed set of clipping planes from the context state.
|
//! Remove the passed set of clipping planes from the context state.
|
||||||
//! @param thePlanes [in] the planes to remove from list.
|
//! @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.
|
//! Enable or disable clipping plane in the OpenGl context.
|
||||||
//! @param thePlane [in] the plane to affect.
|
//! @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.
|
//! 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.
|
//! This list then can be used to fall back to previous state.
|
||||||
//! @param theWS [in] the workspace to access the matrices.
|
//! @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);
|
Add (thePlanes, EquationCoords_View, theWS);
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ public: //! @name Short-cuts
|
|||||||
//! @param thePlanes [in/out] the list of planes to be added.
|
//! @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.
|
//! 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.
|
//! 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);
|
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.
|
//! 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.
|
//! This list then can be used to fall back to previous state.
|
||||||
//! @param theWS [in] the workspace to access the matrices.
|
//! @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);
|
Add (thePlanes, EquationCoords_World, theWS);
|
||||||
}
|
}
|
||||||
@ -165,7 +165,7 @@ public: //! @name Short-cuts
|
|||||||
//! @param thePlanes [in/out] the list of planes to be added.
|
//! @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.
|
//! 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.
|
//! 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);
|
Add (thePlanes, EquationCoords_World);
|
||||||
}
|
}
|
||||||
@ -202,9 +202,9 @@ private:
|
|||||||
typedef NCollection_DataMap<Handle(Graphic3d_ClipPlane), PlaneProps> OpenGl_MapOfPlaneStates;
|
typedef NCollection_DataMap<Handle(Graphic3d_ClipPlane), PlaneProps> OpenGl_MapOfPlaneStates;
|
||||||
typedef NCollection_Handle<Aspect_GenId> OpenGl_EmptyPlaneIds;
|
typedef NCollection_Handle<Aspect_GenId> OpenGl_EmptyPlaneIds;
|
||||||
|
|
||||||
Graphic3d_SetOfHClipPlane myPlanes; //!< defined clipping planes.
|
Graphic3d_SequenceOfHClipPlane myPlanes; //!< defined clipping planes.
|
||||||
OpenGl_MapOfPlaneStates myPlaneStates; //!< map of clip planes bound for the props.
|
OpenGl_MapOfPlaneStates myPlaneStates; //!< map of clip planes bound for the props.
|
||||||
OpenGl_EmptyPlaneIds myEmptyPlaneIds; //!< generator of empty ids.
|
OpenGl_EmptyPlaneIds myEmptyPlaneIds; //!< generator of empty ids.
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@ void OpenGl_ShaderManager::PushClippingState (const Handle(OpenGl_ShaderProgram)
|
|||||||
}
|
}
|
||||||
|
|
||||||
GLuint aPlanesNb = 0;
|
GLuint aPlanesNb = 0;
|
||||||
for (Graphic3d_SetOfHClipPlane::Iterator anIter (myContext->Clipping().Planes());
|
for (Graphic3d_SequenceOfHClipPlane::Iterator anIter (myContext->Clipping().Planes());
|
||||||
anIter.More(); anIter.Next())
|
anIter.More(); anIter.Next())
|
||||||
{
|
{
|
||||||
const Handle(Graphic3d_ClipPlane)& aPlane = anIter.Value();
|
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];
|
OpenGl_Vec4* anEquations = new OpenGl_Vec4[aPlanesNb];
|
||||||
GLint* aSpaces = new GLint [aPlanesNb];
|
GLint* aSpaces = new GLint [aPlanesNb];
|
||||||
GLuint aPlaneId = 0;
|
GLuint aPlaneId = 0;
|
||||||
for (Graphic3d_SetOfHClipPlane::Iterator anIter (myContext->Clipping().Planes());
|
for (Graphic3d_SequenceOfHClipPlane::Iterator anIter (myContext->Clipping().Planes());
|
||||||
anIter.More(); anIter.Next())
|
anIter.More(); anIter.Next())
|
||||||
{
|
{
|
||||||
const Handle(Graphic3d_ClipPlane)& aPlane = anIter.Value();
|
const Handle(Graphic3d_ClipPlane)& aPlane = anIter.Value();
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef _OpenGl_State_HeaderFile
|
#ifndef _OpenGl_State_HeaderFile
|
||||||
#define _OpenGl_State_HeaderFile
|
#define _OpenGl_State_HeaderFile
|
||||||
|
|
||||||
#include <Graphic3d_SetOfHClipPlane.hxx>
|
|
||||||
|
|
||||||
#include <InterfaceGraphic_tgl_all.hxx>
|
#include <InterfaceGraphic_tgl_all.hxx>
|
||||||
|
|
||||||
#include <OpenGl_Element.hxx>
|
#include <OpenGl_Element.hxx>
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include <OpenGl_View.hxx>
|
#include <OpenGl_View.hxx>
|
||||||
#include <OpenGl_Workspace.hxx>
|
#include <OpenGl_Workspace.hxx>
|
||||||
|
|
||||||
#include <Graphic3d_SetOfHClipPlane_Handle.hxx>
|
#include <Graphic3d_SequenceOfHClipPlane_Handle.hxx>
|
||||||
|
|
||||||
//! Auxiliary class for bounding box presentation
|
//! Auxiliary class for bounding box presentation
|
||||||
class OpenGl_BndBoxPrs : public OpenGl_Element
|
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();
|
const Handle(OpenGl_Context)& aContext = AWorkspace->GetGlContext();
|
||||||
|
|
||||||
// List of planes to be applied to context state
|
// List of planes to be applied to context state
|
||||||
Handle(Graphic3d_SetOfHClipPlane) aUserPlanes;
|
Handle(Graphic3d_SequenceOfHClipPlane) aUserPlanes;
|
||||||
|
|
||||||
// Collect clipping planes of structure scope
|
// Collect clipping planes of structure scope
|
||||||
if (!myClipPlanes.IsEmpty())
|
if (!myClipPlanes.IsEmpty())
|
||||||
{
|
{
|
||||||
Graphic3d_SetOfHClipPlane::Iterator aClippingIt (myClipPlanes);
|
Graphic3d_SequenceOfHClipPlane::Iterator aClippingIt (myClipPlanes);
|
||||||
for (; aClippingIt.More(); aClippingIt.Next())
|
for (; aClippingIt.More(); aClippingIt.Next())
|
||||||
{
|
{
|
||||||
const Handle(Graphic3d_ClipPlane)& aClipPlane = aClippingIt.Value();
|
const Handle(Graphic3d_ClipPlane)& aClipPlane = aClippingIt.Value();
|
||||||
@ -698,10 +698,10 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
|
|||||||
|
|
||||||
if (aUserPlanes.IsNull())
|
if (aUserPlanes.IsNull())
|
||||||
{
|
{
|
||||||
aUserPlanes = new Graphic3d_SetOfHClipPlane();
|
aUserPlanes = new Graphic3d_SequenceOfHClipPlane();
|
||||||
}
|
}
|
||||||
|
|
||||||
aUserPlanes->Add (aClipPlane);
|
aUserPlanes->Append (aClipPlane);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include <OpenGl_Matrix.hxx>
|
#include <OpenGl_Matrix.hxx>
|
||||||
#include <OpenGl_NamedStatus.hxx>
|
#include <OpenGl_NamedStatus.hxx>
|
||||||
|
|
||||||
#include <Graphic3d_SetOfHClipPlane.hxx>
|
#include <Graphic3d_SequenceOfHClipPlane.hxx>
|
||||||
|
|
||||||
class OpenGl_Structure;
|
class OpenGl_Structure;
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ public:
|
|||||||
|
|
||||||
Standard_Boolean IsVisible() const { return !(myNamedStatus & OPENGL_NS_HIDE); }
|
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 Connect (const OpenGl_Structure *astructure);
|
||||||
void Disconnect (const OpenGl_Structure *astructure);
|
void Disconnect (const OpenGl_Structure *astructure);
|
||||||
@ -169,9 +169,9 @@ protected:
|
|||||||
int myNamedStatus; //Structure_LABNameSet
|
int myNamedStatus; //Structure_LABNameSet
|
||||||
int myZLayer;
|
int myZLayer;
|
||||||
|
|
||||||
OpenGl_ListOfStructure myConnected;
|
OpenGl_ListOfStructure myConnected;
|
||||||
OpenGl_ListOfGroup myGroups;
|
OpenGl_ListOfGroup myGroups;
|
||||||
Graphic3d_SetOfHClipPlane myClipPlanes;
|
Graphic3d_SequenceOfHClipPlane myClipPlanes;
|
||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
mutable OpenGl_ListOfStructure myAncestorStructures;
|
mutable OpenGl_ListOfStructure myAncestorStructures;
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#include <Graphic3d_CView.hxx>
|
#include <Graphic3d_CView.hxx>
|
||||||
#include <Graphic3d_CGraduatedTrihedron.hxx>
|
#include <Graphic3d_CGraduatedTrihedron.hxx>
|
||||||
#include <Graphic3d_SetOfHClipPlane.hxx>
|
#include <Graphic3d_SequenceOfHClipPlane.hxx>
|
||||||
#include <Visual3d_TypeOfSurfaceDetail.hxx>
|
#include <Visual3d_TypeOfSurfaceDetail.hxx>
|
||||||
|
|
||||||
#include <OpenGl_telem_view.hxx>
|
#include <OpenGl_telem_view.hxx>
|
||||||
@ -115,7 +115,7 @@ class OpenGl_View : public MMgt_TShared
|
|||||||
void SetBackfacing (const Standard_Integer AMode);
|
void SetBackfacing (const Standard_Integer AMode);
|
||||||
void SetLights (const CALL_DEF_VIEWCONTEXT &AContext);
|
void SetLights (const CALL_DEF_VIEWCONTEXT &AContext);
|
||||||
void SetAntiAliasing (const Standard_Boolean AMode) { myAntiAliasing = AMode; }
|
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 SetVisualisation (const CALL_DEF_VIEWCONTEXT &AContext);
|
||||||
|
|
||||||
void SetClipLimit (const Graphic3d_CView& theCView);
|
void SetClipLimit (const Graphic3d_CView& theCView);
|
||||||
@ -243,7 +243,7 @@ public:
|
|||||||
OPENGL_EXTRA_REP myExtra;
|
OPENGL_EXTRA_REP myExtra;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
Graphic3d_SetOfHClipPlane myClipPlanes;
|
Graphic3d_SequenceOfHClipPlane myClipPlanes;
|
||||||
|
|
||||||
OPENGL_FOG myFog;
|
OPENGL_FOG myFog;
|
||||||
OpenGl_Trihedron* myTrihedron;
|
OpenGl_Trihedron* myTrihedron;
|
||||||
|
@ -989,15 +989,15 @@ D = -[Px,Py,Pz] dot |Nx|
|
|||||||
// do some "memory allocation"-wise optimization
|
// do some "memory allocation"-wise optimization
|
||||||
if (!aPlaneBack.IsNull() || !aPlaneFront.IsNull())
|
if (!aPlaneBack.IsNull() || !aPlaneFront.IsNull())
|
||||||
{
|
{
|
||||||
Graphic3d_SetOfHClipPlane aSlicingPlanes;
|
Graphic3d_SequenceOfHClipPlane aSlicingPlanes;
|
||||||
if (!aPlaneBack.IsNull())
|
if (!aPlaneBack.IsNull())
|
||||||
{
|
{
|
||||||
aSlicingPlanes.Add (aPlaneBack);
|
aSlicingPlanes.Append (aPlaneBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!aPlaneFront.IsNull())
|
if (!aPlaneFront.IsNull())
|
||||||
{
|
{
|
||||||
aSlicingPlanes.Add (aPlaneFront);
|
aSlicingPlanes.Append (aPlaneFront);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add planes at loaded view matrix state
|
// add planes at loaded view matrix state
|
||||||
@ -1008,14 +1008,14 @@ D = -[Px,Py,Pz] dot |Nx|
|
|||||||
// Apply user clipping planes
|
// Apply user clipping planes
|
||||||
if (!myClipPlanes.IsEmpty())
|
if (!myClipPlanes.IsEmpty())
|
||||||
{
|
{
|
||||||
Graphic3d_SetOfHClipPlane aUserPlanes;
|
Graphic3d_SequenceOfHClipPlane aUserPlanes;
|
||||||
Graphic3d_SetOfHClipPlane::Iterator aClippingIt (myClipPlanes);
|
Graphic3d_SequenceOfHClipPlane::Iterator aClippingIt (myClipPlanes);
|
||||||
for (; aClippingIt.More(); aClippingIt.Next())
|
for (; aClippingIt.More(); aClippingIt.Next())
|
||||||
{
|
{
|
||||||
const Handle(Graphic3d_ClipPlane)& aClipPlane = aClippingIt.Value();
|
const Handle(Graphic3d_ClipPlane)& aClipPlane = aClippingIt.Value();
|
||||||
if (aClipPlane->IsOn())
|
if (aClipPlane->IsOn())
|
||||||
{
|
{
|
||||||
aUserPlanes.Add (aClipPlane);
|
aUserPlanes.Append (aClipPlane);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ uses
|
|||||||
ListOfInteger from TColStd,
|
ListOfInteger from TColStd,
|
||||||
Location from TopLoc,
|
Location from TopLoc,
|
||||||
ClipPlane_Handle from Graphic3d,
|
ClipPlane_Handle from Graphic3d,
|
||||||
SetOfHClipPlane from Graphic3d,
|
SequenceOfHClipPlane from Graphic3d,
|
||||||
-- ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate )
|
-- ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate )
|
||||||
TransModeFlags from Graphic3d,
|
TransModeFlags from Graphic3d,
|
||||||
Pnt from gp,
|
Pnt from gp,
|
||||||
@ -266,7 +266,7 @@ is
|
|||||||
---Purpose: Removes previously added clip plane.
|
---Purpose: Removes previously added clip plane.
|
||||||
-- @param thePlane [in] the clip plane to be removed from map of clip planes.
|
-- @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.
|
---Purpose: Set clip planes for graphical clipping for all display mode presentations.
|
||||||
-- The composition of clip planes truncates the rendering space to convex
|
-- The composition of clip planes truncates the rendering space to convex
|
||||||
-- volume. Please be aware that number of supported clip plane is limited.
|
-- 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
|
-- of these planes should be substracted from limit to predict the maximum
|
||||||
-- possible number of object clipping planes.
|
-- possible number of object clipping planes.
|
||||||
|
|
||||||
GetClipPlanes (me) returns SetOfHClipPlane from Graphic3d;
|
GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
|
||||||
---C++: inline
|
---C++: inline
|
||||||
---C++: return const&
|
---C++: return const&
|
||||||
---Purpose: Get clip planes.
|
---Purpose: Get clip planes.
|
||||||
@ -290,7 +290,7 @@ fields
|
|||||||
myPresentations: Presentations from PrsMgr is protected;
|
myPresentations: Presentations from PrsMgr is protected;
|
||||||
myTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr is protected;
|
myTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr is protected;
|
||||||
myLocation : Location from TopLoc 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 : TransModeFlags from Graphic3d;
|
||||||
myTransformPersistence : CTransPersStruct from Graphic3d;
|
myTransformPersistence : CTransPersStruct from Graphic3d;
|
||||||
|
|
||||||
|
@ -378,9 +378,9 @@ Standard_Integer PrsMgr_PresentableObject::GetZLayer
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
void PrsMgr_PresentableObject::AddClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
|
void PrsMgr_PresentableObject::AddClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
|
||||||
{
|
{
|
||||||
myClipPlanes.Add (thePlane);
|
// add to collection and process changes
|
||||||
|
myClipPlanes.Append (thePlane);
|
||||||
UpdateClipping(); // process changes
|
UpdateClipping();
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
@ -389,19 +389,28 @@ void PrsMgr_PresentableObject::AddClipPlane (const Handle(Graphic3d_ClipPlane)&
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
void PrsMgr_PresentableObject::RemoveClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
|
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
|
// function : SetClipPlanes
|
||||||
// purpose :
|
// purpose :
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
void PrsMgr_PresentableObject::SetClipPlanes (const Graphic3d_SetOfHClipPlane& thePlanes)
|
void PrsMgr_PresentableObject::SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes)
|
||||||
{
|
{
|
||||||
|
// change collection and process changes
|
||||||
myClipPlanes = thePlanes;
|
myClipPlanes = thePlanes;
|
||||||
|
|
||||||
UpdateClipping();
|
UpdateClipping();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ inline PrsMgr_TypeOfPresentation3d PrsMgr_PresentableObject::TypeOfPresentation3
|
|||||||
inline const TopLoc_Location& PrsMgr_PresentableObject::Location() const
|
inline const TopLoc_Location& PrsMgr_PresentableObject::Location() const
|
||||||
{return myLocation;}
|
{return myLocation;}
|
||||||
|
|
||||||
inline const Graphic3d_SetOfHClipPlane& PrsMgr_PresentableObject::GetClipPlanes() const
|
inline const Graphic3d_SequenceOfHClipPlane& PrsMgr_PresentableObject::GetClipPlanes() const
|
||||||
{
|
{
|
||||||
return myClipPlanes;
|
return myClipPlanes;
|
||||||
}
|
}
|
||||||
|
@ -28,17 +28,17 @@ class ViewerSelector3d from StdSelect inherits ViewerSelector from SelectMgr
|
|||||||
--
|
--
|
||||||
|
|
||||||
uses
|
uses
|
||||||
View from V3d,
|
View from V3d,
|
||||||
Selection from SelectMgr,
|
Selection from SelectMgr,
|
||||||
EntityOwner from SelectMgr,
|
EntityOwner from SelectMgr,
|
||||||
Projector from Select3D,
|
Projector from Select3D,
|
||||||
Group from Graphic3d,
|
Group from Graphic3d,
|
||||||
Structure from Graphic3d,
|
Structure from Graphic3d,
|
||||||
SetOfHClipPlane from Graphic3d,
|
SequenceOfHClipPlane from Graphic3d,
|
||||||
Array1OfReal from TColStd,
|
Array1OfReal from TColStd,
|
||||||
Array1OfPnt2d from TColgp,
|
Array1OfPnt2d from TColgp,
|
||||||
SensitivityMode from StdSelect,
|
SensitivityMode from StdSelect,
|
||||||
Lin from gp
|
Lin from gp
|
||||||
|
|
||||||
is
|
is
|
||||||
|
|
||||||
@ -152,12 +152,12 @@ is
|
|||||||
is static private;
|
is static private;
|
||||||
---Level: Internal
|
---Level: Internal
|
||||||
|
|
||||||
SetClipping (me : mutable; thePlanes : SetOfHClipPlane from Graphic3d) is protected;
|
SetClipping (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d) is protected;
|
||||||
---Level: Internal
|
---Level: Internal
|
||||||
---Purpose: Set view clipping for the selector.
|
---Purpose: Set view clipping for the selector.
|
||||||
-- @param thePlanes [in] the view planes.
|
-- @param thePlanes [in] the view planes.
|
||||||
|
|
||||||
ComputeClipRange (me; thePlanes : SetOfHClipPlane from Graphic3d;
|
ComputeClipRange (me; thePlanes : SequenceOfHClipPlane from Graphic3d;
|
||||||
thePickLine : Lin from gp;
|
thePickLine : Lin from gp;
|
||||||
theDepthMin, theDepthMax : out Real from Standard)
|
theDepthMin, theDepthMax : out Real from Standard)
|
||||||
is protected;
|
is protected;
|
||||||
@ -207,12 +207,9 @@ fields
|
|||||||
|
|
||||||
--areas verification...
|
--areas verification...
|
||||||
|
|
||||||
myareagroup : Group from Graphic3d;
|
myareagroup : Group from Graphic3d;
|
||||||
mysensgroup : Group from Graphic3d;
|
mysensgroup : Group from Graphic3d;
|
||||||
mystruct: Structure from Graphic3d;
|
mystruct : Structure from Graphic3d;
|
||||||
myClipPlanes : SetOfHClipPlane from Graphic3d;
|
myClipPlanes : SequenceOfHClipPlane from Graphic3d;
|
||||||
|
|
||||||
end ViewerSelector3d;
|
end ViewerSelector3d;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include <V3d_PerspectiveView.hxx>
|
#include <V3d_PerspectiveView.hxx>
|
||||||
#include <Select3D_SensitiveEntity.hxx>
|
#include <Select3D_SensitiveEntity.hxx>
|
||||||
#include <Graphic3d_ArrayOfPolylines.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Graphic3d_SetOfHClipPlane.hxx>
|
#include <Graphic3d_SequenceOfHClipPlane.hxx>
|
||||||
#include <SelectMgr_SelectableObject.hxx>
|
#include <SelectMgr_SelectableObject.hxx>
|
||||||
#include <SelectMgr_DataMapIteratorOfDataMapOfIntegerSensitive.hxx>
|
#include <SelectMgr_DataMapIteratorOfDataMapOfIntegerSensitive.hxx>
|
||||||
#include <SelectBasics_ListOfBox2d.hxx>
|
#include <SelectBasics_ListOfBox2d.hxx>
|
||||||
@ -1048,7 +1048,7 @@ void StdSelect_ViewerSelector3d::ComputeAreasPrs (const Handle(SelectMgr_Selecti
|
|||||||
//function : SetClipping
|
//function : SetClipping
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void StdSelect_ViewerSelector3d::SetClipping (const Graphic3d_SetOfHClipPlane& thePlanes)
|
void StdSelect_ViewerSelector3d::SetClipping (const Graphic3d_SequenceOfHClipPlane& thePlanes)
|
||||||
{
|
{
|
||||||
myClipPlanes = thePlanes;
|
myClipPlanes = thePlanes;
|
||||||
}
|
}
|
||||||
@ -1057,7 +1057,7 @@ void StdSelect_ViewerSelector3d::SetClipping (const Graphic3d_SetOfHClipPlane& t
|
|||||||
//function : ComputeClipRange
|
//function : ComputeClipRange
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void StdSelect_ViewerSelector3d::ComputeClipRange (const Graphic3d_SetOfHClipPlane& thePlanes,
|
void StdSelect_ViewerSelector3d::ComputeClipRange (const Graphic3d_SequenceOfHClipPlane& thePlanes,
|
||||||
const gp_Lin& thePickLine,
|
const gp_Lin& thePickLine,
|
||||||
Standard_Real& theDepthMin,
|
Standard_Real& theDepthMin,
|
||||||
Standard_Real& theDepthMax) const
|
Standard_Real& theDepthMax) const
|
||||||
@ -1066,7 +1066,7 @@ void StdSelect_ViewerSelector3d::ComputeClipRange (const Graphic3d_SetOfHClipPla
|
|||||||
theDepthMax = RealLast();
|
theDepthMax = RealLast();
|
||||||
Standard_Real aPlaneA, aPlaneB, aPlaneC, aPlaneD;
|
Standard_Real aPlaneA, aPlaneB, aPlaneC, aPlaneD;
|
||||||
|
|
||||||
Graphic3d_SetOfHClipPlane::Iterator aPlaneIt (thePlanes);
|
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (thePlanes);
|
||||||
for (; aPlaneIt.More(); aPlaneIt.Next())
|
for (; aPlaneIt.More(); aPlaneIt.Next())
|
||||||
{
|
{
|
||||||
const Handle(Graphic3d_ClipPlane)& aClipPlane = aPlaneIt.Value();
|
const Handle(Graphic3d_ClipPlane)& aClipPlane = aPlaneIt.Value();
|
||||||
|
@ -137,7 +137,7 @@ uses
|
|||||||
ExtendedString from TCollection,
|
ExtendedString from TCollection,
|
||||||
PrintAlgo from Aspect,
|
PrintAlgo from Aspect,
|
||||||
ClipPlane_Handle from Graphic3d,
|
ClipPlane_Handle from Graphic3d,
|
||||||
SetOfHClipPlane from Graphic3d
|
SequenceOfHClipPlane from Graphic3d
|
||||||
raises
|
raises
|
||||||
|
|
||||||
BadValue from V3d, TypeMismatch from Standard,
|
BadValue from V3d, TypeMismatch from Standard,
|
||||||
@ -1566,8 +1566,8 @@ is
|
|||||||
---Purpose: Removes clip plane from the view.
|
---Purpose: Removes clip plane from the view.
|
||||||
-- @param thePlane [in] the clip plane to be removed from view.
|
-- @param thePlane [in] the clip plane to be removed from view.
|
||||||
|
|
||||||
SetClipPlanes (me : mutable; thePlanes : SetOfHClipPlane from Graphic3d);
|
SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d);
|
||||||
---Purpose: Set clip planes to the view. The planes that have been set
|
---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
|
-- before are removed from the view. The composition of clip planes
|
||||||
-- truncates the rendering space to convex volume. Number of supported
|
-- truncates the rendering space to convex volume. Number of supported
|
||||||
-- clip planes can be consulted by PlaneLimit method of associated
|
-- clip planes can be consulted by PlaneLimit method of associated
|
||||||
@ -1575,7 +1575,7 @@ is
|
|||||||
-- are igonred during rendering.
|
-- are igonred during rendering.
|
||||||
-- @param thePlanes [in] the clip planes to set.
|
-- @param thePlanes [in] the clip planes to set.
|
||||||
|
|
||||||
GetClipPlanes (me) returns SetOfHClipPlane from Graphic3d;
|
GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
|
||||||
---C++: return const&
|
---C++: return const&
|
||||||
---Purpose: Get clip planes.
|
---Purpose: Get clip planes.
|
||||||
-- @return sequence clip planes that have been set for the view
|
-- @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)
|
void V3d_View::AddClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
|
||||||
{
|
{
|
||||||
Graphic3d_SetOfHClipPlane aCurrPlanes = MyViewContext.GetClipPlanes();
|
MyViewContext.ChangeClipPlanes().Append (thePlane);
|
||||||
if (!aCurrPlanes.Add (thePlane))
|
MyView->SetContext (MyViewContext);
|
||||||
return;
|
|
||||||
|
|
||||||
MyViewContext.SetClipPlanes (aCurrPlanes);
|
|
||||||
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)
|
void V3d_View::RemoveClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
|
||||||
{
|
{
|
||||||
Graphic3d_SetOfHClipPlane aCurrPlanes = MyViewContext.GetClipPlanes();
|
Graphic3d_SequenceOfHClipPlane& aSeqOfPlanes = MyViewContext.ChangeClipPlanes();
|
||||||
if (!aCurrPlanes.Remove (thePlane))
|
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (aSeqOfPlanes);
|
||||||
return;
|
for (; aPlaneIt.More(); aPlaneIt.Next())
|
||||||
|
{
|
||||||
|
const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
|
||||||
|
if (aPlane != thePlane)
|
||||||
|
continue;
|
||||||
|
|
||||||
MyViewContext.SetClipPlanes (aCurrPlanes);
|
aSeqOfPlanes.Remove (aPlaneIt);
|
||||||
MyView->SetContext (MyViewContext) ;
|
MyView->SetContext (MyViewContext);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetClipPlanes
|
//function : SetClipPlanes
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void V3d_View::SetClipPlanes (const Graphic3d_SetOfHClipPlane& thePlanes)
|
void V3d_View::SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes)
|
||||||
{
|
{
|
||||||
MyViewContext.SetClipPlanes (thePlanes);
|
MyViewContext.ChangeClipPlanes() = thePlanes;
|
||||||
MyView->SetContext (MyViewContext) ;
|
MyView->SetContext (MyViewContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : GetClipPlanes
|
//function : GetClipPlanes
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
const Graphic3d_SetOfHClipPlane& V3d_View::GetClipPlanes() const
|
const Graphic3d_SequenceOfHClipPlane& V3d_View::GetClipPlanes() const
|
||||||
{
|
{
|
||||||
return MyViewContext.GetClipPlanes();
|
return MyViewContext.ClipPlanes();
|
||||||
}
|
}
|
||||||
|
@ -38,15 +38,14 @@ class ContextView from Visual3d
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
|
|
||||||
SequenceOfAddress from TColStd,
|
SequenceOfAddress from TColStd,
|
||||||
Light from Visual3d,
|
Light from Visual3d,
|
||||||
HSetOfLight from Visual3d,
|
HSetOfLight from Visual3d,
|
||||||
|
TypeOfModel from Visual3d,
|
||||||
TypeOfModel from Visual3d,
|
TypeOfVisualization from Visual3d,
|
||||||
TypeOfVisualization from Visual3d,
|
TypeOfSurfaceDetail from Visual3d,
|
||||||
TypeOfSurfaceDetail from Visual3d,
|
TextureEnv from Graphic3d,
|
||||||
TextureEnv from Graphic3d,
|
SequenceOfHClipPlane from Graphic3d
|
||||||
SetOfHClipPlane from Graphic3d
|
|
||||||
|
|
||||||
raises
|
raises
|
||||||
|
|
||||||
@ -147,13 +146,14 @@ is
|
|||||||
-- Clip Plane
|
-- Clip Plane
|
||||||
---------------------------------------------------
|
---------------------------------------------------
|
||||||
|
|
||||||
SetClipPlanes (me : in out; thePlanes : SetOfHClipPlane from Graphic3d);
|
ClipPlanes (me) returns SequenceOfHClipPlane 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;
|
|
||||||
---C++: return const&
|
---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.
|
-- @return sequence of clip planes.
|
||||||
|
|
||||||
---------------------------------------------------
|
---------------------------------------------------
|
||||||
@ -440,6 +440,6 @@ fields
|
|||||||
MyTextureEnv : TextureEnv from Graphic3d;
|
MyTextureEnv : TextureEnv from Graphic3d;
|
||||||
MySurfaceDetail : TypeOfSurfaceDetail from Visual3d;
|
MySurfaceDetail : TypeOfSurfaceDetail from Visual3d;
|
||||||
|
|
||||||
myClipPlanes : SetOfHClipPlane from Graphic3d;
|
myClipPlanes : SequenceOfHClipPlane from Graphic3d;
|
||||||
|
|
||||||
end ContextView;
|
end ContextView;
|
||||||
|
@ -334,12 +334,20 @@ Visual3d_TypeOfSurfaceDetail Visual3d_ContextView::SurfaceDetail() const
|
|||||||
return MySurfaceDetail;
|
return MySurfaceDetail;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Visual3d_ContextView::SetClipPlanes (const Graphic3d_SetOfHClipPlane& thePlanes)
|
//=======================================================================
|
||||||
{
|
//function : ClipPlanes
|
||||||
myClipPlanes = thePlanes;
|
//purpose :
|
||||||
}
|
//=======================================================================
|
||||||
|
const Graphic3d_SequenceOfHClipPlane& Visual3d_ContextView::ClipPlanes() const
|
||||||
const Graphic3d_SetOfHClipPlane& Visual3d_ContextView::GetClipPlanes() const
|
{
|
||||||
|
return myClipPlanes;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : ChangeClipPlanes
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Graphic3d_SequenceOfHClipPlane& Visual3d_ContextView::ChangeClipPlanes()
|
||||||
{
|
{
|
||||||
return myClipPlanes;
|
return myClipPlanes;
|
||||||
}
|
}
|
||||||
|
@ -745,12 +745,13 @@ void Visual3d_View::UpdateLights()
|
|||||||
MyCView.Context.ActiveLight = NULL;
|
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())
|
if (IsDeleted() || !IsDefined())
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
MyGraphicDriver->SetClipPlanes (MyCView);
|
MyGraphicDriver->SetClipPlanes (MyCView);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user