]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/SketchPlugin_ConstraintEqual.cpp
Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintEqual.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:    SketchPlugin_ConstraintEqual.cpp
4 // Created: 16 Mar 2015
5 // Author:  Artem ZHIDKOV
6
7 #include "SketchPlugin_ConstraintEqual.h"
8
9 #include <ModelAPI_AttributeDouble.h>
10 #include <ModelAPI_Data.h>
11 #include <ModelAPI_ResultConstruction.h>
12
13 #include <SketchPlugin_Line.h>
14 #include <SketchPlugin_Sketch.h>
15
16 #include <SketcherPrs_Factory.h>
17
18 #include <Config_PropManager.h>
19
20 SketchPlugin_ConstraintEqual::SketchPlugin_ConstraintEqual()
21 {
22 }
23
24 void SketchPlugin_ConstraintEqual::initAttributes()
25 {
26   data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
27   data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
28 }
29
30 void SketchPlugin_ConstraintEqual::execute()
31 {
32 }
33
34 AISObjectPtr SketchPlugin_ConstraintEqual::getAISObject(AISObjectPtr thePrevious)
35 {
36   if (!sketch())
37     return thePrevious;
38
39   AISObjectPtr anAIS = thePrevious;
40   if (!anAIS) {
41     anAIS = SketcherPrs_Factory::equalConstraint(this, sketch()->coordinatePlane());
42   }
43   return anAIS;
44 }
45
46