- bool anEmptyAIS = true;
- QMap<ObjectPtr, QList<GeomShapePtr> >::const_iterator anIt = myFeatureShapes.begin(),
- aLast = myFeatureShapes.end();
- for (; anIt != aLast; anIt++) {
- ObjectPtr anObject = anIt.key();
- if (!isVisible(aDisplayer, anObject))
- continue;
- QList<GeomShapePtr> aShapes = anIt.value();
- QList<GeomShapePtr>::const_iterator aShIt = aShapes.begin(), aShLast = aShapes.end();
- for (; aShIt != aShLast; aShIt++) {
- GeomShapePtr aGeomShape = *aShIt;
- if (!aGeomShape.get())
- continue;
- TopoDS_Shape aShape = aGeomShape->impl<TopoDS_Shape>();
- // change deviation coefficient to provide more precise circle
- ModuleBase_Tools::setDefaultDeviationCoefficient(aShape, aDrawer);
-
- if (myUseAISWidth) {
- AISObjectPtr anAISPtr = aDisplayer->getAISObject(anObject);
- if (anAISPtr.get()) {
- Handle(AIS_InteractiveObject) anIO = anAISPtr->impl<Handle(AIS_InteractiveObject)>();
- if (!anIO.IsNull()) {
- int aWidth = anIO->Width();
- /// workaround for zero width. Else, there will be a crash
- if (aWidth == 0) { // width returns of TSolid shape is zero
- bool isDisplayed = !anIO->GetContext().IsNull();
- aWidth = AIS_DEFAULT_WIDTH;// default width value
- }
- setWidth(aDrawer, aWidth);
- }
+ BRep_Builder aBuilder;
+ TopoDS_Compound aComp;
+ aBuilder.MakeCompound(aComp);
+ for(NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)>::Iterator anIter(myShapeToPrsMap);
+ anIter.More(); anIter.Next()) {
+ const TopoDS_Shape& aShape = anIter.Key();
+ aBuilder.Add(aComp, aShape);
+ // change deviation coefficient to provide more precise circle
+ // as there is no result, the shape is processed to correct deviation. To be unified
+ ModuleBase_Tools::setDefaultDeviationCoefficient(aShape, aDrawer);
+
+ if (myUseAISWidth) {
+ Handle(AIS_InteractiveObject) anIO = anIter.Value();
+ if (!anIO.IsNull()) {
+ int aWidth = anIO->Width();
+ /// workaround for zero width. Else, there will be a crash
+ if (aWidth == 0) { // width returns of TSolid shape is zero
+ bool isDisplayed = !anIO->GetContext().IsNull();
+ aWidth = PartSet_Tools::getAISDefaultWidth();// default width value