For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Slow rotation and panning

Linden's picture
Forums: 

Hello,

I'm quite new to OpenCascade and have a problem with rotating and panning my view. My software creates about 750 edges (via BRepBuilderAPI_MakeEdge)and displays them. But when I pan or rotate my view, it begins to stutter. It seems like these events don't get finished fast enough because when I pan or rotate heavily for some time and suddenly stop it, it takes another 3-4 seconds for my view to stop. These lines also flicker while moving them, it looks like Z-buffering is disabled or something like that.

I activated the degenerated mode and just call pan(int x, int y) or rotation(int x, int y) in the MouseMove-Eventhandler.
Did I miss something? Or is it a problem to add that many edges without combining them?

thanks in advance,

Marcel

Linden's picture

Hey,

in the meantime I've discovered that opencascade rotates smoothly if I export my lines to IGES and import them afterwards. Could it be a problem with my way of adding lines?

TopoDS_Edge OCCViewer::createLine(Point3D x, Point3D y) {
gp_Pnt a(x.X, x.Y, x.Z);
gp_Pnt b(y.X, y.Y, y.Z);

TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(a, b);
return edge;
}

void OCCViewer::drawLine(double x1, double y1, double z1, double x2, double y2, double z2) {
Point3D p1(x1, y1, z1);
Point3D p2(x2, y2, z2);

myAISContext->Display(new AIS_Shape(createLine(p1, p2)), 0, 0, Standard_False);
}

Should I combine it somehow in one shape? Can I archive that with still being able to select particular lines?

Pawel's picture

Hi Linden,

in the recent past a great improvement regarding the visualization performance was introduced: VBO. But this influences shaded shapes only. Wireframe objects (and texts also) might slow the viewer down.

You might want to try

BRep_Builder

in order to draw all your lines as one. This should improve the visualization performance.

Pawel

Linden's picture

Hi,

thanks Pawel - that worked.