Hazy Wed, 09/21/2011 - 18:05 Forums: Other usage issuesHow can i change geometry of existing TopoDS_Shape or AIS_Shape, that already attached to AIS_InteractiveContext? Thank you for help. AP Fri, 09/23/2011 - 17:24 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 Log in to post comments jelle Fri, 09/23/2011 - 17:29 cool, pretty useful! somewhat related; do you know how to add a TopoDS_Shape to an AIS representation perhaps? cheers, -jelle Log in to post comments AP Sat, 09/24/2011 - 10:45 What do you mean by an AIS representation? Best, AlexP Log in to post comments
Fri, 09/23/2011 - 17:24
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
Fri, 09/23/2011 - 17:29
cool, pretty useful!
somewhat related; do you know how to add a TopoDS_Shape to an AIS representation perhaps?
cheers,
-jelle
Sat, 09/24/2011 - 10:45
What do you mean by an AIS representation?
Best,
AlexP