Salome HOME
Improvement #1140: Display of replicated Sketch entities with thinner line
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintMirror.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:    SketchPlugin_ConstraintMirror.h
4 // Created: 17 Mar 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchPlugin_ConstraintMirror_H_
8 #define SketchPlugin_ConstraintMirror_H_
9
10 #include "SketchPlugin.h"
11 #include <SketchPlugin_Sketch.h>
12 #include "SketchPlugin_ConstraintBase.h"
13
14 /** \class SketchPlugin_ConstraintMirror
15  *  \ingroup Plugins
16  *  \brief Feature for creation of a new constraint mirroring a list of objects regarding to a given line
17  *
18  *  This constraint has two attributes:
19  *  SketchPlugin_Constraint::ENTITY_A() for mirror line and
20  *  SketchPlugin_Constraint::ENTITY_B() for the list of objects
21  *
22  *  Also the constraint has attribute SketchPlugin_Constraint::ENTITY_C()
23  *  which contains list of mirrored objects
24  */
25 class SketchPlugin_ConstraintMirror : public SketchPlugin_ConstraintBase
26 {
27  public:
28   /// Mirror constraint kind
29   inline static const std::string& ID()
30   {
31     static const std::string MY_CONSTRAINT_MIRROR_ID("SketchConstraintMirror");
32     return MY_CONSTRAINT_MIRROR_ID;
33   }
34   /// \brief Returns the kind of a feature
35   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
36   {
37     static std::string MY_KIND = SketchPlugin_ConstraintMirror::ID();
38     return MY_KIND;
39   }
40
41   /// List of objects to be mirrored
42   inline static const std::string& MIRROR_LIST_ID()
43   {
44     static const std::string MY_MIRROR_LIST_ID("ConstraintMirrorList");
45     return MY_MIRROR_LIST_ID;
46   }
47
48   /// \brief Creates a new part document if needed
49   SKETCHPLUGIN_EXPORT virtual void execute();
50
51   /// \brief Request for initialization of data model of the feature: adding all attributes
52   SKETCHPLUGIN_EXPORT virtual void initAttributes();
53
54   /// Called on change of any argument-attribute of this object
55   /// \param theID identifier of changed attribute
56   SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
57
58   /// Returns the AIS preview
59   SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
60
61   /// removes all fields from this feature: results, data, etc
62   SKETCHPLUGIN_EXPORT virtual void erase();
63
64   /// \brief Use plugin manager for features creation
65   SketchPlugin_ConstraintMirror();
66 };
67
68 #endif