Salome HOME
Fixes and unit-tests basing on the manual tests
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintEqual.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef SketchPlugin_ConstraintEqual_H_
22 #define SketchPlugin_ConstraintEqual_H_
23
24 #include "SketchPlugin.h"
25 #include <SketchPlugin_Sketch.h>
26 #include "SketchPlugin_ConstraintBase.h"
27
28 /** \class SketchPlugin_ConstraintEqual
29  *  \ingroup Plugins
30  *  \brief Feature for creation of a new constraint specifying equality of lengths of two lines
31  *         or equality of radii of two circular arcs (full circles)
32  *
33  *  This constraint has two attributes:
34  *  SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
35  */
36 class SketchPlugin_ConstraintEqual : public SketchPlugin_ConstraintBase
37 {
38  public:
39   /// Equal constraint kind
40   inline static const std::string& ID()
41   {
42     static const std::string MY_CONSTRAINT_EQUAL_ID("SketchConstraintEqual");
43     return MY_CONSTRAINT_EQUAL_ID;
44   }
45   /// \brief Returns the kind of a feature
46   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
47   {
48     static std::string MY_KIND = SketchPlugin_ConstraintEqual::ID();
49     return MY_KIND;
50   }
51
52   /// \brief Creates a new part document if needed
53   SKETCHPLUGIN_EXPORT virtual void execute();
54
55   /// \brief Request for initialization of data model of the feature: adding all attributes
56   SKETCHPLUGIN_EXPORT virtual void initAttributes();
57
58   /// Returns the AIS preview
59   SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
60
61   /// \brief Use plugin manager for features creation
62   SketchPlugin_ConstraintEqual();
63 };
64
65 #endif