From 47dda59ae629e7a3dc3992c03e3d76a8239c416a Mon Sep 17 00:00:00 2001 From: dbv Date: Wed, 22 Aug 2018 14:58:18 +0300 Subject: [PATCH] Issue #1379: boolean error message in revolution cut operation Added small fix and fixed test. --- src/FeaturesPlugin/Test/Test1379.py | 9 ++++++--- src/PartSet/PartSet_TreeNodes.cpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/FeaturesPlugin/Test/Test1379.py b/src/FeaturesPlugin/Test/Test1379.py index ca70c5283..43cdb6491 100644 --- a/src/FeaturesPlugin/Test/Test1379.py +++ b/src/FeaturesPlugin/Test/Test1379.py @@ -206,6 +206,12 @@ SketchLine_21 = Sketch_3.addLine(0.008999999999999999, 0.042, 0.029, 0.042) SketchLine_21.setName("SketchLine_9") SketchLine_21.result().setName("SketchLine_9") SketchLine_21.result().setColor(0, 150, 0) +SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), False) +SketchLine_22 = SketchProjection_6.createdFeature() +SketchLine_22.setName("SketchLine_10") +SketchLine_22.result().setName("SketchLine_10") +SketchConstraintCoincidence_25 = Sketch_3.setCoincident(SketchLine_21.startPoint(), SketchLine_22.result()) +SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_9") SketchConstraintCoincidence_26 = Sketch_3.setCoincident(SketchLine_19.startPoint(), SketchLine_21.endPoint()) SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_10") SketchConstraintCoincidence_27 = Sketch_3.setCoincident(SketchLine_21.startPoint(), SketchLine_20.endPoint()) @@ -213,9 +219,6 @@ SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_11") SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_21.result()) SketchConstraintAngle_2 = Sketch_3.setAngle(SketchLine_20.result(), SketchLine_21.result(), 25) SketchProjection_7 = Sketch_3.addProjection(model.selection("VERTEX", "PartSet/Sketch_1/Vertex-SketchLine_17s-SketchLine_16e"), False) -SketchPoint_2 = SketchProjection_7.createdFeature() -SketchConstraintCoincidence_28 = Sketch_3.setCoincident(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_20.endPoint()) -SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_12") SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_21.result(), 0.02) RevolutionCut_1.setNestedSketch(Sketch_3) model.end() diff --git a/src/PartSet/PartSet_TreeNodes.cpp b/src/PartSet/PartSet_TreeNodes.cpp index 515f7cb03..dbdbc4214 100644 --- a/src/PartSet/PartSet_TreeNodes.cpp +++ b/src/PartSet/PartSet_TreeNodes.cpp @@ -195,7 +195,7 @@ int PartSet_ObjectNode::numberOfSubs() const else { CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast(myObject); - if (aCompFeature.get()) + if (aCompFeature.get() && aCompFeature->data()->isValid()) return aCompFeature->numberOfSubs(true); else { ResultFieldPtr aFieldRes = std::dynamic_pointer_cast(myObject); -- 2.39.2