Salome HOME
Fix for the issue #2465 and a unit test and a correction for the test becomes working.
authormpv <mikhail.ponikarov@opencascade.com>
Tue, 15 May 2018 14:31:55 +0000 (17:31 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Tue, 15 May 2018 14:31:55 +0000 (17:31 +0300)
src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/Test/Test2465.py [new file with mode: 0644]
src/GDMLAPI/GDMLAPI_Ellipsoid.cpp
src/GeomValidators/GeomValidators_ShapeType.cpp

index 382f00ec630e8242ff66d6038d1e1e04b48bb3d1..b0be8b41278ecdeba343131e49998b7b0d07c41d 100644 (file)
@@ -250,4 +250,5 @@ ADD_UNIT_TESTS(TestExtrusion.py
                Test2419_1.py
                Test2419_2.py
                Test2419_3.py
+               Test2465.py
 )
diff --git a/src/FeaturesPlugin/Test/Test2465.py b/src/FeaturesPlugin/Test/Test2465.py
new file mode 100644 (file)
index 0000000..d23abdd
--- /dev/null
@@ -0,0 +1,35 @@
+## 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 salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Ellipsoid_1 = model.addEllipsoid(Part_1_doc, 10, 20, 40)
+Torus_1 = model.addTorus(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 15, 3)
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Ellipsoid_1_1")], model.selection("EDGE", "Ellipsoid_1_1/Face_1"), 10, 2)
+model.end()
+
+# check that for the linear copy direction the elliptical edge is invalid
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(not aFactory.validate(LinearCopy_1.feature()))
index 385b5dea200a6111f9b88993325084e880bf42e0..167d6aa64fd8995c64939ad3268bc4aad9ccf0a0 100644 (file)
@@ -38,7 +38,7 @@ GDMLAPI_Ellipsoid::GDMLAPI_Ellipsoid(const std::shared_ptr<ModelAPI_Feature>& th
   if (initialize()) {
     setSizes(theAX, theBY, theCZ);
     fillAttribute("", useZCut1());
-    fillAttribute("", useZCut1());
+    fillAttribute("", useZCut2());
   }
 }
 
index 0c1a18b497e6774fe0525f0b59ee0be82e15a348..3ee016de3709faea44c4184fa406ce640c623983 100755 (executable)
@@ -232,7 +232,7 @@ bool GeomValidators_ShapeType::isValidShape(const GeomShapePtr theShape,
       aValid = theShape->isEdge();
       break;
     case Line:
-      aValid = theShape->isEdge() && !GeomAPI_Curve(theShape).isCircle();
+      aValid = theShape->isEdge() && GeomAPI_Curve(theShape).isLine();
       break;
     case Circle:
       aValid = theShape->isEdge() && GeomAPI_Curve(theShape).isCircle();