1 // File: SketchPlugin_ConstraintParallel.h
2 // Created: 26 May 2014
3 // Author: Artem ZHIDKOV
5 #ifndef SketchPlugin_ConstraintParallel_HeaderFile
6 #define SketchPlugin_ConstraintParallel_HeaderFile
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Sketch.h>
10 #include "SketchPlugin_Constraint.h"
12 /** \class SketchPlugin_ConstraintParallel
14 * \brief Feature for creation of a new constraint parallelism of two lines
16 * These constraint has two attributes:
17 * SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
19 class SketchPlugin_ConstraintParallel: public SketchPlugin_Constraint
22 /// Parallel constraint kind
23 inline static const std::string& ID()
25 static const std::string MY_CONSTRAINT_PARALLEL_ID("SketchConstraintParallel");
26 return MY_CONSTRAINT_PARALLEL_ID;
28 /// \brief Returns the kind of a feature
29 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
30 {static std::string MY_KIND = SketchPlugin_ConstraintParallel::ID(); return MY_KIND;}
32 /// \brief Returns to which group in the document must be added feature
33 SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
34 {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
36 /// \brief Creates a new part document if needed
37 SKETCHPLUGIN_EXPORT virtual void execute();
39 /// \brief Request for initialization of data model of the feature: adding all attributes
40 SKETCHPLUGIN_EXPORT virtual void initAttributes();
42 /// \brief Returns the sketch preview
43 SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
45 /// Returns the AIS preview
46 SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
47 boost::shared_ptr<GeomAPI_AISObject> thePrevious);
50 /// \param theDeltaX the delta for X coordinate is moved
51 /// \param theDeltaY the delta for Y coordinate is moved
52 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
54 /// \brief Use plugin manager for features creation
55 SketchPlugin_ConstraintParallel();