1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchPlugin_ConstraintParallel.h
4 // Created: 26 May 2014
5 // Author: Artem ZHIDKOV
7 #ifndef SketchPlugin_ConstraintParallel_H_
8 #define SketchPlugin_ConstraintParallel_H_
10 #include "SketchPlugin.h"
11 #include <SketchPlugin_Sketch.h>
12 #include "SketchPlugin_ConstraintBase.h"
14 #define PARALLEL_COLOR "#ffff00"
16 /** \class SketchPlugin_ConstraintParallel
18 * \brief Feature for creation of a new constraint parallelism of two lines
20 * This constraint has two attributes:
21 * SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
23 class SketchPlugin_ConstraintParallel : public SketchPlugin_ConstraintBase
26 /// Parallel constraint kind
27 inline static const std::string& ID()
29 static const std::string MY_CONSTRAINT_PARALLEL_ID("SketchConstraintParallel");
30 return MY_CONSTRAINT_PARALLEL_ID;
32 /// \brief Returns the kind of a feature
33 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
35 static std::string MY_KIND = SketchPlugin_ConstraintParallel::ID();
39 /// \brief Creates a new part document if needed
40 SKETCHPLUGIN_EXPORT virtual void execute();
42 /// \brief Request for initialization of data model of the feature: adding all attributes
43 SKETCHPLUGIN_EXPORT virtual void initAttributes();
45 /// Returns the AIS preview
46 SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
49 /// \param theDeltaX the delta for X coordinate is moved
50 /// \param theDeltaY the delta for Y coordinate is moved
51 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
53 /// \brief Use plugin manager for features creation
54 SketchPlugin_ConstraintParallel();