Salome HOME
Create SketcherPrs package
[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
12
13 AISObjectPtr SketcherPrs_Factory::coincidentConstraint(SketchPlugin_Constraint* theConstraint, 
14                                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane)
15 {
16   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
17   Handle(SketcherPrs_Coincident) aPrs = new SketcherPrs_Coincident(theConstraint, thePlane);
18   aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
19   return aAISObj;
20 }
21
22
23 AISObjectPtr SketcherPrs_Factory::parallelConstraint(SketchPlugin_Constraint* theConstraint, 
24                                                      const std::shared_ptr<GeomAPI_Ax3>& thePlane)
25 {
26   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
27   Handle(SketcherPrs_Parallel) aPrs = new SketcherPrs_Parallel(theConstraint, thePlane);
28   aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
29   return aAISObj;
30 }