If I hoover over the points with the mouse nothing gets selected/detected. If I don't open a local context the complete PointCloud gets selected/detected
Tried with OCC7.1 and OCC7.3 with new selection mechanism. Both yield the same result, no detection / hilight.
Discussion
8 archived replies
Posts are displayed in their archived order.
01Commenter-1
AIS_PointCloud supports detection of points within AIS_PointCloud::SM_Points selection mode, but this mode is designed for selection of entire cloud, not individual points.
AIS_PointCloud has no any BRep vertices, hence TopAbs_VERTEX and other selection modes available for AIS_Shape are not applicable to this presentation.
Though, AIS_PointCloud::SM_SubsetOfPoints has been introduced recently within current development branch (master).
how to get access to the actually selected points?
Thanks!
04Commenter-1
AIS_InteractiveContext::SelectedInteractive() returns interactive object of selected entity, which will be always the same AIS_PointCloud as you have displayed all points with one object. To get point selection results you need requesting AIS_InteractiveContext::SelectedOwner() instead.
In case of a point cloud, this will be AIS_PointCloudOwner object, that have AIS_PointCloudOwner::SelectedPoints() method returning a map of indexes of selected points. The map is defined by TColStd_HPackedMapOfInteger which is a special map optimized for storing 32-bit integers (with more compact memory storage compared to a normal map and it also implements handy Boolean operators between maps).
05Commenter-3
Hi Mr. Gavrilov,
I used the classes you mentioned but I could not get any selected point information. I mean I select a point(Selection Mode is SM_SubsetOfPoints) with mouse click but after selection, when I call m_pCloudOwner->SelectedPoints(), it returns empty TColStd_HPackedMapOfInteger map. Before calling SelectedPoints() function, I initialize the owner (m_pCloudOwner = new AIS_PointCloudOwner(m_pointCloud);).
Can you help me?
Thanks,
Commenter-3
06Commenter-4
Hello, I have the same problem as you. Have you solved it?
07Commenter-2
Thanks Kirill, got it going.
the boolean operators are indeed handy.
great job guys!
08Commenter-4
Hello, can you tell me how to get some points from the point cloud in detail? Thank you