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