double aToSize = 0.0;
double aFromSize = 0.0;
- if(theFeature->real(*anIt)) {
+ if(theFeature->real(*anIt) && theFeature->real(*anIt)->isInitialized()) {
aToSize = theFeature->real(*anIt)->value();
}
anIt++;
- if(theFeature->real(*anIt)) {
+ if(theFeature->real(*anIt) && theFeature->real(*anIt)->isInitialized()) {
aFromSize = theFeature->real(*anIt)->value();
}
anIt++;
std::shared_ptr<GeomAPI_Shape> aFromShape;
std::shared_ptr<ModelAPI_AttributeSelection> anAttrSel = theFeature->selection(*anIt);
- if(anAttrSel) {
+ if(anAttrSel && anAttrSel->isInitialized()) {
aToShape = std::dynamic_pointer_cast<GeomAPI_Shape>(anAttrSel->value());
if(aToShape.get() == NULL && anAttrSel->context().get() != NULL) {
aToShape = anAttrSel->context()->shape();
anIt++;
std::shared_ptr<ModelAPI_AttributeDouble> anAttrDouble = theFeature->real(*anIt);
- if(anAttrDouble) {
+ if(anAttrDouble && anAttrDouble->isInitialized()) {
aToSize = anAttrDouble->value();
}
anIt++;
anAttrSel = theFeature->selection(*anIt);
- if(anAttrSel) {
+ if(anAttrSel && anAttrSel->isInitialized()) {
aFromShape = std::dynamic_pointer_cast<GeomAPI_Shape>(anAttrSel->value());
if(aFromShape.get() == NULL && anAttrSel->context().get() != NULL) {
aFromShape = anAttrSel->context()->shape();
anIt++;
anAttrDouble = theFeature->real(*anIt);
- if(anAttrDouble) {
+ if(anAttrDouble && anAttrDouble->isInitialized()) {
aFromSize = anAttrDouble->value();
}
/// the selection is not possible if the current feature has no presentation for the current
/// attribute not in AIS not in results. If so, no object in current feature where make
/// coincidence, so selection is not necessary
- std::shared_ptr<ModelAPI_Data> aData = myFeature->data();
- std::shared_ptr<GeomDataAPI_Point2D> aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
- aData->attribute(attributeID()));
- std::shared_ptr<GeomAPI_Pnt2d> aPoint = aPointAttr->pnt();
-
bool aFoundPoint = false;
GeomShapePtr anAISShape;
GeomPresentablePtr aPrs = std::dynamic_pointer_cast<GeomAPI_IPresentable>(myFeature);
return true;
/// analysis of AIS
+ std::shared_ptr<ModelAPI_Data> aData = myFeature->data();
+ std::shared_ptr<GeomDataAPI_Point2D> aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ aData->attribute(attributeID()));
+ std::shared_ptr<GeomAPI_Pnt2d> aPoint = aPointAttr->pnt();
if (anAISShape.get())
aFoundPoint = shapeContainsPoint(anAISShape, aPoint, mySketch);