]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/SketchPlugin_ConstraintBase.h
Salome HOME
bugfix for libSketchSolver.so: removing unresolved symbols from the SketchPlugin
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintBase.h
1 // File:    SketchPlugin_ConstraintBase.h
2 // Created: 08 May 2014
3 // Author:  Artem ZHIDKOV
4
5 #ifndef SketchPlugin_ConstraintBase_H_
6 #define SketchPlugin_ConstraintBase_H_
7
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Constraint.h>
10 #include <SketchPlugin_Sketch.h>
11 #include <ModelAPI_AttributeReference.h>
12 #include <ModelAPI_AttributeRefAttr.h>
13
14 #include <GeomAPI_IPresentable.h>
15
16 #include <list>
17
18
19 /*  Description: 
20  *    Each constraint uses a set of parameters. In the SolveSpace library 
21  *    these parameters are named "valA", "ptA", "ptB", "entityA", "entityB". 
22  *    The "ptA" and "ptB" parameters represents a point in the constraint.
23  *    The "entityA" and "entityB" represents any other object (and a point too).
24  *    And the "valA" represents a real value.
25  *
26  *    The attributes below are named independent of the SolveSpace.
27  *    Some of them may be unused. 
28  *
29  *    Also the list of possible attributes is provided to simplify assignment.
30  */
31
32 /** \class SketchPlugin_ConstraintBase
33  *  \ingroup DataModel
34  *  \brief Feature for creation of a new constraint between other features.
35  *         Some feature's methods implemented here as dummy to
36  *         Base class for all constraints.
37  */
38 class SketchPlugin_ConstraintBase: public SketchPlugin_Constraint,
39                                    public GeomAPI_IPresentable
40 {
41 public:
42   /// Returns the AIS preview
43   SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
44
45   /** \brief Adds sub-feature of the higher level feature (sub-element of the sketch)
46    *  \param theFeature sub-feature
47    */
48   SKETCHPLUGIN_EXPORT virtual const void addSub(const FeaturePtr& theFeature);
49   /// Moves the feature
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);
53
54   /// Return the distance between the feature and the point
55   /// \param thePoint the point
56   virtual double distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint);
57
58 protected:
59   /// \brief Use plugin manager for features creation
60   SketchPlugin_ConstraintBase() {}
61 };
62
63 #endif