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 /// Cyclic dependency of copied features with their originals
28 inline static const std::string& INFINITE_LOOP()
30 static const std::string MY_ERROR_VALUE(
31 "There is a circular reference between copied sketch entities and their originals. "
32 "To fix this, you can either undo your operation or remove wrong constraint.");
33 return MY_ERROR_VALUE;
35 /// Constraints should use objects instead of features as attributes
36 inline static const std::string& NEED_OBJECT_NOT_FEATURE()
38 static const std::string
39 MY_ERROR_VALUE("Constraint should be based on object instead of feature");
40 return MY_ERROR_VALUE;
42 /// The entities need to have shared point, but they have not
43 inline static const std::string& NO_COINCIDENT_POINTS()
45 static const std::string MY_ERROR_VALUE("Objects should have coincident point");
46 return MY_ERROR_VALUE;
48 /// Attribute of a feature is not initialized
49 inline static const std::string& NOT_INITIALIZED()
51 static const std::string MY_ERROR_VALUE("Attribute is not initialized");
52 return MY_ERROR_VALUE;
54 /// Constraint has wrong attributes
55 inline static const std::string& INCORRECT_ATTRIBUTE()
57 static const std::string MY_ERROR_VALUE("Incorrect attribute");
58 return MY_ERROR_VALUE;
60 /// Tangency constraint has wrong attributes
61 inline static const std::string& INCORRECT_TANGENCY_ATTRIBUTE()
63 static const std::string MY_ERROR_VALUE("An arc should be an attribute of tangency constraint");
64 return MY_ERROR_VALUE;
66 /// Mirror constraint has wrong attributes
67 inline static const std::string& INCORRECT_MIRROR_ATTRIBUTE()
69 static const std::string MY_ERROR_VALUE("Mirror constraint has wrong attributes");
70 return MY_ERROR_VALUE;
72 /// Entity is already fixed
73 inline static const std::string& ALREADY_FIXED()
75 static const std::string MY_ERROR_VALUE("Entity already fixed");
76 return MY_ERROR_VALUE;
78 /// Tangency constraint has been built with wrong attributes
79 /// (for example, line and arc have two coincident points)
80 inline static const std::string& TANGENCY_FAILED()
82 static const std::string
83 MY_ERROR_VALUE("Unable to create tangency constraint on given attributes");
84 return MY_ERROR_VALUE;
86 /// Crash in SolveSpace
87 inline static const std::string& SOLVESPACE_CRASH()
89 static const std::string MY_ERROR_VALUE("Caution: SolveSpace crash! Constraints are wrong");
90 return MY_ERROR_VALUE;