Salome HOME
Symbols for translation/rotation are created
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Factory.cpp
index 39ce4d6e0ce01385eba019c200cec8431ea4c742..b855929ab16f7513ffb86b1fe71fd7761c31a492 100644 (file)
@@ -16,6 +16,7 @@
 #include "SketcherPrs_Radius.h"
 #include "SketcherPrs_LengthDimension.h"
 #include "SketcherPrs_Mirror.h"
+#include "SketcherPrs_Transformation.h"
 
 #define CONSTRAINT_PRS_IMPL(NAME, CLASS) \
 AISObjectPtr SketcherPrs_Factory::NAME(ModelAPI_Feature* theConstraint, \
@@ -55,3 +56,21 @@ AISObjectPtr SketcherPrs_Factory::verticalConstraint(ModelAPI_Feature* theConstr
   aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs)); 
   return aAISObj; 
 }
+
+AISObjectPtr SketcherPrs_Factory::translateConstraint(ModelAPI_Feature* theConstraint,
+                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane)
+{ 
+  std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject()); 
+  Handle(SketcherPrs_Transformation) aPrs = new SketcherPrs_Transformation(theConstraint, thePlane, true); 
+  aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs)); 
+  return aAISObj; 
+}
+
+AISObjectPtr SketcherPrs_Factory::rotateConstraint(ModelAPI_Feature* theConstraint,
+                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane)
+{ 
+  std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject()); 
+  Handle(SketcherPrs_Transformation) aPrs = new SketcherPrs_Transformation(theConstraint, thePlane, false); 
+  aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs)); 
+  return aAISObj; 
+}