#include <QList>
-static const int AIS_DEFAULT_WIDTH = 2;
-
//#define DEBUG_EMPTY_SHAPE
// multi-rotation/translation operation
// appendShapeIfVisible() on the step of filling myFeatureShapes list
// the reason is to avoid empty AIS object visualized in the viewer
//if (!aGeomShape.get()) continue;
- TopoDS_Shape aShape = aGeomShape->impl<TopoDS_Shape>();
+ TopoDS_Shape aShape = aGeomShape.get() ? aGeomShape->impl<TopoDS_Shape>() : TopoDS_Shape();
// change deviation coefficient to provide more precise circle
ModuleBase_Tools::setDefaultDeviationCoefficient(aShape, aDrawer);
/// 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
+ aWidth = PartSet_Tools::getAISDefaultWidth();// default width value
}
setWidth(aDrawer, aWidth);
}
{
theObjectShapes.clear();
- QList<ModuleBase_ViewerPrs> aValues;
+ QList<ModuleBase_ViewerPrsPtr> aValues;
ModuleBase_IPropertyPanel* aPanel = theWorkshop->propertyPanel();
if (aPanel) {
ModuleBase_ModelWidget* aWidget = aPanel->activeWidget();
}
QList<GeomShapePtr> aShapes;
- QList<ModuleBase_ViewerPrs>::const_iterator anIIt = aValues.begin(),
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator anIIt = aValues.begin(),
aILast = aValues.end();
for (; anIIt != aILast; anIIt++) {
- ModuleBase_ViewerPrs aPrs = *anIIt;
- ObjectPtr anObject = aPrs.object();
-
- GeomShapePtr aGeomShape;
+ ModuleBase_ViewerPrsPtr aPrs = *anIIt;
+ ObjectPtr anObject = aPrs->object();
- TopoDS_Shape aShape = aPrs.shape();
- if (!aShape.IsNull()) {
- aGeomShape = GeomShapePtr(new GeomAPI_Shape());
- aGeomShape->setImpl(new TopoDS_Shape(aShape));
- }
- else {
+ GeomShapePtr aGeomShape = aPrs->shape();
+ if (!aGeomShape.get() || aGeomShape->isNull()) {
ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
if (aResult.get()) {
aGeomShape = aResult->shape();