1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +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:
kgv
2017-05-26 10:45:22 +03:00
committed by bugmaster
parent 645f581fbe
commit f5b7241978
54 changed files with 561 additions and 357 deletions

View File

@@ -81,17 +81,19 @@ void StdSelect_BRepSelectionTool::PreBuildBVH (const Handle(SelectMgr_Selection)
aSensitive->BVH();
}
if (aSensitive->IsInstance ("Select3D_SensitiveGroup"))
if (!aSensitive->IsInstance (STANDARD_TYPE(Select3D_SensitiveGroup)))
{
Handle(Select3D_SensitiveGroup) aGroup (Handle(Select3D_SensitiveGroup)::DownCast (aSensitive));
const Select3D_EntitySequence& aSubEntities = aGroup->GetEntities();
for (Select3D_EntitySequenceIter aSubEntitiesIter (aSubEntities); aSubEntitiesIter.More(); aSubEntitiesIter.Next())
continue;
}
Handle(Select3D_SensitiveGroup) aGroup = Handle(Select3D_SensitiveGroup)::DownCast (aSensitive);
const Select3D_EntitySequence& aSubEntities = aGroup->GetEntities();
for (Select3D_EntitySequenceIter aSubEntitiesIter (aSubEntities); aSubEntitiesIter.More(); aSubEntitiesIter.Next())
{
const Handle(Select3D_SensitiveEntity)& aSubEntity = aSubEntitiesIter.Value();
if (aSubEntity->NbSubElements() >= BVH_PRIMITIVE_LIMIT)
{
const Handle(Select3D_SensitiveEntity)& aSubEntity = aSubEntitiesIter.Value();
if (aSubEntity->NbSubElements() >= BVH_PRIMITIVE_LIMIT)
{
aSubEntity->BVH();
}
aSubEntity->BVH();
}
}
}