Salome HOME
Verification the sketch data is not empty
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Extrusion.h
index 03d704d5dd6a4fdafe5276f845d0b4b16c5f924b..0ac301469147eac039cbb5b2b724a65b3cb3fc15 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:        GeomAlgoAPI_Extrusion.h
 // Created:     22 October 2014
 // Author:      Sergey Zaritchny
 #include <GeomAlgoAPI.h>
 #include <GeomAPI_Shape.h>
 #include <GeomAPI_Dir.h>
-#include <ModelAPI_ResultBody.h>
-#include <boost/shared_ptr.hpp>
-#include <BRepPrimAPI_MakePrism.hxx>
-#include <TopoDS_Shape.hxx>
+#include <GeomAlgoAPI_MakeShape.h>
+#include <GeomAPI_DataMapOfShapeShape.h>
+#include <memory>
+
 /**\class GeomAlgoAPI_Extrusion
  * \ingroup DataAlgo
  * \brief Allows to create the prism based on a given face and a direction
  */
 
-class GEOMALGOAPI_EXPORT GeomAlgoAPI_Extrusion  
+class GeomAlgoAPI_Extrusion : public GeomAPI_Interface
 {
  public:
 
   /* \brief Creates extrusion for the given shape along the normal for this shape
-   * \param[in] theShape face or wire to be extruded
+   * \param[in] theBasis face or wire to be extruded
    * \param[in] theSize  the length of extrusion (if the value is less than 0, the extrusion in opposite normal)
-   * \return a solid or a face which is obtained from specified one
-  
-  static boost::shared_ptr<GeomAPI_Shape> makeExtrusion(boost::shared_ptr<ModelAPI_ResultBody> theResult,
-                                                                                                               boost::shared_ptr<GeomAPI_Shape> theBasis,
-                                                                                                               boost::shared_ptr<GeomAPI_Shape> theContext,
-                                                        double theSize); */
+   * \return a solid or a face/shell which is obtained from specified one  
+   */
   /// Constructor
-  GeomAlgoAPI_Extrusion (boost::shared_ptr<GeomAPI_Shape> theBasis, double theSize);
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Extrusion (std::shared_ptr<GeomAPI_Shape> theBasis, double theSize);
 
   /// Returns True if algorithm succeed
-  const bool isDone() const;
+  GEOMALGOAPI_EXPORT const bool isDone() const;
 
   ///  Returns True if resulting shape is valid
-  const bool isValid() const;
+  GEOMALGOAPI_EXPORT const bool isValid() const;
 
   /// Returns True if resulting shape has volume
-  const bool hasVolume() const;
+  GEOMALGOAPI_EXPORT const bool hasVolume() const;
 
   /// Returns result of the Extrusion algorithm which may be a Solid or a Face
-  const boost::shared_ptr<GeomAPI_Shape>& shape () const;
-
-  /// Returns list of shapes generated from theShape
-  const ListOfShape& generated(const boost::shared_ptr<GeomAPI_Shape> theShape);
+  GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape () const;
 
   /// Returns the first shape 
-  const boost::shared_ptr<GeomAPI_Shape>& firstShape();
+  GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& firstShape();
 
   /// returns last shape
-  const boost::shared_ptr<GeomAPI_Shape>& lastShape();  
+  GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& lastShape();        
+  /// Returns map of sub-shapes of the result. To be used for History keeping
+  GEOMALGOAPI_EXPORT void  mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const;
 
+  /// Return interface for for History processing
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape () const;
+
+  /// Destructor
+  GEOMALGOAPI_EXPORT  ~GeomAlgoAPI_Extrusion();
 private:
   /// builds resulting shape
-  void build();
-
-  BRepPrimAPI_MakePrism * myBuilder;
-  TopoDS_Shape myBasis;
+  void build(const std::shared_ptr<GeomAPI_Shape>& theBasis);
+  /// fields
   double mySize;
   bool myDone;
-  TopoDS_Shape myResult;
-  ListOfShape myHistory;
-  boost::shared_ptr<GeomAPI_Shape> myShape;
-  boost::shared_ptr<GeomAPI_Shape> myFirst;
-  boost::shared_ptr<GeomAPI_Shape> myLast;
+  std::shared_ptr<GeomAPI_Shape> myShape;
+  std::shared_ptr<GeomAPI_Shape> myFirst;
+  std::shared_ptr<GeomAPI_Shape> myLast;
+  GeomAPI_DataMapOfShapeShape myMap;
+  GeomAlgoAPI_MakeShape * myMkShape;
 };
 
 #endif