#ifndef _OpenGl_BVHClipPrimitiveTrsfPersSet_HeaderFile
#define _OpenGl_BVHClipPrimitiveTrsfPersSet_HeaderFile
-#include <BVH_Builder.hxx>
#include <BVH_Set.hxx>
#include <BVH_Tree.hxx>
#include <Graphic3d_BndBox4f.hxx>
#include <NCollection_IndexedMap.hxx>
#include <OpenGl_Structure.hxx>
#include <OpenGl_Vec.hxx>
+#include <Select3D_BVHBuilder3d.hxx>
//! Set of transformation persistent OpenGl_Structure for building BVH tree.
//! Provides built-in mechanism to invalidate tree when world view projection state changes.
public:
//! Creates an empty primitive set for BVH clipping.
- OpenGl_BVHClipPrimitiveTrsfPersSet();
+ OpenGl_BVHClipPrimitiveTrsfPersSet (const Handle(Select3D_BVHBuilder3d)& theBuilder);
//! Returns total number of structures.
virtual Standard_Integer Size() const Standard_OVERRIDE;
}
//! Returns BVH tree for the given world view projection (builds it if necessary).
- const NCollection_Handle<BVH_Tree<Standard_Real, 3> >& BVH (const Handle(Graphic3d_Camera)& theCamera,
- const OpenGl_Mat4d& theProjectionMatrix,
- const OpenGl_Mat4d& theWorldViewMatrix,
- const Standard_Integer theViewportWidth,
- const Standard_Integer theViewportHeight,
- const Graphic3d_WorldViewProjState& theWVPState);
+ const opencascade::handle<BVH_Tree<Standard_Real, 3> >& BVH (const Handle(Graphic3d_Camera)& theCamera,
+ const OpenGl_Mat4d& theProjectionMatrix,
+ const OpenGl_Mat4d& theWorldViewMatrix,
+ const Standard_Integer theViewportWidth,
+ const Standard_Integer theViewportHeight,
+ const Graphic3d_WorldViewProjState& theWVPState);
+
+ //! Returns builder for bottom-level BVH.
+ const Handle(Select3D_BVHBuilder3d)& Builder() const { return myBuilder; }
+
+ //! Assigns builder for bottom-level BVH.
+ void SetBuilder (const Handle(Select3D_BVHBuilder3d)& theBuilder) { myBuilder = theBuilder; }
private:
Standard_Boolean myIsDirty;
//! Constructed bottom-level BVH.
- NCollection_Handle<BVH_Tree<Standard_Real, 3> > myBVH;
+ opencascade::handle<BVH_Tree<Standard_Real, 3> > myBVH;
//! Builder for bottom-level BVH.
- NCollection_Handle<BVH_Builder<Standard_Real, 3> > myBuilder;
+ Handle(Select3D_BVHBuilder3d) myBuilder;
//! Indexed map of structures.
NCollection_IndexedMap<const OpenGl_Structure*> myStructs;