Salome HOME
Task #3230: Sketcher: create a curve passing through selected points or vertices...
[modules/shaper.git] / src / SketchSolver / PlaneGCSSolver / PlaneGCSSolver_EntityWrapper.h
index b9a3981d075b73570e3bb8b5ccc6f8f70d790c95..628344913306d963b1c05ca2bb16bc243796d1b0 100644 (file)
@@ -1,20 +1,35 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:    PlaneGCSSolver_EntityWrapper.h
-// Created: 30 Nov 2015
-// Author:  Artem ZHIDKOV
+// Copyright (C) 2014-2020  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
+//
 
 #ifndef PlaneGCSSolver_EntityWrapper_H_
 #define PlaneGCSSolver_EntityWrapper_H_
 
 #include <PlaneGCSSolver_Defs.h>
 
-#include <ModelAPI_Attribute.h>
-#include <ModelAPI_Feature.h>
-
-#include <list>
+#include <map>
 #include <memory>
 
+class ModelAPI_Attribute;
+
+class PlaneGCSSolver_EntityWrapper;
+typedef std::shared_ptr<PlaneGCSSolver_EntityWrapper> EntityWrapperPtr;
+
 /**
  *  Wrapper providing operations with entities regardless the solver.
  */
@@ -32,10 +47,24 @@ public:
   /// \brief Return the External flag
   bool isExternal() const { return myExternal; }
 
+  /// \brief Store names of attributes and their values if necessary
+  void setAdditionalAttributes(const std::map<std::string, EntityWrapperPtr>& theAttribues)
+  { myAdditionalAttributes = theAttribues; }
+  /// \brief Return the list of additional attributes
+  const std::map<std::string, EntityWrapperPtr>& additionalAttributes() const
+  { return myAdditionalAttributes; }
+
+protected:
+  /// \brief Update entity by the values of theAttribute
+  /// \return \c true if any value of attribute is not equal to the stored in the entity
+  virtual bool update(std::shared_ptr<ModelAPI_Attribute> theAttribute)
+  { return false; }
+
+  friend class PlaneGCSSolver_AttributeBuilder;
+
 private:
   bool myExternal;
+  std::map<std::string, EntityWrapperPtr> myAdditionalAttributes;
 };
 
-typedef std::shared_ptr<PlaneGCSSolver_EntityWrapper> EntityWrapperPtr;
-
 #endif