#include "XGUI_ModuleConnector.h"
#include "XGUI_Displayer.h"
+#include "ModuleBase_Tools.h"
+
#include <ModelAPI_Result.h>
#include <ModelAPI_Attribute.h>
#include <ModelAPI_AttributeRefAttr.h>
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
+ Standard_Real aPrevDeviation = aDrawer->DeviationCoefficient();
+ aDrawer->SetDeviationCoefficient(ModuleBase_Tools::defaultDeviationCoefficient());
StdPrs_WFDeflectionShape::Add(thePresentation, aShape, aDrawer);
+ aDrawer->SetDeviationCoefficient(aPrevDeviation);
}
}
}
}
void addValue(const ObjectPtr& theObject, const GeomShapePtr& theShape,
+ const FeaturePtr& theFeature,
QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes)
{
- if (theObjectShapes.contains(theObject))
- theObjectShapes[theObject].append(theShape);
- else {
- QList<GeomShapePtr> aShapes;
- aShapes.append(theShape);
- theObjectShapes[theObject] = aShapes;
+ if (theObject.get()) {
+ GeomShapePtr aShape = theShape;
+ if (!aShape.get()) {
+ ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
+ if (aResult.get())
+ aShape = aResult->shape();
+ }
+ if (!isSubObject(theObject, theFeature)) {
+ if (theObjectShapes.contains(theObject))
+ theObjectShapes[theObject].append(aShape);
+ else {
+ QList<GeomShapePtr> aShapes;
+ aShapes.append(aShape);
+ theObjectShapes[theObject] = aShapes;
+ }
+ }
}
}
std::shared_ptr<ModelAPI_AttributeSelection> aSelAttribute = aCurSelList->value(i);
ResultPtr aResult = aSelAttribute->context();
GeomShapePtr aShape = aSelAttribute->value();
- if (!aShape.get())
- aShape = aResult->shape();
- if (!isSubObject(aResult, myFeature))
- addValue(aResult, aShape, theObjectShapes);
+ addValue(aResult, aShape, myFeature, theObjectShapes);
}
}
else {
AttributeReferencePtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(anAttribute);
anObject = anAttr->value();
}
-
- if (anObject.get()) {
- if (!aShape.get()) {
- ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
- if (aResult.get())
- aShape = aResult->shape();
- }
- if (!isSubObject(anObject, myFeature))
- addValue(anObject, aShape, theObjectShapes);
- }
+ addValue(anObject, aShape, myFeature, theObjectShapes);
}
}
}