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