
Mon, 12/16/2019 - 16:16
Forums:
I use Graphic3d_ArrayOfPolylines to draw 10,000s lines at XY plane and it works well.
But when I zoom or pan, some time those lines just disappear.
Here is the code.
void Renderer::AddPolyLines(Handle(Graphic3d_ArrayOfPolylines) array_of_lines)
{
if (array_of_lines->BoundNumber() > 0) {
m_PolyLineGroup->SetGroupPrimitivesAspect(m_LineAspect->Aspect());
m_PolyLineGroup->AddPrimitiveArray(array_of_lines);
m_prsPresentation->Display();
m_View->Update();
}
}
Mon, 12/16/2019 - 20:16
Probably you didn't update bounding box of displayed structure/presentation.
Tue, 12/17/2019 - 04:26
After manually enlarge the bound box by 2, it works now
Thank you very much.
Tue, 12/17/2019 - 14:42
> After manually enlarge the bound box by 2, it works now
That's weird that you need enlarging box...
And why don't you use AIS? Working with presentations like this is not the way it is supposed to be used (these are low-level classes).
Tue, 12/17/2019 - 18:57
I try to build a AIS_Shape from a TopoDS_Compound by adding 10,000s edge to it, it works well, but toke a long time to build. And load 10,000s line into Graphic3d_ArrayOfPolylines and display is really fast.
Tue, 12/17/2019 - 19:44
You don't have to use AIS_Shape - you can create a sub-class of AIS_InteractiveObject implementing ::Compute() interface, which will fill presentation with your Graphic3d_ArrayOfPolylines.
Tue, 12/24/2019 - 06:47
Thank you.
Just implement it with AIS_InteractiveObject and it work really well.