Wed, 04/29/2020 - 05:24
Forums:
I want to change the color of the face which is selected, the face belongs to a object in the context . And I think the function "AIS_ColoredShape::SetCustomColor" can solve this problem.However , When I use it in my Qt project ,it crashed . Here is my poor C++ code .I will appreciate if any help.
if(theContext->HasSelectedShape())
{
Handle(AIS_InteractiveObject) Current = theContext->SelectedInteractive() ;
TopoDS_Shape targetShape = theContext->SelectedShape();
Handle(AIS_ColoredShape) sourceColorShape = Handle(AIS_ColoredShape)::DownCast(Current);
sourceColorShape->SetCustomColor(targetShape ,color);//color was specified before
Current->Redisplay(Standard_True);
}
Sat, 05/02/2020 - 15:59
Build Debug builds of OCCT libraries and your application, so that debugger will help to see why code crashes.