Salome HOME
Main fix of this integration is in ConstraintRigid. The AIS should be created uncondi...
[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 #include "SketchPlugin_Feature.h"
10
11 #include <SketcherPrs_Factory.h>
12
13 #include <ModelAPI_ResultConstruction.h>
14 #include <Config_PropManager.h>
15
16 #include <GeomDataAPI_Point2D.h>
17 #include <GeomAlgoAPI_PointBuilder.h>
18
19 SketchPlugin_ConstraintRigid::SketchPlugin_ConstraintRigid()
20 {
21 }
22
23 void SketchPlugin_ConstraintRigid::initAttributes()
24 {
25   data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
26 }
27
28 void SketchPlugin_ConstraintRigid::execute()
29 {
30 }
31
32 AISObjectPtr SketchPlugin_ConstraintRigid::getAISObject(AISObjectPtr thePrevious)
33 {
34   if (!sketch())
35     return thePrevious;
36
37   AISObjectPtr anAIS = thePrevious;
38   if (anAIS.get() == NULL) {
39     anAIS = SketcherPrs_Factory::rigidConstraint(this, sketch()->coordinatePlane());
40   }
41
42   return anAIS;
43 }