myIsInitialized = myLab.FindAttribute(TDataStd_IntegerArray::GetID(), myArray) == Standard_True;
}
// checking the validity because attribute (as a field) may be presented,
- // but without label: it is undoed
+ // but without label: it is undone
return (myArray.IsNull() || !myArray->IsValid()) ? 0 : myArray->Length();
}
}
} else { // reset the old array
if (theSize) {
- if (theSize != myArray->Length()) { // old data is not keept, a new array is created
+ if (theSize != myArray->Length()) { // old data is not kept, a new array is created
Handle(TColStd_HArray1OfInteger) aNewArray = new TColStd_HArray1OfInteger(0, theSize - 1);
myArray->ChangeArray(aNewArray);
owner()->data()->sendAttributeUpdated(this);
if (aCont->groupName() == ModelAPI_ResultPart::group()) {
ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aCont);
int anIndex;
- GeomShapePtr aValue = value();
- if (aValue.get())
- return aPart->data()->name() + "/" + aPart->nameInPart(aValue, anIndex);
- else
- return aPart->data()->name();
+ std::string aResult = aSubSh.get() ?
+ aPart->data()->name() + "/" + aPart->nameInPart(aSubSh, anIndex) : aPart->data()->name();
+ if (aCenterType != NOT_CENTER)
+ aResult += centersMap()[aCenterType];
+ return aResult;
}
-
// whole infinitive construction
if (aCont->groupName() == ModelAPI_ResultConstruction::group()) {
ResultConstructionPtr aConstr = std::dynamic_pointer_cast<Model_ResultConstruction>(aCont);
--- /dev/null
+# Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from salome.shaper import model
+from ModelAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(25, 20, 10)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), 20, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]__cc"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchCircle_2 = Sketch_2.addCircle(25, 20, 5)
+SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchPoint_1.result(), SketchCircle_2.center())
+model.end()
+# check the sketch_2 projection and the whole sketch is valid after selection of the circle center from another part
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(SketchProjection_1.feature()))
+assert(aFactory.validate(Sketch_2.feature()))
+
+assert(model.checkPythonDump())