Salome HOME
Delete key regression corrections: in previous implementation sketch entities did...
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Arc.cpp
index 17555b3d417825ba60eb82c00979c45ae797c976..261e70b9526613c849954c5af876529c1c585dfb 100644 (file)
@@ -29,12 +29,6 @@ const double paramTolerance = 1.e-4;
 const double PI =3.141592653589793238463;
 
 
-static const std::string& INVERSED_ID()
-{
-  static const std::string MY_INVERSED_ID("InversedArc");
-  return MY_INVERSED_ID;
-}
-
 SketchPlugin_Arc::SketchPlugin_Arc()
     : SketchPlugin_SketchEntity()
 {
@@ -47,10 +41,8 @@ SketchPlugin_Arc::SketchPlugin_Arc()
   myParamBefore = 0;
 }
 
-void SketchPlugin_Arc::initAttributes()
+void SketchPlugin_Arc::initDerivedClassAttributes()
 {
-  SketchPlugin_SketchEntity::initAttributes();
-
   data()->addAttribute(CENTER_ID(), GeomDataAPI_Point2D::typeId());
   data()->addAttribute(START_ID(), GeomDataAPI_Point2D::typeId());
   std::shared_ptr<GeomDataAPI_Point2D> anEndAttr = std::dynamic_pointer_cast<
@@ -325,3 +317,14 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID)
     myEndUpdate = false;
   }
 }
+
+void SketchPlugin_Arc::setReversed(bool isReversed)
+{
+  std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(attribute(INVERSED_ID()))->setValue(isReversed);
+  myParamBefore = 0.0;
+}
+
+bool SketchPlugin_Arc::isReversed()
+{
+  return std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(attribute(INVERSED_ID()))->value();
+}