Salome HOME
Perpendicular constraint presentation created
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Factory.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        SketcherPrs_Factory.cpp
4 // Created:     13 February 2015
5 // Author:      Vitaly SMETANNIKOV
6
7 #include "SketcherPrs_Factory.h"
8
9 #include <SketcherPrs_Coincident.h>
10 #include <SketcherPrs_Parallel.h>
11 #include <SketcherPrs_Perpendicular.h>
12
13
14 AISObjectPtr SketcherPrs_Factory::coincidentConstraint(SketchPlugin_Constraint* theConstraint, 
15                                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane)
16 {
17   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
18   Handle(SketcherPrs_Coincident) aPrs = new SketcherPrs_Coincident(theConstraint, thePlane);
19   aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
20   return aAISObj;
21 }
22
23
24 AISObjectPtr SketcherPrs_Factory::parallelConstraint(SketchPlugin_Constraint* theConstraint, 
25                                                      const std::shared_ptr<GeomAPI_Ax3>& thePlane)
26 {
27   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
28   Handle(SketcherPrs_Parallel) aPrs = new SketcherPrs_Parallel(theConstraint, thePlane);
29   aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
30   return aAISObj;
31 }
32
33 AISObjectPtr SketcherPrs_Factory::perpendicularConstraint(SketchPlugin_Constraint* theConstraint, 
34                                                      const std::shared_ptr<GeomAPI_Ax3>& thePlane)
35 {
36   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
37   Handle(SketcherPrs_Perpendicular) aPrs = new SketcherPrs_Perpendicular(theConstraint, thePlane);
38   aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
39   return aAISObj;
40 }