Salome HOME
Update copyright: 2016
[modules/geom.git] / src / GEOMImpl / GEOMImpl_PrismDriver.cxx
index 1b9c4e4f89e0990acbb815d89a1a10615d5c7b48..2846158f41e9c276ff1ad928207cf6be78524ddc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -196,6 +196,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
     Standard_Real aHeight    = aCI.GetH();                  // Height of the extrusion
     Standard_Real anAngle    = aCI.GetDraftAngle();         // Draft angle
     Standard_Boolean isProtrusion = (aCI.GetFuseFlag()==1); 
+    Standard_Boolean isInvert = aCI.GetInvertFlag();
     // Flag to know wether the feature is a protrusion (fuse) or a depression (cut)
     
     // history of the Base wire (RefBase)
@@ -217,7 +218,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
     if(!aSuppObj.IsNull())      // If the wire has a support
       aSupport = aSuppObj->GetValue();
     
-    aShape = MakeDraftPrism(anInitShape, aSketch, aHeight, anAngle, isProtrusion, aSupport); 
+    aShape = MakeDraftPrism(anInitShape, aSketch, aHeight, anAngle, isProtrusion, aSupport, isInvert);
   }
 
   if (aShape.IsNull()) return 0;
@@ -350,7 +351,8 @@ TopoDS_Shape GEOMImpl_PrismDriver::MakeScaledPrism (const TopoDS_Shape& theShape
   aLocs->Append(aShapeCDG_1);
   aLocs->Append(aShapeCDG_2);
 
-  aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections(aWirePath, aBases, aLocs, false, false);
+  aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
+              (aWirePath, aBases, aLocs, false, false, false);
 
   // 7. Make a solid, if possible
   if (theShapeBase.ShapeType() == TopAbs_FACE) {
@@ -411,7 +413,8 @@ TopoDS_Shape GEOMImpl_PrismDriver::MakeDraftPrism ( const TopoDS_Shape& theInitS
                                                     const Standard_Real theHeight,
                                                     const Standard_Real theAngle,
                                                     bool                isProtrusion,
-                                                    const TopoDS_Shape& theSupport)
+                                                    const TopoDS_Shape& theSupport,
+                                                    bool                isInvert)
 {
   TopoDS_Shape aShape;
   
@@ -470,11 +473,11 @@ TopoDS_Shape GEOMImpl_PrismDriver::MakeDraftPrism ( const TopoDS_Shape& theInitS
     } 
     
     // Invert height and angle if the operation is an extruded cut
-    bool invert = !isProtrusion; 
+    bool invert = isInvert? isProtrusion : !isProtrusion;
     
     // If the face has a reversed orientation invert for extruded boss operations
     if(aFaceBase.Orientation() == TopAbs_REVERSED)
-      invert = isProtrusion;
+      invert = !invert;
 
     Standard_Real anAngle = theAngle;
     Standard_Real aHeight = theHeight;