1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketcherPrs_Factory.cpp
4 // Created: 13 February 2015
5 // Author: Vitaly SMETANNIKOV
7 #include "SketcherPrs_Factory.h"
9 #include <SketcherPrs_Coincident.h>
10 #include <SketcherPrs_Parallel.h>
11 #include <SketcherPrs_Perpendicular.h>
12 #include <SketcherPrs_Rigid.h>
14 #define CONSTRAINT_PRS_IMPL(NAME, CLASS) \
15 AISObjectPtr SketcherPrs_Factory::NAME(SketchPlugin_Constraint* theConstraint, \
16 const std::shared_ptr<GeomAPI_Ax3>& thePlane) \
18 std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject()); \
19 Handle(CLASS) aPrs = new CLASS(theConstraint, thePlane); \
20 aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs)); \
24 CONSTRAINT_PRS_IMPL(coincidentConstraint, SketcherPrs_Coincident);
25 CONSTRAINT_PRS_IMPL(parallelConstraint, SketcherPrs_Parallel);
26 CONSTRAINT_PRS_IMPL(perpendicularConstraint, SketcherPrs_Perpendicular);
27 CONSTRAINT_PRS_IMPL(rigidConstraint, SketcherPrs_Rigid)