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

0027180: Visualization - improve selection logic of MeshVS_Mesh

MeshVS_Mesh selection logic in MeshVS_SMF_Mesh mode (entire mesh) has been optimized.
MeshVS_Mesh::ComputeSelection() now creates single sensitive entity
MeshVS_CommonSensitiveEntity (new class) instead of small sensitive entity on each element.
MeshVS_SensitiveQuad (new class) and Select3D_SensitiveTriangle are used instead of Select3D_SensitiveFace for local selection to reduce memory consumption when possible.
This commit is contained in:
vpa
2016-03-02 20:27:42 +03:00
committed by bugmaster
parent bd5160a5fa
commit 114b7bf18f
23 changed files with 859 additions and 166 deletions

View File

@@ -66,12 +66,12 @@
#define BVH_PRIMITIVE_LIMIT 800000
//==================================================
// function: preBuildBVH
// function: PreBuildBVH
// purpose : Pre-builds BVH tree for heavyweight
// sensitive entities with sub-elements
// amount more than BVH_PRIMITIVE_LIMIT
//==================================================
void StdSelect_BRepSelectionTool::preBuildBVH (const Handle(SelectMgr_Selection)& theSelection)
void StdSelect_BRepSelectionTool::PreBuildBVH (const Handle(SelectMgr_Selection)& theSelection)
{
for (theSelection->Init(); theSelection->More(); theSelection->Next())
{
@@ -196,7 +196,7 @@ void StdSelect_BRepSelectionTool
anOwner->Set (theSelectableObj);
}
preBuildBVH (theSelection);
PreBuildBVH (theSelection);
}
//==================================================

View File

@@ -118,7 +118,10 @@ public:
//! if<InteriorFlag> = False the face will be sensitive only on its boundary
Standard_EXPORT static Standard_Boolean GetSensitiveForFace (const TopoDS_Face& aFace, const Handle(StdSelect_BRepOwner)& anOwner, Select3D_EntitySequence& OutList, const Standard_Boolean AutoTriangulation = Standard_True, const Standard_Integer NbPOnEdge = 9, const Standard_Real MaxiParam = 500, const Standard_Boolean InteriorFlag = Standard_True);
//! Traverses the selection given and pre-builds BVH trees for heavyweight
//! sensitive entities containing more than BVH_PRIMITIVE_LIMIT (defined in .cxx file)
//! sub-elements
Standard_EXPORT static void PreBuildBVH (const Handle(SelectMgr_Selection)& theSelection);
protected:
@@ -129,12 +132,6 @@ protected:
private:
//! Traverses the selection given and pre-builds BVH trees for heavyweight
//! sensitive entities containing more than BVH_PRIMITIVE_LIMIT (defined in .cxx file)
//! sub-elements
Standard_EXPORT static void preBuildBVH (const Handle(SelectMgr_Selection)& theSelection);
Standard_EXPORT static void GetEdgeSensitive (const TopoDS_Shape& aShape, const Handle(StdSelect_BRepOwner)& anOwner, const Handle(SelectMgr_Selection)& aSelection, const Standard_Real theDeflection, const Standard_Real theDeflectionAngle, const Standard_Integer NbPOnEdge, const Standard_Real MaximalParameter, Handle(Select3D_SensitiveEntity)& aSensitive);