Thu, 03/25/2004 - 04:14
I created a class similar to User_Cylinder called User_Point. This class helps to store and display Point Cloud vertices in a fast way. The method was described in one of the earlier post in this forum, which is to use,
Handle(Graphic3d_Structure) theStructure = Handle(Graphic3d_Structure)::DownCast(aPresentation);
Handle(Graphic3d_Group) theGroup= new Graphic3d_Group(theStructure);
Handle(Prs3d_AspectMarker3d) asp;
asp = myDrawer->PointAspect();
asp->SetTypeOfMarker(Aspect_TOM_POINT);
theGroup->SetGroupPrimitivesAspect(asp->Aspect());
Graphic3d_Array1OfVertex& theArray = GetVertices(); //your points
theGroup->MarkerSet(theArray);
But I want to allow the user to select these point and has been looking at StdSelect classes.
As these point clouds are not part of TopoDS classes, but merely coordinates which I inserted into the display, the existing selection tools doesn't allow me to select a point and highlight it?
Anybody can help?
P/S: In ACIS, I created a new tool called SelectTool which returns a screen coordinate (X,Y) when I click on the view. (X,Y) is transformed to (x,y,z) by using a position mapping function provided by the display context. Next, I use this coordinate to search for the nearest point cloud and highlight it.
Thu, 03/25/2004 - 09:39
Hi,
have you looked for "ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode)" in your AIS class?
HTH,
Patrik
Thu, 03/25/2004 - 10:23
Yes, I did.
ComputeSelection(...) is the location where StdSelect_BRep*** functions are called.
Thu, 03/25/2004 - 11:20
So have you tried inserting your vertices as Select3D_SensitivePoint? I think it should give you the right result...
Patrik
Thu, 03/25/2004 - 12:29
Will try it out.
How's the performance of the system, when a couple of million points are inserted?
Thanks.
Tue, 04/18/2006 - 19:11
Hi I'm interested by your User_Point class. I'm trying to do one but I'm still a newbie in OpenCascade and I need to display more than 100 000 points. I would be very glad if you could please send me your User_Point class.
Thank you very much !
Philippe.