DiscussionsIssue archiveOther usage issues

Archived discussion

Speed up the visualization?

Other usage issuesSat, 11/08/2008 - 23:012 replies

Browse this forum
QuestionAuthor

I need display 1000 edges. The following is my code:
---------------------------
for(int i=0; i {
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(..);
Handle(AIS_Shape) hShape = new AIS_Shape(edge);
myAISContext->Display(hShape);
}
---------------------------
When I excute the program, it can work, but very slowly, just like an animation. Do you know how can speed up the display by using some strategy. Thanks a lot.

By the way, when I triangulize the surface into meshes, acutally there are much more than 1000 edges, but the OCC can display the meshes very smoothly and fast. Why ???

Discussion

2 archived replies

Posts are displayed in their archived order.

01Commenter-1

You should try the solution that has been suggested a lot of times here: add all the Edges to a Compound, then just display the Compound.

02Commenter-2

Hello Author,
try adding all the shape in the loop without updating the display:
for(int i=0; i<1000; i++)
{
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(..);
Handle(AIS_Shape) hShape = new AIS_Shape(edge);
myAISContext->Display(hShape,Standard_False);
}

then update the display outside of the loop:
myAISContext->UpdateCurrentViewer();

This will speed up for sure. Using a compound like Paul said is another good option.

Good Luck,
Commenter-2.