Salome HOME
#18963 C++17 ready
[modules/shaper.git] / src / SketchAPI / SketchAPI_Constraint.h
index 8f79cca41f8f79a91bda4b985d57ca91ba52b72c..462f170f9d49af899f31df1312863e31e2df8a98 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// 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
 //
 // 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
+// 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>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_CONSTRAINT_H_
@@ -29,6 +28,8 @@
 
 #include <SketchPlugin_Constraint.h>
 
+class ModelHighAPI_Double;
+
 /**\class SketchAPI_Constraint
  * \ingroup CPPHighAPI
  * \brief Interface for Constraint feature
@@ -46,17 +47,29 @@ public:
 
   static std::string ID()
   {
-    static const std::string DUMMY;
-    return DUMMY;
+    static const std::string MY_SKETCH_CONSTRAINT_ID = "SketchConstraint";
+    return MY_SKETCH_CONSTRAINT_ID;
   }
   virtual std::string getID() { return ID(); }
 
   SKETCHAPI_EXPORT
   bool initialize();
 
+  SKETCHAPI_EXPORT void setEntityA(const ModelHighAPI_RefAttr& theEntity);
+  SKETCHAPI_EXPORT void setEntityB(const ModelHighAPI_RefAttr& theEntity);
+  SKETCHAPI_EXPORT void setEntityC(const ModelHighAPI_RefAttr& theEntity);
+  SKETCHAPI_EXPORT void setEntityD(const ModelHighAPI_RefAttr& theEntity);
+
+  SKETCHAPI_EXPORT void setValue(const ModelHighAPI_Double& theValue);
+
   /// Dump wrapped feature
   SKETCHAPI_EXPORT
   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
+
+protected:
+  // Check all attributes of constraint are already dumped.
+  // If not, store the constraint as postponed.
+  bool areAllAttributesDumped(ModelHighAPI_Dumper& theDumper) const;
 };
 
 #endif