]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Enabled test for Pipe
authordbv <dbv@opencascade.com>
Mon, 27 Jun 2016 13:51:52 +0000 (16:51 +0300)
committerdbv <dbv@opencascade.com>
Mon, 27 Jun 2016 13:51:52 +0000 (16:51 +0300)
src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/Test/TestPipe.py

index 451b9c0022d65ea1513c1971f1c4c8f7033ea651..a14f2832bff746f5b1a01b6194b94e01e1c5669e 100644 (file)
@@ -127,4 +127,5 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestGroup.py
                TestIntersection.py
                TestUnion.py
-               TestRemoveSubShapes.py)
+               TestRemoveSubShapes.py
+               TestPipe.py)
index 811ee33a46ccdd9998afaec6a833d00a0bae33af..5623aa59419148e8d8d6e89da7c21894f7adae2a 100644 (file)
@@ -100,66 +100,66 @@ aSession.finishOperation()
 
 # Test results
 assert (len(aPipeFeature.results()) > 0)
-aSession.undo()
-#
-# Create pipe with bi-normal
-aSession.startOperation()
-aPipeFeature = aPart.addFeature("Pipe")
-aBaseObjectsList = aPipeFeature.selectionList("base_objects")
-aBaseObjectsList.append(aFaceResult1, None)
-aPathObjectSelection = aPipeFeature.selection("path_object")
-aPathObjectSelection.setValue(aWireResult, None)
-aPipeFeature.string("creation_method").setValue("binormal")
-aBinormalObjectSelection = aPipeFeature.selection("binormal")
-aShapeExplorer = GeomAPI_ShapeExplorer(aSketchShape, GeomAPI_Shape.EDGE)
-aBinormalObjectSelection.setValue(aSketchResult, aShapeExplorer.current())
-aSession.finishOperation()
-#
-# Test results
-assert (len(aPipeFeature.results()) > 0)
-aSession.undo()
-#
-# Create pipe with locations
-# Create a sketch with circle for pipe profile
-aSession.startOperation()
-aSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
-origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
-origin.setValue(0, 0, 200)
-dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
-dirx.setValue(1, 0, 0)
-norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
-norm.setValue(0, 0, 1)
-#
-# Create circle
-aSketchCircleFeature = aSketchFeature.addFeature("SketchCircle")
-anCircleCentr = geomDataAPI_Point2D(aSketchCircleFeature.attribute("CircleCenter"))
-aCircleRadius = aSketchCircleFeature.real("CircleRadius")
-anCircleCentr.setValue(0, 0)
-aCircleRadius.setValue(20)
-aSession.finishOperation()
-aSketchResult = aSketchFeature.firstResult()
-aSketchShape = aSketchResult.shape()
-#
-# Create face
-aSession.startOperation()
-aFaceFeature = aPart.addFeature("Face")
-aBaseObjectsList = aFaceFeature.selectionList("base_objects")
-aShapeExplorer = GeomAPI_ShapeExplorer(aSketchShape, GeomAPI_Shape.EDGE)
-while aShapeExplorer.more():
-    aBaseObjectsList.append(aSketchResult, aShapeExplorer.current())
-    aShapeExplorer.next()
-aSession.finishOperation()
-aFaceResult2 = aFaceFeature.firstResult()
-#
-aSession.startOperation()
-aPipeFeature = aPart.addFeature("Pipe")
-aBaseObjectsList = aPipeFeature.selectionList("base_objects")
-aBaseObjectsList.append(aFaceResult1, None)
-aBaseObjectsList.append(aFaceResult2, None)
-aPathObjectSelection = aPipeFeature.selection("path_object")
-aPathObjectSelection.setValue(aWireResult, None)
-aPipeFeature.string("creation_method").setValue("locations")
-aSession.finishOperation()
-#
-# Test results
-assert (len(aPipeFeature.results()) > 0)
+aSession.undo()
+
+# Create pipe with bi-normal
+aSession.startOperation()
+aPipeFeature = aPart.addFeature("Pipe")
+aBaseObjectsList = aPipeFeature.selectionList("base_objects")
+aBaseObjectsList.append(aFaceResult1, None)
+aPathObjectSelection = aPipeFeature.selection("path_object")
+aPathObjectSelection.setValue(aWireResult, None)
+aPipeFeature.string("creation_method").setValue("binormal")
+aBinormalObjectSelection = aPipeFeature.selection("binormal")
+aShapeExplorer = GeomAPI_ShapeExplorer(aSketchShape, GeomAPI_Shape.EDGE)
+aBinormalObjectSelection.setValue(aSketchResult, aShapeExplorer.current())
+aSession.finishOperation()
+
+# Test results
+assert (len(aPipeFeature.results()) > 0)
+aSession.undo()
+
+# Create pipe with locations
+# Create a sketch with circle for pipe profile
+aSession.startOperation()
+aSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
+origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
+origin.setValue(0, 0, 200)
+dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
+dirx.setValue(1, 0, 0)
+norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
+norm.setValue(0, 0, 1)
+
+# Create circle
+aSketchCircleFeature = aSketchFeature.addFeature("SketchCircle")
+anCircleCentr = geomDataAPI_Point2D(aSketchCircleFeature.attribute("CircleCenter"))
+aCircleRadius = aSketchCircleFeature.real("CircleRadius")
+anCircleCentr.setValue(0, 0)
+aCircleRadius.setValue(20)
+aSession.finishOperation()
+aSketchResult = aSketchFeature.firstResult()
+aSketchShape = aSketchResult.shape()
+
+# Create face
+aSession.startOperation()
+aFaceFeature = aPart.addFeature("Face")
+aBaseObjectsList = aFaceFeature.selectionList("base_objects")
+aShapeExplorer = GeomAPI_ShapeExplorer(aSketchShape, GeomAPI_Shape.EDGE)
+while aShapeExplorer.more():
+    aBaseObjectsList.append(aSketchResult, aShapeExplorer.current())
+    aShapeExplorer.next()
+aSession.finishOperation()
+aFaceResult2 = aFaceFeature.firstResult()
+
+aSession.startOperation()
+aPipeFeature = aPart.addFeature("Pipe")
+aBaseObjectsList = aPipeFeature.selectionList("base_objects")
+aBaseObjectsList.append(aFaceResult1, None)
+aBaseObjectsList.append(aFaceResult2, None)
+aPathObjectSelection = aPipeFeature.selection("path_object")
+aPathObjectSelection.setValue(aWireResult, None)
+aPipeFeature.string("creation_method").setValue("locations")
+aSession.finishOperation()
+
+# Test results
+assert (len(aPipeFeature.results()) > 0)