
Tue, 03/13/2012 - 13:46
I have this code in a loop:
Handle_AIS_Shape aisShape=new AIS_Shape(shape);
theContext->SetColor(aisShape, colorName);
theContext->SetTransparency(aisShape,prosojnost);
theContext->SetDisplayMode(aisShape, 1, Standard_False);
theContext->Load(aisShape,-1,Standard_False);
theContext->SetCurrentObject(aisShape, Standard_False);
and this out of the loop:
theContext->DisplayAll();
I have to draw lots of object but not during the loop, but after everything is computed.
Everything works fine with this code except selection of objects does not.
/////////////////////////////
Something like this in loop works with selection, but its displaying objects as the loop progresses. And gets realy slow after lots of objects...:
Handle(AIS_Shape) aisShape=new AIS_Shape(shape);
myContext->SetMaterial(aisShape, materialName);
myContext->SetDisplayMode(aisShape, 1, Standard_False);
myContext->Display(aisShape, Standard_False);
myContext->SetCurrentObject(aisShape, Standard_False);
//////////////////////////////////////
Help would be appreciated on how to fix the first example to work with selection.
ty
Fri, 06/22/2012 - 20:40
In the second example you should use
myContext->SetMaterial(aisShape, materialName, Standard_False);
instead of
myContext->SetMaterial(aisShape, materialName);
in order not to update the view each time in the loop.
Mon, 06/25/2012 - 16:17
Thanks alot!