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

Related pages

Changing attributes of my own interactive object

Omar Msaaf's picture
Forums: 

Hello, I have derivated a class from the ais_interactive_object. I can display it right now. But i just can't change attributes like material and color.. Do i have to redefine the setcolor and setmaterial functions ? What code do i have to put inside the brackets ? How do i can call these functions ?

I have tried this but without effect : redefinition of the function void CUser_Interactive_Object::SetColor(const Quantity_NameOfColor aColor) myDrawer->ShadingAspect()->SetColor(aColor);

Then i called it this way

Handle_AIS_InteractiveObject Current = myAISContext->SelectedInteractive() ; Handle_CUser_Interactive_Object currentobject = Handle(CUser_Interactive_Object)::DownCast(Current); if(!Current.IsNull()) { myAISContext->SetColor(Current,Quantity_NOC_MATRABLUE); //I tried this too Current->SetColor(Quantity_NOC_MATRABLUE); }

What am i doing wrong ????

Thanxs in advance

Omar Msaaf's picture

Those who wnat to know how to do it can contact me. Best regards. Omar Msaaf