
Fri, 09/23/2011 - 17:35
Hello all.
I'm new user OCC and I can not solve my problem...
I try to quickly draw wireframe (hundreds of thousands of edges) in 3D.
I assembled TopoDS_Edge fast enough and I put them in array
std::vector
but how can I now draw this filed quickly enough?
My first attempt (simplified):
Handle(AIS_Shape) aAIS;
for(unsigned int i=0; i
{
aAIS = new AIS_Shape(listEdges[i]);
...
}
Here arises a large number of AIS_Shape and for example rotation is very slow.
My second attempt (simplified):
Handle(AIS_Shape) aAIS;
BRepBuilderAPI_MakeWire wire;
for(unsigned int i=0; i
{
wire.Add(listEdges[i]);
}
aAIS = new AIS_Shape(wire);
Here is a good result and (e.g.) rotation as well, but building a wire (wire.Add(...)) takes a long time ...
I would like to ask:
How to effectively draw the edges of my field??
Thank you
Martin Kovacik
Mon, 09/26/2011 - 17:50
Instead of adding all the edges to a wire, try adding them to a compound:
TopoDS_Compound compoundShape;
BRep_Builder compoundBuilder;
compoundBuilder.MakeCompound( compoundShape );
for(unsigned int i=0; i < listEdges.size(); i++)
{
compoundBuilder.Add(listEdges[i]);
}
You would then display compoundShape in your context. This should be less overhead then adding the edges to a wire, with just as good performance for rotation, etc.
Tue, 09/27/2011 - 16:22
Thank you for your reply.
Your idea works perfectly.
This is exactly what I was looking for.
Thank you.