
Thu, 04/27/2023 - 21:40
Forums:
Hello!
I have an AIS_PointCloud data and try to hide some of its elements by re-uploading modified portion of Graphic3d_ArrayOfPrimitives without recomputing entire presentation using Graphic3d_Buffer::InvalidatedRange() mechanism. I indicate below the code used for this:
// define the points array for filling up the pointCloud data
Handle(Graphic3d_ArrayOfPoints _pointsArray = new Graphic3d_ArrayOfPoints(11);
Handle(Graphic3d_ArrayOfPrimitives) primitiveArray = _pointsArray;
const Handle(NCollection_BaseAllocator)& anAlloc = Graphic3d_Buffer::DefaultAllocator();
mutable Handle(Graphic3d_AttribBuffer) _pointsArrayAttribs = new Graphic3d_AttribBuffer(anAlloc);
_pointsArrayAttribs->Init(primitiveArray->Attributes()->NbElements, primitiveArray->Attributes()->AttributesArray(), primitiveArray->Attributes()->NbAttributes);
_pointsArrayAttribs->SetMutable(true);
//filling my pointCloud with _pointsArray elements
pointCloud->SetPoints(_pointsArray);
//...
//invoking _pointsArrayAttribs to hide some range of points
_pointsArrayAttribs->Invalidate(0, 6);
GetContext()->Redisplay(pointCloud, true, true);
GetContext()->UpdateCurrentViewer();
Although _pointsArrayAttribs seems to contain the correct data, the points in the range 0-6 are not hidden. What is wrong?
Thank you!
Fri, 05/19/2023 - 16:33
Invalidation doesn't mean hiding anything, it marks a range in a buffer that should be reuploaded from CPU to GPU (OpenGL) memory for rendering. If buffer hadn't actually changed - there will be no visual result.
Sat, 05/20/2023 - 10:19
Hello!
Thank you very much for your response!
I want to use this mechanism by re-uploading modified portion of Graphic3d_ArrayOfPrimitives without recomputing the entire presentation.
Can you indicate what are the necessary steps to use this mechanism?
Unfortunately, there is no documentation or a simple example that can be followed.
Mon, 05/22/2023 - 18:15
Conceptually something like this:
Don't know if using NaN is a good idea for hiding anything.
Tue, 05/23/2023 - 08:22
Thank you very much!!!