mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0030698: Volume Rendering - Early clipping of volume object's bounding box
Flag to control check of bounding box clipping before drawing has been added.
This commit is contained in:
parent
7c1a821000
commit
8e6ce38cf4
@ -39,7 +39,8 @@ Graphic3d_CStructure::Graphic3d_CStructure (const Handle(Graphic3d_StructureMana
|
||||
IsMutable (Standard_False),
|
||||
Is2dText (Standard_False),
|
||||
myGraphicDriver (theManager->GraphicDriver()),
|
||||
myIsCulled (Standard_True)
|
||||
myIsCulled (Standard_True),
|
||||
myBndBoxClipCheck(Standard_True)
|
||||
{
|
||||
Id = myGraphicDriver->NewIdentification();
|
||||
}
|
||||
|
@ -145,6 +145,12 @@ public:
|
||||
//! The method is called during traverse of BVH tree.
|
||||
void MarkAsNotCulled() const { myIsCulled = Standard_False; }
|
||||
|
||||
//! Returns whether check of object's bounding box clipping is enabled before drawing of object; TRUE by default.
|
||||
Standard_Boolean BndBoxClipCheck() const { return myBndBoxClipCheck; }
|
||||
|
||||
//! Enable/disable check of object's bounding box clipping before drawing of object.
|
||||
void SetBndBoxClipCheck(Standard_Boolean theBndBoxClipCheck) { myBndBoxClipCheck = theBndBoxClipCheck; }
|
||||
|
||||
//! Checks if the structure should be included into BVH tree or not.
|
||||
Standard_Boolean IsAlwaysRendered() const
|
||||
{
|
||||
@ -224,6 +230,7 @@ protected:
|
||||
Handle(Graphic3d_PresentationAttributes) myHighlightStyle; //! Current highlight style; is set only if highlight flag is true
|
||||
|
||||
mutable Standard_Boolean myIsCulled; //!< A status specifying is structure needs to be rendered after BVH tree traverse
|
||||
Standard_Boolean myBndBoxClipCheck; //!< Flag responsible for checking of bounding box clipping before drawing of object
|
||||
|
||||
public:
|
||||
|
||||
|
@ -527,16 +527,16 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con
|
||||
}
|
||||
|
||||
const Graphic3d_ClipState aBoxState = aPlane->ProbeBox (aBBox);
|
||||
if (aBoxState == Graphic3d_ClipState_Out)
|
||||
{
|
||||
isClipped = true;
|
||||
break;
|
||||
}
|
||||
else if (aBoxState == Graphic3d_ClipState_In)
|
||||
if (aBoxState == Graphic3d_ClipState_In)
|
||||
{
|
||||
aCtx->ChangeClipping().SetEnabled (aPlaneIt, false);
|
||||
hasDisabled = true;
|
||||
}
|
||||
else if (aBoxState == Graphic3d_ClipState_Out && myBndBoxClipCheck)
|
||||
{
|
||||
isClipped = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user