X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_Error.h;h=d97f818c30f10b863274aca2f2e884be31331d38;hb=88ee9b2b81cf93a6324336b57e30cc8a3a487499;hp=3623354b196aa582c6fb4233eb8825702e852a73;hpb=11573ab14113256d9e93228cd2310f78d08e2b4e;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Error.h b/src/SketchSolver/SketchSolver_Error.h index 3623354b1..d97f818c3 100644 --- a/src/SketchSolver/SketchSolver_Error.h +++ b/src/SketchSolver/SketchSolver_Error.h @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: SketchSolver_Error.h -// Created: 29 Mar 2015 -// Author: Artem ZHIDKOV +// Copyright (C) 2014-2022 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// 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 +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef SketchSolver_Error_H_ #define SketchSolver_Error_H_ @@ -20,13 +33,25 @@ class SketchSolver_Error /// The value parameter for the constraint inline static const std::string& CONSTRAINTS() { - static const std::string MY_ERROR_VALUE("Conflicting constraints"); + static const std::string MY_ERROR_VALUE("The constraint is conflicting with others. " + "To fix this, you can either undo (Ctrl+Z) your operation or " + "remove a conflicting constraint."); + return MY_ERROR_VALUE; + } + /// Cyclic dependency of copied features with their originals + inline static const std::string& INFINITE_LOOP() + { + static const std::string MY_ERROR_VALUE( + "There is a circular reference between copied sketch entities and their originals. " + "To fix this, you can either undo (Ctrl+Z) your operation or " + "remove wrong constraint."); return MY_ERROR_VALUE; } /// Constraints should use objects instead of features as attributes inline static const std::string& NEED_OBJECT_NOT_FEATURE() { - static const std::string MY_ERROR_VALUE("Constraint should be based on object instead of feature"); + static const std::string + MY_ERROR_VALUE("Constraint should be based on object instead of feature"); return MY_ERROR_VALUE; } /// The entities need to have shared point, but they have not @@ -59,6 +84,41 @@ class SketchSolver_Error static const std::string MY_ERROR_VALUE("Mirror constraint has wrong attributes"); return MY_ERROR_VALUE; } + /// Entity is already fixed + inline static const std::string& ALREADY_FIXED() + { + static const std::string MY_ERROR_VALUE("Entity already fixed"); + return MY_ERROR_VALUE; + } + /// Tangency constraint has been built with wrong attributes + /// (for example, line and arc have two coincident points) + inline static const std::string& TANGENCY_FAILED() + { + static const std::string + MY_ERROR_VALUE("Unable to create tangency constraint on given attributes"); + return MY_ERROR_VALUE; + } + /// Crash in SolveSpace + inline static const std::string& SOLVESPACE_CRASH() + { + static const std::string MY_ERROR_VALUE("Caution: SolveSpace crashed! Constraints are wrong"); + return MY_ERROR_VALUE; + } + /// Constraint has wrong type + inline static const std::string& WRONG_CONSTRAINT_TYPE() + { + static const std::string MY_ERROR_VALUE("Unsupported type of constraint"); + return MY_ERROR_VALUE; + } + /// Sketch contains degenerated geometry + inline static const std::string& DEGENERATED_GEOMETRY() + { + static const std::string MY_ERROR_VALUE( + "The set of constraints lead to degenerated geometry. " + "To fix this, you can either undo your operation or " + "remove a constraint or the degenerated geometry."); + return MY_ERROR_VALUE; + } }; #endif