Dynamic display of elements from an AIS_PointCloud

bioan

CAD practitioner
Hello!
I have an AIS_PointCloud data fill with points and I like to determine the best way to hide and show elements from it in real time, for example inside an animation.
AIS_PointCloud data could include hundreds of thousands of points.
How can I approach the problem and what would be the main steps to be implemented?
Thank you very much!!
 

bioan

CAD practitioner
Wow! It is definitely worth taking a look and understanding the whole process!
Thank you very much !!!🙃
 

bioan

CAD practitioner
Hi @natalia
Unfortunately in your sources link, I did not find any details related to displaying or hiding some elements in an AIS_PointCloud.
Can you direct me on the correct path?
Thank you!
Ioan
 

natalia

Moderator
Staff member
hi @bioan
in mentioned sample we just change the set of points in the presentation and call Redisplay for it. It was enough for case discussed there.
What about your case? Does it suffer if you follow this way? Would you be so kind to give more details if it's so?

Regards, Natalia
 

bioan

CAD practitioner
Hi @natalia !
I try to find a way to deal with Graphic3d_ArrayOfPoints, the underling entities which define an AIS_PointCloud, by re-uploading modified portion of Graphic3d_ArrayOfPrimitives without recomputing entire presentation using Graphic3d_Buffer::InvalidatedRange() mechanism. Unfortunately I do not find a simple example to follow, but in the OCCT source code there is Graphic3d_AttribBuffer class, sub-class from Graphic3d_Buffer, which seems to have exactly the right methods to deal with Graphic3d_ArrayOfPrimitives marked as advanced usage. Let me know if you can suggest something here.
Thank you!
Ioan
 

natalia

Moderator
Staff member
Hello @bioan


Some time ago, I turned to similar thoughts about separating Graphic3d_ArrayOfPrimitives on parts to improve performance. However, looking inside I started to relate to this class as to something entire. Finally, I did not decompose it and solve performance troubles in another way. There are some reasons of it. The first one is that inside this class uses Graphic3d_AttribBuffer that is similar in some extent to some standard container. Graphic3d_ArrayOfPrimitives is the fundamental class used in all primitives. So, it looks that we may rely on. Another thought, that if we add additional conditionals in such internal processing, it also may decrease speed of processing it.

Anyway, it is the field of experiments if we found the bottleneck exactly here, as you proposed).

In my experiments, I did investigations in more upper level. First, I switched off the selection recompute during animation; it’s not really need, is it? It might be helpful to investigate how many times this container data is preparing (in case of topology shape it may eat more time that updating array of primitives). Also, if you animate something, you may during animation minimize number of data animated, sure if it’s possible in your algorithm. It’s also might be helpful to set some timer delay (if you’re processing the mouse) and decrease number of compute calling (there might be many-many updates but the eye do not see them).

So, the proposal here, to investigate firstly your data preparing on more upper level and only if there are no loss of time there, try to look inside Graphic3d_ArrayOfPrimitives.

If you nevertheless find that any other things do not waste time in your application and the solution is to manage somehow this class, it would be very, very interesting if you share results of your investigations.


Cheers, Natalia
 
Top