I have tausends of AIS_Lines to display, OCC gets very slow after a few 1000 Lines. Does anybody have a solution to display faster AIS_Objects?
Thanks in Advance!
Martin
Thanks Patrik,
I thought of that, but I have also Points which I haven't found how to add, as I have some attributes that comes with the objects, it would be messy to handle it in compounds, maybe to inherit from AIS_Object and write directly in OpenGL. By any chance any idea how to do that?
can you give more informations (if you don't wan so write it to the forum post an email)?
I haven't tried using OpenGL directly in an AIS context (but that would be a nice idea).
Hi Martin ,
Sorry, I have a mistake for
"myAISContext->DisplayedObjects(Obj_List,Standard_False);", and it should be myAISContext->Display(Obj_List,Standard_False);".
trying it this way makes no difference to the "standard way" displaying interactive objects. You can get all actual interactive objects via "AIS_ListOfInteractive".
So instead of having thousands of lines collect them to a TopoDS_Compound and display this compound.
You see it in AIS_ListOfInteractive. You have only one AIS_Object more in the list.
Hi Martin,
You can try as following:
// Obj_List is AIS_ListOfInteractive
AIS_ListIteratorOfListOfInteractive it;
for (it.Initialize(Obj_List); it.More(); it.Next())
once again, the only way to have your display faster is to create your own class inheriting from AIS_InteractiveObject and draw the primitives using the low level functions from the Graphic3d package ( Graphic3d_Group )
You can check the pdf document about visualisation to see how it's working.
Read also the code in AIS_Line.cxx
Wed, 08/21/2002 - 15:48
Hi,
try to collect a TopoDS_Compound and display it.
Best regards,
Patrik Müller
Wed, 08/21/2002 - 15:56
Thanks Patrik,
I thought of that, but I have also Points which I haven't found how to add, as I have some attributes that comes with the objects, it would be messy to handle it in compounds, maybe to inherit from AIS_Object and write directly in OpenGL. By any chance any idea how to do that?
Thu, 08/22/2002 - 08:09
Hi,
can you give more informations (if you don't wan so write it to the forum post an email)?
I haven't tried using OpenGL directly in an AIS context (but that would be a nice idea).
Patrik
Mon, 08/26/2002 - 10:38
Hi Patrik
give me some time with Angels idea. I'll let you know if I discover something.
Cheers Martin
Fri, 08/23/2002 - 02:49
Hi Martin,
Maybe you can append your "AIS_Line" to "AIS_ListOfInteractive" and Display like as following:
// Obj_List is AIS_ListOfInteractive
AIS_ListIteratorOfListOfInteractive it;
for (it.Initialize(Obj_List); it.More(); it.Next())
{
myAISContext->DisplayedObjects(Obj_List,Standard_False);
}
myAISContext->UpdateCurrentViewer();
Sincerely,
Angel
Sun, 08/25/2002 - 23:04
Hi Angel,
thanks for your valuable input, I changed the code to the following:
AIS_ListOfInteractive
Obj_List;
AIS_ListIteratorOfListOfInteractive it;
for(int i=0;iais_obj);
}
for (it.Initialize(Obj_List); it.More(); it.Next())
{
myAISContext->DisplayedObjects(Obj_List,Standard_False);
}
myAISContext->UpdateCurrentViewer();
its fast but it doesn't show anything as I left out the display of the lines. Do I need to do something more?
Cheers
Martin
Mon, 08/26/2002 - 02:58
Hi Martin ,
Sorry, I have a mistake for
"myAISContext->DisplayedObjects(Obj_List,Standard_False);", and it should be myAISContext->Display(Obj_List,Standard_False);".
Sincerely,
Angel
Mon, 08/26/2002 - 10:55
Hi Angel
If I try to display the list directly, it gives me a syntax error. So I changed to the following, which works but is slow again.
myAISContext->Display(it.Value(),Standard_False);
Thanks for your help so far.
Martin
Mon, 08/26/2002 - 11:01
Hi Martin,
trying it this way makes no difference to the "standard way" displaying interactive objects. You can get all actual interactive objects via "AIS_ListOfInteractive".
So instead of having thousands of lines collect them to a TopoDS_Compound and display this compound.
You see it in AIS_ListOfInteractive. You have only one AIS_Object more in the list.
Greets to Switzerland,
Patrik Müller
Mon, 08/26/2002 - 11:32
Hi Martin,
You can try as following:
// Obj_List is AIS_ListOfInteractive
AIS_ListIteratorOfListOfInteractive it;
for (it.Initialize(Obj_List); it.More(); it.Next())
{
Handle(AIS_InteractiveObject) aAisShape = it.Value();
myAISContext->Display(aAisShape,Standard_False);
}
myAISContext->UpdateCurrentViewer();
Sincerely,
Angel
Mon, 08/26/2002 - 14:52
Hi,
once again, the only way to have your display faster is to create your own class inheriting from AIS_InteractiveObject and draw the primitives using the low level functions from the Graphic3d package ( Graphic3d_Group )
You can check the pdf document about visualisation to see how it's working.
Read also the code in AIS_Line.cxx
HTH