![]() |
Open CASCADE Technology Reference Manual 8.0.2
|
Graphic3d_CullingTool 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 <Graphic3d_CullingTool.hxx>
Data Structures | |
| struct | CullingContext |
| Auxiliary structure holding non-persistent culling options. More... | |
| struct | Plane |
| Auxiliary structure representing 3D plane. More... | |
Public Member Functions | |
| Graphic3d_CullingTool () | |
| Creates an empty selector object with parallel projection type by default. | |
| void | SetViewVolume (const occ::handle< Graphic3d_Camera > &theCamera, const NCollection_Mat4< double > &theModelWorld=NCollection_Mat4< double >()) |
| Retrieves view volume's planes equations and its vertices from projection and world-view matrices. | |
| void | SetViewportSize (int theViewportWidth, int theViewportHeight, double theResolutionRatio) |
| void | SetCullingDistance (CullingContext &theCtx, double theDistance) const |
| Setup distance culling. | |
| void | SetCullingSize (CullingContext &theCtx, double theSize) const |
| Setup size culling. | |
| 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. | |
| bool | IsCulled (const CullingContext &theCtx, const NCollection_Vec3< double > &theMinPnt, const NCollection_Vec3< double > &theMaxPnt, bool *theIsInside=nullptr) const |
| Checks whether given AABB should be entirely culled or not. | |
| const occ::handle< Graphic3d_Camera > & | Camera () const |
| Return the camera definition. | |
| const NCollection_Mat4< double > & | ProjectionMatrix () const |
| Returns current projection matrix. | |
| const NCollection_Mat4< double > & | WorldViewMatrix () const |
| Returns current world view transformation matrix. | |
| int | ViewportWidth () const |
| int | ViewportHeight () const |
| const Graphic3d_WorldViewProjState & | WorldViewProjState () const |
| Returns state of current world view projection transformation matrices. | |
| const NCollection_Vec3< double > & | CameraEye () const |
| Returns camera eye position. | |
| const NCollection_Vec3< double > & | CameraDirection () const |
| Returns camera direction. | |
| double | SignedPlanePointDistance (const NCollection_Vec4< double > &theNormal, const NCollection_Vec4< double > &thePnt) |
| Calculates signed distance from plane to point. | |
| bool | IsOutFrustum (const NCollection_Vec3< double > &theMinPnt, const NCollection_Vec3< double > &theMaxPnt, bool *theIsInside=nullptr) const |
| Detects if AABB overlaps view volume using separating axis theorem (SAT). | |
| bool | IsTooDistant (const CullingContext &theCtx, const NCollection_Vec3< double > &theMinPnt, const NCollection_Vec3< double > &theMaxPnt, bool *theIsInside=nullptr) const |
| Returns TRUE if given AABB should be discarded by distance culling criterion. | |
| bool | IsTooSmall (const CullingContext &theCtx, const NCollection_Vec3< double > &theMinPnt, const NCollection_Vec3< double > &theMaxPnt) const |
| Returns TRUE if given AABB should be discarded by size culling criterion. | |
Protected Types | |
| enum | { Plane_Left , Plane_Right , Plane_Bottom , Plane_Top , Plane_Near , Plane_Far , PlanesNB } |
| Enumerates planes of view volume. More... | |
Protected Attributes | |
| Plane | myClipPlanes [PlanesNB] |
| Planes. | |
| NCollection_Array1< NCollection_Vec3< double > > | myClipVerts |
| Vertices. | |
| occ::handle< Graphic3d_Camera > | myCamera |
| camera definition | |
| double | myMaxClipProjectionPts [PlanesNB] |
| Max view volume's vertices projections onto its normals. | |
| double | myMinClipProjectionPts [PlanesNB] |
| Min view volume's vertices projections onto its normals. | |
| double | myMaxOrthoProjectionPts [3] |
| Max view volume's vertices projections onto normalized dimensions of AABB. | |
| double | myMinOrthoProjectionPts [3] |
| Min view volume's vertices projections onto normalized dimensions of AABB. | |
| bool | myIsProjectionParallel |
| NCollection_Mat4< double > | myProjectionMat |
| NCollection_Mat4< double > | myWorldViewMat |
| int | myViewportWidth |
| int | myViewportHeight |
| Graphic3d_WorldViewProjState | myWorldViewProjState |
| State of world view projection matrices. | |
| NCollection_Vec3< double > | myCamEye |
| camera eye position for distance culling | |
| NCollection_Vec3< double > | myCamDir |
| camera direction for size culling | |
| double | myCamScale |
| camera scale for size culling | |
| double | myPixelSize |
| pixel size for size culling | |
Graphic3d_CullingTool 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 |
| Graphic3d_CullingTool::Graphic3d_CullingTool | ( | ) |
Creates an empty selector object with parallel projection type by default.
| void Graphic3d_CullingTool::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 |
Returns camera direction.
|
inline |
Returns camera eye position.
|
inline |
Checks whether given AABB should be entirely culled or not.
| [in] | theCtx | culling properties |
| [in] | theMinPnt | maximum point of AABB |
| [in] | theMaxPnt | minimum point of AABB |
| [out] | theIsInside | flag indicating if AABB is fully inside; initial value should be set to TRUE |
|
inline |
Detects if AABB overlaps view volume using separating axis theorem (SAT).
| [in] | theMinPnt | maximum point of AABB |
| [in] | theMaxPnt | minimum point of AABB |
| [out] | theIsInside | flag indicating if AABB is fully inside; initial value should be set to TRUE |
|
inline |
Returns TRUE if given AABB should be discarded by distance culling criterion.
| [in] | theMinPnt | maximum point of AABB |
| [in] | theMaxPnt | minimum point of AABB |
| [out] | theIsInside | flag indicating if AABB is fully inside; initial value should be set to TRUE |
|
inline |
Returns TRUE if given AABB should be discarded by size culling criterion.
|
inline |
Returns current projection matrix.
| void Graphic3d_CullingTool::SetCullingDistance | ( | CullingContext & | theCtx, |
| double | theDistance ) const |
Setup distance culling.
| void Graphic3d_CullingTool::SetCullingSize | ( | CullingContext & | theCtx, |
| double | theSize ) const |
Setup size culling.
| void Graphic3d_CullingTool::SetViewportSize | ( | int | theViewportWidth, |
| int | theViewportHeight, | ||
| double | theResolutionRatio ) |
| void Graphic3d_CullingTool::SetViewVolume | ( | const occ::handle< Graphic3d_Camera > & | theCamera, |
| const NCollection_Mat4< double > & | theModelWorld = NCollection_Mat4< double >() ) |
Retrieves view volume's planes equations and its vertices from projection and world-view matrices.
| [in] | theCamera | camera definition |
| [in] | theModelWorld | optional object transformation for computing frustum in object local coordinate system |
| double Graphic3d_CullingTool::SignedPlanePointDistance | ( | const NCollection_Vec4< double > & | theNormal, |
| const NCollection_Vec4< double > & | thePnt ) |
Calculates signed distance from plane to point.
| [in] | theNormal | the plane's normal. |
| [in] | thePnt |
|
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 |
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.