mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0028789: Visualization, TKV3d - extend API for accessing and assigning BVH builders
Several methods in Selection classes have been moved to header files for better inlining. BVH_Constants - added new enumeration defining common constant values used with BVH trees. BVH - replaced NCollection_Handle with Standard_Transient handle in classes BVH_Properties, BVH_Builder, BVH_Tree, BVH_Object. Defined global BVH-builders instead of allocating a new one for each object set. SelectMgr_ViewerSelector - added new method ::SetEntitySetBuilder() defining default BVH Tree builder for SelectMgr_SensitiveEntitySet. Added new method SelectMgr_SensitiveEntitySet::SetBuilder() for overriding default BVH tree builder.
This commit is contained in:
@@ -15,18 +15,19 @@
|
||||
|
||||
#include <SelectMgr_SensitiveEntitySet.hxx>
|
||||
|
||||
#include <BVH_BinnedBuilder.hxx>
|
||||
|
||||
#include <Select3D_SensitiveEntity.hxx>
|
||||
#include <SelectMgr_SensitiveEntity.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_SensitiveEntitySet, BVH_PrimitiveSet3d)
|
||||
|
||||
//=======================================================================
|
||||
// function : SelectMgr_SensitiveEntitySet
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
SelectMgr_SensitiveEntitySet::SelectMgr_SensitiveEntitySet()
|
||||
SelectMgr_SensitiveEntitySet::SelectMgr_SensitiveEntitySet (const Handle(Select3D_BVHBuilder3d)& theBuilder)
|
||||
: BVH_PrimitiveSet3d (theBuilder)
|
||||
{
|
||||
myBuilder = new BVH_BinnedBuilder<Standard_Real, 3, 4> (1, 32, Standard_True);
|
||||
//
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -35,7 +36,7 @@ SelectMgr_SensitiveEntitySet::SelectMgr_SensitiveEntitySet()
|
||||
//=======================================================================
|
||||
void SelectMgr_SensitiveEntitySet::Append (const Handle(SelectMgr_SensitiveEntity)& theEntity)
|
||||
{
|
||||
if (!theEntity->BaseSensitive()->IsKind ("Select3D_SensitiveEntity"))
|
||||
if (!theEntity->BaseSensitive()->IsKind (STANDARD_TYPE(Select3D_SensitiveEntity)))
|
||||
{
|
||||
theEntity->ResetSelectionActiveStatus();
|
||||
return;
|
||||
@@ -53,7 +54,7 @@ void SelectMgr_SensitiveEntitySet::Append (const Handle(SelectMgr_Selection)& th
|
||||
{
|
||||
for (theSelection->Init(); theSelection->More(); theSelection->Next())
|
||||
{
|
||||
if (!theSelection->Sensitive()->BaseSensitive()->IsKind ("Select3D_SensitiveEntity"))
|
||||
if (!theSelection->Sensitive()->BaseSensitive()->IsKind (STANDARD_TYPE(Select3D_SensitiveEntity)))
|
||||
{
|
||||
theSelection->Sensitive()->ResetSelectionActiveStatus();
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user