+ theShapeToPrsMap.Clear();
+
+ XGUI_Displayer* aDisplayer = XGUI_Tools::workshop(theWorkshop)->displayer();
+
+ // create presentations on the base of the shapes
+ QMap<ObjectPtr, QList<GeomShapePtr> >::const_iterator anIt = theFeatureShapes.begin(),
+ aLast = theFeatureShapes.end();
+ for (; anIt != aLast; anIt++) {
+ ObjectPtr anObject = anIt.key();
+ QList<GeomShapePtr> aShapes = anIt.value();
+ QList<GeomShapePtr>::const_iterator aShIt = aShapes.begin(), aShLast = aShapes.end();
+ for (; aShIt != aShLast; aShIt++) {
+ GeomShapePtr aGeomShape = *aShIt;
+ // the shape should not be checked here on empty value because it should be checked in
+ // appendShapeIfVisible() on the step of filling theFeatureShapes list
+ // the reason is to avoid empty AIS object visualized in the viewer
+ //if (!aGeomShape.get()) continue;
+ TopoDS_Shape aShape = aGeomShape.get() ? aGeomShape->impl<TopoDS_Shape>() : TopoDS_Shape();
+ if (aShape.IsNull())
+ continue;
+
+ // change deviation coefficient to provide more precise circle
+ Handle(AIS_InteractiveObject) anIO;
+ AISObjectPtr anAISPtr = aDisplayer->getAISObject(anObject);
+ if (anAISPtr.get())
+ anIO = anAISPtr->impl<Handle(AIS_InteractiveObject)>();
+ theShapeToPrsMap.Bind(aShape, anIO);
+ }
+ }