1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchPlugin_ConstraintMirror.h
4 // Created: 17 Mar 2015
5 // Author: Artem ZHIDKOV
7 #ifndef SketchPlugin_ConstraintMirror_H_
8 #define SketchPlugin_ConstraintMirror_H_
10 #include "SketchPlugin.h"
11 #include <SketchPlugin_Sketch.h>
12 #include "SketchPlugin_ConstraintBase.h"
14 /** \class SketchPlugin_ConstraintMirror
16 * \brief Feature for creation of a new constraint mirroring a list of objects regarding to a given line
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
22 * Also the constraint has attribute SketchPlugin_Constraint::ENTITY_C()
23 * which contains list of mirrored objects
25 class SketchPlugin_ConstraintMirror : public SketchPlugin_ConstraintBase
28 /// Mirror constraint kind
29 inline static const std::string& ID()
31 static const std::string MY_CONSTRAINT_MIRROR_ID("SketchConstraintMirror");
32 return MY_CONSTRAINT_MIRROR_ID;
34 /// \brief Returns the kind of a feature
35 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
37 static std::string MY_KIND = SketchPlugin_ConstraintMirror::ID();
41 /// List of objects to be mirrored
42 inline static const std::string& MIRROR_LIST_ID()
44 static const std::string MY_MIRROR_LIST_ID("ConstraintMirrorList");
45 return MY_MIRROR_LIST_ID;
48 /// \brief Creates a new part document if needed
49 SKETCHPLUGIN_EXPORT virtual void execute();
51 /// \brief Request for initialization of data model of the feature: adding all attributes
52 SKETCHPLUGIN_EXPORT virtual void initAttributes();
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);
58 /// Returns the AIS preview
59 SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
61 /// removes all fields from this feature: results, data, etc
62 SKETCHPLUGIN_EXPORT virtual void erase();
64 /// \brief Use plugin manager for features creation
65 SketchPlugin_ConstraintMirror();