check_owner("Boolean_2_1/Modified_3&Extrusion_1_1/Generated_Face_2", "edge", aBox)
check_owner("Boolean_2_1/Modified_2&Extrusion_3_1/To_Face_1_1", "edge", aTower)
+# check the connected topology method: solid is not a compound of connected topology
+assert(aFuse.firstResult().shape().isConnectedTopology() == False)
+
#=========================================================================
# End of test
#=========================================================================
AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
bool isObject = anAttr->isObject();
ObjectPtr anObject = anAttr->object();
- AttributePtr anAttributeAttr = anAttr->attr();
anAttrs = aFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId());
if (anAttrs.size() > 0) {
- std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttr = anAttrs.begin();
- for(; anAttr != anAttrs.end(); anAttr++) {
- if ((*anAttr).get() && (*anAttr)->id() != theAttribute->id()) {
+ std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttrIter = anAttrs.begin();
+ for(; anAttrIter != anAttrs.end(); anAttrIter++) {
+ if ((*anAttrIter).get() && (*anAttrIter)->id() != theAttribute->id()) {
std::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
- std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttr);
+ std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttrIter);
if (aRef->isObject() != isObject)
continue;
if (isObject) {
}
}
else { // the attribute reference
+ AttributePtr anAttributeAttr = anAttr->attr();
if (aRef->attr() == anAttributeAttr) {
theError = errorMessage(EqualAttributes,
anAttributeAttr.get() ? anAttributeAttr->id() : "",
data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId());
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID());
- data()->addAttribute(INVERSED_ID(), ModelAPI_AttributeBoolean::typeId());
- AttributeBooleanPtr isInversed =
- std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(attribute(INVERSED_ID()));
- if (!isInversed->isInitialized())
- isInversed->setValue(false);
+ AttributeBooleanPtr isInversed = std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(
+ data()->addAttribute(INVERSED_ID(), ModelAPI_AttributeBoolean::typeId()));
// get the initial values
if (anEndAttr->isInitialized()) {
myYEndBefore = anEndAttr->y();
}
- data()->addAttribute(ARC_TYPE(), ModelAPI_AttributeString::typeId());
- std::dynamic_pointer_cast<ModelAPI_AttributeString>(
- data()->attribute(ARC_TYPE()))->setValue(ARC_TYPE_CENTER_START_END());
+ AttributeStringPtr anArcType = std::dynamic_pointer_cast<ModelAPI_AttributeString>(
+ data()->addAttribute(ARC_TYPE(), ModelAPI_AttributeString::typeId()));
data()->addAttribute(PASSED_POINT_ID(), GeomDataAPI_Point2D::typeId());
data()->addAttribute(TANGENT_POINT_ID(), ModelAPI_AttributeRefAttr::typeId());
data()->addAttribute(RADIUS_ID(), ModelAPI_AttributeDouble::typeId());
data()->addAttribute(ANGLE_ID(), ModelAPI_AttributeDouble::typeId());
+
+ // set after all to avoid in attributeChanged reference to not existing attributes
+ if (!isInversed->isInitialized())
+ isInversed->setValue(false);
+ anArcType->setValue(ARC_TYPE_CENTER_START_END());
}
void SketchPlugin_Arc::execute()