1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0026139: AIS_InteractiveContext::Display performance regression

NCollection_Sequence in SelectMgr_SensitiveEntitySet was replaced by indexed data map
This commit is contained in:
vpa
2015-05-07 18:39:36 +03:00
committed by abv
parent d4aaad5b82
commit ec81011f5b
5 changed files with 134 additions and 59 deletions

View File

@@ -18,7 +18,7 @@
#include <BVH_PrimitiveSet.hxx>
#include <NCollection_Sequence.hxx>
#include <NCollection_IndexedMap.hxx>
#include <NCollection_Handle.hxx>
#include <Select3D_BndBox3d.hxx>
@@ -26,11 +26,15 @@
#include <SelectMgr_SensitiveEntity.hxx>
#include <SelectMgr_Selection.hxx>
typedef NCollection_IndexedMap<Handle(SelectMgr_SensitiveEntity)> SelectMgr_IndexedMapOfHSensitive;
//! This class is used to store all calculated sensitive entites of one selectable
//! object. It provides an interface for building BVH tree which is used to speed-up
//! the performance of searching for overlap among sensitives of one selectable object
class SelectMgr_SensitiveEntitySet : public BVH_PrimitiveSet<Standard_Real, 3>
{
Handle(SelectMgr_SensitiveEntity) EMPTY_ENT;
public:
SelectMgr_SensitiveEntitySet();
@@ -44,9 +48,6 @@ public:
//! BVH tree for rebuild
void Append (const Handle(SelectMgr_Selection)& theSelection);
//! Removes entity from the set and marks BVH tree for rebuild
void Remove (const Handle(SelectMgr_SensitiveEntity)& theEntity);
//! Removes every entity of selection theSelection from the set
//! and marks BVH tree for rebuild
void Remove (const Handle(SelectMgr_Selection)& theSelection);
@@ -71,8 +72,7 @@ public:
private:
NCollection_Sequence<Handle(SelectMgr_SensitiveEntity)> myEntities; //!< A sequence of calculated sensitives of the object
NCollection_Sequence<Standard_Integer> myEntityIdxs; //!< Cached indexes for faster BVH build
SelectMgr_IndexedMapOfHSensitive mySensitives; //!< Map of entities and its corresponding index in BVH
};
#endif // _SelectMgr_SensitiveEntitySet_HeaderFile