TestBooleanCommon_CompSolidCompound_CompSolidCompound.py
Test2596.py
Test2592.py
+ Test2588.py
)
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
- bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group();
+ bool isPart = aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group();
// Setting result.
if (isPart) {
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
- bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group();
+ bool isPart = aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group();
std::shared_ptr<GeomAPI_Dir> aDir =
GeomAlgoAPI_ShapeTools::buildDirFromAxisAndShape(aBaseShape, anAxis);
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
- bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group();
+ bool isPart = aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group();
// Setting result.
if (isPart) {
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
- bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group();
+ bool isPart = aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group();
// Setting result.
if (isPart) {
anObjectsIt++, aContext++) {
// for part results just set transformation
- if ((*aContext)->groupName() == ModelAPI_ResultPart::group()) {
+ if (aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group()) {
ResultPartPtr anOrigin = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aContext);
ResultPartPtr aResultPart = document()->copyPart(anOrigin, data(), aResultIndex);
aResultPart->setTrsf(aContextRes, aTrsf);
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
- bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group();
+ bool isPart = aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group();
// Setting result.
if (isPart) {
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
- bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group();
+ bool isPart = aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group();
// Setting result.
if (isPart) {
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
- bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group();
+ bool isPart = aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group();
// Setting result.
if (isPart) {
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
- bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group();
+ bool isPart = aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group();
// Setting result.
if (isPart) {
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
- bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group();
+ bool isPart = aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group();
// Setting result.
if (isPart) {
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
- bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group();
+ bool isPart = aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group();
// Setting result.
if (isPart) {
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
- bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group();
+ bool isPart = aContext->get() && (*aContext)->groupName() == ModelAPI_ResultPart::group();
// Setting result.
if (isPart) {
std::shared_ptr<ModelAPI_AttributeSelection> aSelAttribute = aCurSelList->value(i);
ResultPtr aResult = aSelAttribute->context();
if (!aResult) {
+ // this could be a whole feature selected
+ FeaturePtr aFeature = aSelAttribute->contextFeature();
+ if (aFeature.get() && aFeature->results().size() > 0) {
+ if (aFeature->firstResult()->groupName() != ModelAPI_ResultBody::group()) {
+ anErrorGroupName = aFeature->firstResult()->groupName();
+ aValid = false;
+ break;
+ }
+ continue;
+ }
theError = "Invalid selection.";
return false;
- } if (isPartSetDocument) // PartSet document: Result Part is valid
+ }
+ if (isPartSetDocument) // PartSet document: Result Part is valid
aValid = aResult->groupName() == ModelAPI_ResultPart::group();
else { // Part document: Result CompSolid is valid
aValid = aResult->groupName() == ModelAPI_ResultBody::group();
--- /dev/null
+## Copyright (C) 2014-2017 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<mailto:webmaster.salome@opencascade.com>
+##
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+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("YOZ"))
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 2)
+SketchCircle_1.result().setColor(225, 0, 0)
+SketchCircle_1.results()[1].setColor(225, 0, 0)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchPoint_1.result().setColor(170, 0, 225)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 2)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 10, 0)
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("COMPOUND", "all-in-Extrusion_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchCircle_1-SketchProjection_1-SketchPoint_1"), True)
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("COMPOUND", "all-in-Symmetry_1")], model.selection("EDGE", "PartSet/OY"), 5, 3)
+AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("COMPOUND", "all-in-LinearCopy_1")], model.selection("EDGE", "PartSet/OZ"), 45, 8)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbSubShapes(AngularCopy_1, GeomAPI_Shape.SOLID, [48])
+
+assert(model.checkPythonDump())