Salome HOME
Issue #2431 - remove application exit from unit tests
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintRigid.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_ConstraintRigid_H_
22 #define SketchPlugin_ConstraintRigid_H_
23
24 #include "SketchPlugin.h"
25 #include "SketchPlugin_ConstraintBase.h"
26 #include <SketchPlugin_Sketch.h>
27 #include <list>
28
29 /** \class SketchPlugin_ConstraintRigid
30  *  \ingroup Plugins
31  *  \brief Feature for creation of a new constraint which defines immovable object
32  *
33  *  This constraint has one attribute:
34  *  SketchPlugin_Constraint::ENTITY_A() (any object, i.e. point, line, circle, arc)
35  */
36 class SketchPlugin_ConstraintRigid : public SketchPlugin_ConstraintBase
37 {
38  public:
39   /// Length constraint kind
40   inline static const std::string& ID()
41   {
42     static const std::string MY_CONSTRAINT_RIGID_ID("SketchConstraintRigid");
43     return MY_CONSTRAINT_RIGID_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_ConstraintRigid::ID();
49     return MY_KIND;
50   }
51
52   /// Returns the AIS preview
53   SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
54
55   /// \brief Creates a new part document if needed
56   SKETCHPLUGIN_EXPORT virtual void execute();
57
58   /// \brief Request for initialization of data model of the feature: adding all attributes
59   SKETCHPLUGIN_EXPORT virtual void initAttributes();
60
61   /// \brief Use plugin manager for features creation
62   SketchPlugin_ConstraintRigid();
63 };
64
65 #endif