Open ferhubsch opened 2 years ago
Can you please provide a description of the issue.
Hello Sir! I edited the description and added a piece of code, hopping for any insights on the matter. I thank you for any help, if possible.
Hello sir ,
I meet the same question.
I ues v3d_view to display some cad model(ais_shape) and pointcloud model(ais_pointcloud)succesfully, but when i want to select some points from an ais_pointcloud,it's not the same as selecting TopAbs_Face from the AIS_Slection.
The schematic diagram is as follows:
The code I select TopAbs_Face from an ais_shape object is as follows:
if (!myOccView->getContext()->Selection()->IsEmpty()) {
const Handle(AIS_Selection) selection = myOccView->getContext()->Selection();
for (selection->Init(); selection->More(); selection->Next()) {
Handle(SelectMgr_EntityOwner) entity = selection->Value();
TopoDS_Shape shape = Handle(StdSelect_BRepOwner)::DownCast(entity)->Shape();
// Create an explorer to iterate over all faces in the shape.
TopExp_Explorer explorer_face(shape, TopAbs_FACE);
......
}
}
The code I select points from an ais_shape object is as follows:
Handle(AIS_Selection) selection = myOccView->getContext()->Selection();
Handle(AIS_PointCloud) myPointCloud = Handle(AIS_PointCloud)::DownCast(aisObj);
for (selection->Init(); selection->More(); selection->Next()) {
Handle(SelectMgr_EntityOwner) entity = selection->Value();
Handle(AIS_PointCloudOwner) owner = Handle(AIS_PointCloudOwner)::DownCast(entity);
Handle(TColStd_HPackedMapOfInteger) selectedPoints = owner->SelectedPoints();
......
}
I don't how to use the selectedPoints(TColStd_HPackedMapOfInteger object) to get every gp_pnt point,could you give me some advice or some sample code?Thanks in advance.
Hello there! I am trying to find the coordinates of a clicked node using a cloud point. I manage to do that easily when using gp_Pnt objects, but not with cloudPoints. I am using the register_select_callback method which doesn't work in this case, since cloudPoints are not a shape. Unfortunately in my use case I cannot stick with gp_Pnts because I use far too many nodes, so the presentation becomes very slow.
The closest I got was using a AIS_PointCloudOwner which has the method
cloud_owner.SelectedPoints()
but this yields an object that I could find no use for ('TColStd_HPackedMapOfInteger'
).