|
Open CASCADE Technology
7.3.0
|
BVHTreeSelector class provides a possibility to store parameters of view volume, such as its vertices and equations, and contains methods detecting if given AABB overlaps view volume. More...
#include <OpenGl_BVHTreeSelector.hxx>
Data Structures | |
| struct | CullingContext |
| Auxiliary structure holding non-persistent culling options. More... | |
Public Member Functions | |
| OpenGl_BVHTreeSelector () | |
| Creates an empty selector object with parallel projection type by default. More... | |
| void | SetViewVolume (const Handle< Graphic3d_Camera > &theCamera) |
| Retrieves view volume's planes equations and its vertices from projection and world-view matrices. More... | |
| void | SetViewportSize (Standard_Integer theViewportWidth, Standard_Integer theViewportHeight, Standard_Real theResolutionRatio) |
| void | SetCullingDistance (CullingContext &theCtx, Standard_Real theDistance) const |
| Setup distance culling. More... | |
| void | SetCullingSize (CullingContext &theCtx, Standard_Real theSize) const |
| Setup size culling. More... | |
| void | CacheClipPtsProjections () |
| Caches view volume's vertices projections along its normals and AABBs dimensions. Must be called at the beginning of each BVH tree traverse loop. More... | |
| bool | IsCulled (const CullingContext &theCtx, const OpenGl_Vec3d &theMinPt, const OpenGl_Vec3d &theMaxPt) const |
| Checks whether given AABB should be entirely culled or not. More... | |
| const Handle< Graphic3d_Camera > & | Camera () const |
| Return the camera definition. More... | |
| const OpenGl_Mat4d & | ProjectionMatrix () const |
| Returns current projection matrix. More... | |
| const OpenGl_Mat4d & | WorldViewMatrix () const |
| Returns current world view transformation matrix. More... | |
| Standard_Integer | ViewportWidth () const |
| Standard_Integer | ViewportHeight () const |
| const Graphic3d_WorldViewProjState & | WorldViewProjState () const |
| Returns state of current world view projection transformation matrices. More... | |
Protected Types | |
| enum | { Plane_Top, Plane_Bottom, Plane_Left, Plane_Right, Plane_Near, Plane_Far, PlanesNB } |
| Enumerates planes of view volume. More... | |
| enum | { ClipVert_LeftTopNear, ClipVert_LeftBottomNear, ClipVert_RightTopNear, ClipVert_RightBottomNear, ClipVert_LeftTopFar, ClipVert_LeftBottomFar, ClipVert_RightTopFar, ClipVert_RightBottomFar, ClipVerticesNB } |
| Enumerates vertices of view volume. More... | |
Protected Member Functions | |
| Standard_Real | SignedPlanePointDistance (const OpenGl_Vec4d &theNormal, const OpenGl_Vec4d &thePnt) |
| Calculates signed distance from plane to point. More... | |
| bool | isFullOut (const OpenGl_Vec3d &theMinPt, const OpenGl_Vec3d &theMaxPt) const |
| Detects if AABB overlaps view volume using separating axis theorem (SAT). More... | |
| bool | isTooDistant (const CullingContext &theCtx, const OpenGl_Vec3d &theMinPt, const OpenGl_Vec3d &theMaxPt) const |
| Returns TRUE if given AABB should be discarded by distance culling criterion. More... | |
| bool | isTooSmall (const CullingContext &theCtx, const OpenGl_Vec3d &theMinPt, const OpenGl_Vec3d &theMaxPt) const |
| Returns TRUE if given AABB should be discarded by size culling criterion. More... | |
BVHTreeSelector class provides a possibility to store parameters of view volume, such as its vertices and equations, and contains methods detecting if given AABB overlaps view volume.
|
protected |
|
protected |
| OpenGl_BVHTreeSelector::OpenGl_BVHTreeSelector | ( | ) |
Creates an empty selector object with parallel projection type by default.
| void OpenGl_BVHTreeSelector::CacheClipPtsProjections | ( | ) |
Caches view volume's vertices projections along its normals and AABBs dimensions. Must be called at the beginning of each BVH tree traverse loop.
|
inline |
Return the camera definition.
|
inline |
Checks whether given AABB should be entirely culled or not.
| theCtx | [in] culling properties |
| theMinPt | [in] maximum point of AABB |
| theMaxPt | [in] minimum point of AABB |
|
inlineprotected |
Detects if AABB overlaps view volume using separating axis theorem (SAT).
| theMinPt | [in] maximum point of AABB. |
| theMaxPt | [in] minimum point of AABB. |
|
inlineprotected |
Returns TRUE if given AABB should be discarded by distance culling criterion.
|
inlineprotected |
Returns TRUE if given AABB should be discarded by size culling criterion.
|
inline |
Returns current projection matrix.
| void OpenGl_BVHTreeSelector::SetCullingDistance | ( | CullingContext & | theCtx, |
| Standard_Real | theDistance | ||
| ) | const |
Setup distance culling.
| void OpenGl_BVHTreeSelector::SetCullingSize | ( | CullingContext & | theCtx, |
| Standard_Real | theSize | ||
| ) | const |
Setup size culling.
| void OpenGl_BVHTreeSelector::SetViewportSize | ( | Standard_Integer | theViewportWidth, |
| Standard_Integer | theViewportHeight, | ||
| Standard_Real | theResolutionRatio | ||
| ) |
| void OpenGl_BVHTreeSelector::SetViewVolume | ( | const Handle< Graphic3d_Camera > & | theCamera | ) |
Retrieves view volume's planes equations and its vertices from projection and world-view matrices.
|
protected |
Calculates signed distance from plane to point.
| theNormal | [in] the plane's normal. |
| thePnt | [in] |
|
inline |
|
inline |
|
inline |
Returns current world view transformation matrix.
|
inline |
Returns state of current world view projection transformation matrices.
|
protected |
camera direction for size culling
|
protected |
camera definition
|
protected |
camera eye position for distance culling
|
protected |
camera scale for size culling
|
protected |
Plane equations.
|
protected |
Vertices.
|
protected |
|
protected |
Max view volume's vertices projections onto its normals.
|
protected |
Max view volume's vertices projections onto normalized dimensions of AABB.
|
protected |
Min view volume's vertices projections onto its normals.
|
protected |
Min view volume's vertices projections onto normalized dimensions of AABB.
|
protected |
pixel size for size culling
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
State of world view projection matrices.
1.8.13