Salome HOME
Merge branch 'master' of ssh://git.salome-platform.org/modules/shaper
[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. To fix this, you can either undo your operation or remove a conflicting constraint.");
24     return MY_ERROR_VALUE;
25   }
26   /// Constraints should use objects instead of features as attributes
27   inline static const std::string& NEED_OBJECT_NOT_FEATURE()
28   {
29     static const std::string MY_ERROR_VALUE("Constraint should be based on object instead of feature");
30     return MY_ERROR_VALUE;
31   }
32   /// The entities need to have shared point, but they have not
33   inline static const std::string& NO_COINCIDENT_POINTS()
34   {
35     static const std::string MY_ERROR_VALUE("Objects should have coincident point");
36     return MY_ERROR_VALUE;
37   }
38   /// Attribute of a feature is not initialized
39   inline static const std::string& NOT_INITIALIZED()
40   {
41     static const std::string MY_ERROR_VALUE("Attribute is not initialized");
42     return MY_ERROR_VALUE;
43   }
44   /// Constraint has wrong attributes
45   inline static const std::string& INCORRECT_ATTRIBUTE()
46   {
47     static const std::string MY_ERROR_VALUE("Incorrect attribute");
48     return MY_ERROR_VALUE;
49   }
50   /// Tangency constraint has wrong attributes
51   inline static const std::string& INCORRECT_TANGENCY_ATTRIBUTE()
52   {
53     static const std::string MY_ERROR_VALUE("An arc should be an attribute of tangency constraint");
54     return MY_ERROR_VALUE;
55   }
56   /// Mirror constraint has wrong attributes
57   inline static const std::string& INCORRECT_MIRROR_ATTRIBUTE()
58   {
59     static const std::string MY_ERROR_VALUE("Mirror constraint has wrong attributes");
60     return MY_ERROR_VALUE;
61   }
62   /// Entity is already fixed
63   inline static const std::string& ALREADY_FIXED()
64   {
65     static const std::string MY_ERROR_VALUE("Entity already fixed");
66     return MY_ERROR_VALUE;
67   }
68   /// Tangency constraint has been built with wrong attributes (for example, line and arc have two coincident points)
69   inline static const std::string& TANGENCY_FAILED()
70   {
71     static const std::string MY_ERROR_VALUE("Unable to create tangency constraint on given attributes");
72     return MY_ERROR_VALUE;
73   }
74   /// Crash in SolveSpace
75   inline static const std::string& SOLVESPACE_CRASH()
76   {
77     static const std::string MY_ERROR_VALUE("Caution: SolveSpace crash! Constraints are wrong");
78     return MY_ERROR_VALUE;
79   }
80 };
81
82 #endif