
Wed, 07/06/2022 - 12:24
Forums:
Hello,
I cannot get the selection of a AIS_Triangulation. Indeed, ComputeSelection() is void implemented, at least in 7.4.0:
void AIS_Triangulation::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*aMode*/)
{
}
Poly_Triangulation is not a TopoDS_Shape, so I am afraid something on the line:
StdSelect_BRepSelectionTool::Load(aSelection,
this,
shape,
TypOfSel,
aDeflection,
myDrawer->HLRAngle(),
myDrawer->IsAutoTriangulation());
won't work as a quick workaround.
So what can be done? Needless to say, Poly_Triangulation should be a first-class citizen in all respects, selection being one of the foremost.
Thanks, Marco.
Wed, 07/06/2022 - 12:54
You may display your triangulation using standard AIS_Shape object and don't bother with AIS_Triangulation designed for a very specific usage scenario.
Wed, 07/06/2022 - 14:53
I can't, because I modified AIS_Triangulation to be optimized wrt https://dev.opencascade.org/content/performance-issues-rendering-aistria..., so that using MeshVS_Mesh is not the way for my needs.
How an implementation of AIS_Triangulation::ComputeSelection() would look like, so that I can move on?
Wed, 07/06/2022 - 15:07
AIS_Triangulation is no faster than AIS_Shape to display the same Poly_Triangulation, so I guess you are not using AIS_Triangulation but some own class.
There are standard sensitivities (Select3D_SensitiveTriangulation, Select3D_SensitivePrimitiveArray) that could be used for picking triangulation, so that implementing ::ComputeSelection() wouldn't take much time. AIS_PointCloud::ComputeSelection() could be a simple sample on how implementing this method, or you may take a look onto tutorial.
Wed, 07/06/2022 - 15:17
Ok, that's the answer.
Thanks.