1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketchSolver_Error.h
4 // Created: 29 Mar 2015
5 // Author: Artem ZHIDKOV
7 #ifndef SketchSolver_Error_H_
8 #define SketchSolver_Error_H_
12 /** \class SketchSolver_Error
14 * \brief Collects all sketch solver error' codes
15 * as inline static functions
17 class SketchSolver_Error
20 /// The value parameter for the constraint
21 inline static const std::string& CONSTRAINTS()
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;
27 /// Constraints should use objects instead of features as attributes
28 inline static const std::string& NEED_OBJECT_NOT_FEATURE()
30 static const std::string
31 MY_ERROR_VALUE("Constraint should be based on object instead of feature");
32 return MY_ERROR_VALUE;
34 /// The entities need to have shared point, but they have not
35 inline static const std::string& NO_COINCIDENT_POINTS()
37 static const std::string MY_ERROR_VALUE("Objects should have coincident point");
38 return MY_ERROR_VALUE;
40 /// Attribute of a feature is not initialized
41 inline static const std::string& NOT_INITIALIZED()
43 static const std::string MY_ERROR_VALUE("Attribute is not initialized");
44 return MY_ERROR_VALUE;
46 /// Constraint has wrong attributes
47 inline static const std::string& INCORRECT_ATTRIBUTE()
49 static const std::string MY_ERROR_VALUE("Incorrect attribute");
50 return MY_ERROR_VALUE;
52 /// Tangency constraint has wrong attributes
53 inline static const std::string& INCORRECT_TANGENCY_ATTRIBUTE()
55 static const std::string MY_ERROR_VALUE("An arc should be an attribute of tangency constraint");
56 return MY_ERROR_VALUE;
58 /// Mirror constraint has wrong attributes
59 inline static const std::string& INCORRECT_MIRROR_ATTRIBUTE()
61 static const std::string MY_ERROR_VALUE("Mirror constraint has wrong attributes");
62 return MY_ERROR_VALUE;
64 /// Entity is already fixed
65 inline static const std::string& ALREADY_FIXED()
67 static const std::string MY_ERROR_VALUE("Entity already fixed");
68 return MY_ERROR_VALUE;
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()
74 static const std::string
75 MY_ERROR_VALUE("Unable to create tangency constraint on given attributes");
76 return MY_ERROR_VALUE;
78 /// Crash in SolveSpace
79 inline static const std::string& SOLVESPACE_CRASH()
81 static const std::string MY_ERROR_VALUE("Caution: SolveSpace crash! Constraints are wrong");
82 return MY_ERROR_VALUE;