DiscussionsIssue archiveOther usage issues

Archived discussion

How to change geometry of existing object?

Other usage issuesWed, 09/21/2011 - 18:053 replies

Browse this forum
QuestionAuthor

How can i change geometry of existing TopoDS_Shape or AIS_Shape, that already attached to AIS_InteractiveContext?
Thank you for help.

Discussion

3 archived replies

Posts are displayed in their archived order.

01Commenter-1

Use this function, this how you make a parametric modeller, you can swap the shape of an ais and update it, this is straight from OpenShapeFactory.

void HSF::updateAIS(TopoDS_Shape aShape, Handle_AIS_Shape &anAIS, Handle_AIS_InteractiveContext ic)
{
if(aShape.IsNull()) return;
if (anAIS.IsNull()){
anAIS=new AIS_Shape(aShape);
ic->SetMaterial(anAIS,Graphic3d_NOM_NEON_GNC);
ic->SetColor(anAIS, Quantity_NOC_BLACK);
ic->SetDisplayMode(anAIS,1,Standard_False);
}
if (!anAIS->HasPresentation()){
ic->Display(anAIS, 1,0,false,false);
}
else
{
anAIS->Set(aShape);
ic->Deactivate(anAIS);
ic->Redisplay(anAIS,true,true);
}
ic->Update(anAIS,true);
ic->CurrentViewer()->Redraw();
}

Best,

AlexP

02Commenter-2

cool, pretty useful!
somewhat related; do you know how to add a TopoDS_Shape to an AIS representation perhaps?

cheers,

-jelle

03Commenter-1

What do you mean by an AIS representation?

Best,

AlexP