
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.
Sun, 07/27/2025 - 13:26
Thank you very much!!!
What are the recommended values for hiding a point?
If I use the suggested values: std::numeric_limits<float>::quiet_NaN(), 0, 0 - the hiding and later redisplaying of the points works correctly, but at some point during this process, the following error is triggered:
*** ERROR: ASSERT in file '.../SelectMgr/SelectMgr_Frustum.lxx': Error! Failed to project box (aMaxB >= aMinB)
The error occurs after a series of point displays/hides using the procedure and the value indicated for setting a vertice, right after selecting a point in the workspace using pick point!
I would appreciate any guidance on how to address this issue or where to seek potential solutions.