Salome HOME
Initial version of redesign of working with results
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintParallel.h
1 // File:    SketchPlugin_ConstraintParallel.h
2 // Created: 26 May 2014
3 // Author:  Artem ZHIDKOV
4
5 #ifndef SketchPlugin_ConstraintParallel_HeaderFile
6 #define SketchPlugin_ConstraintParallel_HeaderFile
7
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Sketch.h>
10 #include "SketchPlugin_Constraint.h"
11
12 /// Parallel constraint kind
13 const std::string SKETCH_CONSTRAINT_PARALLEL_KIND("SketchConstraintParallel");
14
15 /** \class SketchPlugin_ConstraintParallel
16  *  \ingroup DataModel
17  *  \brief Feature for creation of a new constraint parallelism of two lines
18  *
19  *  These constraint has two attributes:
20  *  CONSTRAINT_ATTR_ENTITY_A and CONSTRAINT_ATTR_ENTITY_B
21  */
22 class SketchPlugin_ConstraintParallel: public SketchPlugin_Constraint
23 {
24 public:
25   /// \brief Returns the kind of a feature
26   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
27   {static std::string MY_KIND = SKETCH_CONSTRAINT_PARALLEL_KIND; return MY_KIND;}
28
29   /// \brief Creates a new part document if needed
30   SKETCHPLUGIN_EXPORT virtual void execute(boost::shared_ptr<ModelAPI_Result>& theResult);
31
32   /// \brief Request for initialization of data model of the feature: adding all attributes
33   SKETCHPLUGIN_EXPORT virtual void initAttributes();
34
35   /// \brief Returns the sketch preview
36   SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
37
38   /// Returns the AIS preview
39   SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
40                                 boost::shared_ptr<GeomAPI_AISObject> thePrevious);
41
42   /// Moves the feature
43   /// \param theDeltaX the delta for X coordinate is moved
44   /// \param theDeltaY the delta for Y coordinate is moved
45   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
46
47   /// \brief Use plugin manager for features creation
48   SketchPlugin_ConstraintParallel();
49 };
50
51 #endif