Salome HOME
Issue #1860: fix end lines with spaces
[modules/shaper.git] / src / SketchSolver / SketchSolver_Error.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SketchSolver_Error.h
4 // Created: 29 Mar 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchSolver_Error_H_
8 #define SketchSolver_Error_H_
9
10 #include <string>
11
12 /** \class SketchSolver_Error
13  *  \ingroup Plugins
14  *  \brief Collects all sketch solver error' codes
15  *         as inline static functions
16  */
17 class SketchSolver_Error
18 {
19  public:
20   /// The value parameter for the constraint
21   inline static const std::string& CONSTRAINTS()
22   {
23     static const std::string MY_ERROR_VALUE("The constraint is conflicting with others. "
24       "To fix this, you can either undo your operation or remove a conflicting constraint.");
25     return MY_ERROR_VALUE;
26   }
27   /// Constraints should use objects instead of features as attributes
28   inline static const std::string& NEED_OBJECT_NOT_FEATURE()
29   {
30     static const std::string
31       MY_ERROR_VALUE("Constraint should be based on object instead of feature");
32     return MY_ERROR_VALUE;
33   }
34   /// The entities need to have shared point, but they have not
35   inline static const std::string& NO_COINCIDENT_POINTS()
36   {
37     static const std::string MY_ERROR_VALUE("Objects should have coincident point");
38     return MY_ERROR_VALUE;
39   }
40   /// Attribute of a feature is not initialized
41   inline static const std::string& NOT_INITIALIZED()
42   {
43     static const std::string MY_ERROR_VALUE("Attribute is not initialized");
44     return MY_ERROR_VALUE;
45   }
46   /// Constraint has wrong attributes
47   inline static const std::string& INCORRECT_ATTRIBUTE()
48   {
49     static const std::string MY_ERROR_VALUE("Incorrect attribute");
50     return MY_ERROR_VALUE;
51   }
52   /// Tangency constraint has wrong attributes
53   inline static const std::string& INCORRECT_TANGENCY_ATTRIBUTE()
54   {
55     static const std::string MY_ERROR_VALUE("An arc should be an attribute of tangency constraint");
56     return MY_ERROR_VALUE;
57   }
58   /// Mirror constraint has wrong attributes
59   inline static const std::string& INCORRECT_MIRROR_ATTRIBUTE()
60   {
61     static const std::string MY_ERROR_VALUE("Mirror constraint has wrong attributes");
62     return MY_ERROR_VALUE;
63   }
64   /// Entity is already fixed
65   inline static const std::string& ALREADY_FIXED()
66   {
67     static const std::string MY_ERROR_VALUE("Entity already fixed");
68     return MY_ERROR_VALUE;
69   }
70   /// Tangency constraint has been built with wrong attributes
71   /// (for example, line and arc have two coincident points)
72   inline static const std::string& TANGENCY_FAILED()
73   {
74     static const std::string
75       MY_ERROR_VALUE("Unable to create tangency constraint on given attributes");
76     return MY_ERROR_VALUE;
77   }
78   /// Crash in SolveSpace
79   inline static const std::string& SOLVESPACE_CRASH()
80   {
81     static const std::string MY_ERROR_VALUE("Caution: SolveSpace crash! Constraints are wrong");
82     return MY_ERROR_VALUE;
83   }
84 };
85
86 #endif