Hi,
I already imported my shape using the import-export, sample. Now I want to add functionnalites on that shape. For instance explore the model and put different colors depending on a selected direction. I am sure somebody has done something similar.
Thank for sharing.
Discussion
4 archived replies
Posts are displayed in their archived order.
01Commenter-1
Hi,
You have to use this code first to get all the dispayed objects in the viewer :
// On obtient la liste des objets affichés
AIS_ListOfInteractive ais_objects;
aContext->DisplayedObjects (ais_objects);
// On instancie un iterateur d'objets
AIS_ListIteratorOfListOfInteractive iobject;
// Pour chaque objet affiché
for (iobject.Initialize (ais_objects); iobject.More(); iobject.Next())
{
// You get the object and you can do what you want(e.g change color...)
Handle(AIS_InteractiveObject) ais_object = iobject.Value();
}
02Author
Thank you very much. I will try your code and will let you know the result.
Goal was to display face 1 in certain color.
Here is my error:
error C2664: 'void __thiscall AIS_InteractiveContext::Display(const class Handle_AIS_InteractiveObject &,const unsigned int)' : cannot convert parameter 1 from 'unsi
gned int' to 'const class Handle_AIS_InteractiveObject &'
Reason: cannot convert from 'unsigned int' to 'const class Handle_AIS_InteractiveObject'
No constructor could take the source type, or constructor overload resolution was ambiguous
Error executing cl.exe.
Thank you
04Commenter-1
These are the two ways to call the function Diaplay. The first parameter must be an AIS_InteractiveObject or a derived class.