Salome HOME
Merge remote-tracking branch 'origin/cbr/export_to_geom_via_xao'
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_RevolutionBoolean.h
index 3e8576aad1484019b304eea28ff92e5ef9781b82..8aceb322b95fcb46a3cfc74391b469d5e26c6ccb 100644 (file)
@@ -1,85 +1,51 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        FeaturesPlugin_RevolutionBoolean.h
-// Created:     11 June 2015
-// Author:      Dmitry Bobylev
+// 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>
+//
 
 #ifndef FeaturesPlugin_RevolutionBoolean_H_
 #define FeaturesPlugin_RevolutionBoolean_H_
 
-#include <FeaturesPlugin_CompositeBoolean.h>
+#include "FeaturesPlugin_Revolution.h"
+#include "FeaturesPlugin_CompositeBoolean.h"
 
-/** \class FeaturesPlugin_RevolutionBoolean
- *  \ingroup Plugins
- */
-class FeaturesPlugin_RevolutionBoolean : public FeaturesPlugin_CompositeBoolean
+/// \class FeaturesPlugin_RevolutionBoolean
+/// \ingroup Plugins
+/// \brief Interface for the composite revolution feature.
+class FeaturesPlugin_RevolutionBoolean : public FeaturesPlugin_Revolution,
+                                         public FeaturesPlugin_CompositeBoolean
 {
 public:
-  /// Attribute name of an revolution axis.
-  inline static const std::string& AXIS_OBJECT_ID()
-  {
-    static const std::string MY_AXIS_ID("axis_object");
-    return MY_AXIS_ID;
-  }
-
-  /// attribute name for creation method
-  inline static const std::string& CREATION_METHOD()
-  {
-    static const std::string METHOD_ATTR("CreationMethod");
-    return METHOD_ATTR;
-  }
-
-  /// Attribute name of revolution to angle.
-  inline static const std::string& TO_ANGLE_ID()
-  {
-    static const std::string MY_TO_ANGLE_ID("to_angle");
-    return MY_TO_ANGLE_ID;
-  }
-
-  /// Attribute name of revolution from angle.
-  inline static const std::string& FROM_ANGLE_ID()
-  {
-    static const std::string MY_FROM_ANGLE_ID("from_angle");
-    return MY_FROM_ANGLE_ID;
-  }
-  
-  /// Attribute name of an object to which the revolution grows.
-  inline static const std::string& TO_OBJECT_ID()
-  {
-    static const std::string MY_TO_OBJECT_ID("to_object");
-    return MY_TO_OBJECT_ID;
-  }
-
-  /// Attribute name of extrusion offset.
-  inline static const std::string& TO_OFFSET_ID()
-  {
-    static const std::string MY_TO_OFFSET_ID("to_offset");
-    return MY_TO_OFFSET_ID;
-  }
-
-  /// Attribute name of an object from which the revolution grows.
-  inline static const std::string& FROM_OBJECT_ID()
-  {
-    static const std::string MY_FROM_OBJECT_ID("from_object");
-    return MY_FROM_OBJECT_ID;
-  }
-
-  /// Attribute name of extrusion offset.
-  inline static const std::string& FROM_OFFSET_ID()
-  {
-    static const std::string MY_FROM_OFFSET_ID("from_offset");
-    return MY_FROM_OFFSET_ID;
-  }
+  /// Request for initialization of data model of the feature: adding all attributes.
+  FEATURESPLUGIN_EXPORT virtual void initAttributes();
 
 protected:
-  /// Init attributes for revolution.
-  virtual void initMakeSolidsAttributes();
+  FeaturesPlugin_RevolutionBoolean(){};
 
-  /// Create solids from faces with revolution.
-  virtual ListOfShape MakeSolids(const ListOfShape& theFaces);
+  // Creates revolutions.
+  bool makeGeneration(ListOfShape& theBaseShapes,
+                      ListOfMakeShape& theMakeShapes);
 
-protected:
-  FeaturesPlugin_RevolutionBoolean(){};
+  /// Stores generation history.
+  void storeGenerationHistory(ResultBodyPtr theResultBody,
+                              const GeomShapePtr theBaseShape,
+                              const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+                              int& theTag);
 };
 
 #endif