]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketcherPrs/SketcherPrs_Factory.cpp
Salome HOME
187b94dce89024a05296b8cb6a556935db012c02
[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 #include <SketcherPrs_Rigid.h>
13
14
15 AISObjectPtr SketcherPrs_Factory::coincidentConstraint(SketchPlugin_Constraint* theConstraint, 
16                                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane)
17 {
18   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
19   Handle(SketcherPrs_Coincident) aPrs = new SketcherPrs_Coincident(theConstraint, thePlane);
20   aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
21   return aAISObj;
22 }
23
24
25 AISObjectPtr SketcherPrs_Factory::parallelConstraint(SketchPlugin_Constraint* theConstraint, 
26                                                      const std::shared_ptr<GeomAPI_Ax3>& thePlane)
27 {
28   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
29   Handle(SketcherPrs_Parallel) aPrs = new SketcherPrs_Parallel(theConstraint, thePlane);
30   aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
31   return aAISObj;
32 }
33
34 AISObjectPtr SketcherPrs_Factory::perpendicularConstraint(SketchPlugin_Constraint* theConstraint, 
35                                                      const std::shared_ptr<GeomAPI_Ax3>& thePlane)
36 {
37   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
38   Handle(SketcherPrs_Perpendicular) aPrs = new SketcherPrs_Perpendicular(theConstraint, thePlane);
39   aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
40   return aAISObj;
41 }
42
43 AISObjectPtr SketcherPrs_Factory::rigidConstraint(SketchPlugin_Constraint* theConstraint, 
44                                                      const std::shared_ptr<GeomAPI_Ax3>& thePlane)
45 {
46   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
47   Handle(SketcherPrs_Rigid) aPrs = new SketcherPrs_Rigid(theConstraint, thePlane);
48   aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
49   return aAISObj;
50 }