Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Circle.cpp
index 5438c216de51425caa7ee45c6d9671a92e709aae..60fd29daf7d9cf6714576c5d08aa4f5cf68af642 100644 (file)
@@ -5,16 +5,14 @@
 #include "SketchPlugin_Circle.h"
 #include "SketchPlugin_Sketch.h"
 #include <ModelAPI_Data.h>
+#include <ModelAPI_ResultConstruction.h>
 
 #include <GeomAPI_Pnt2d.h>
-
 #include <GeomDataAPI_Point2D.h>
 #include <GeomDataAPI_Dir.h>
-
 #include <GeomAlgoAPI_PointBuilder.h>
 #include <GeomAlgoAPI_EdgeBuilder.h>
 #include <GeomAlgoAPI_CompoundBuilder.h>
-
 #include <ModelAPI_AttributeDouble.h>
 
 SketchPlugin_Circle::SketchPlugin_Circle()
@@ -29,10 +27,6 @@ void SketchPlugin_Circle::initAttributes()
 }
 
 void SketchPlugin_Circle::execute()
-{
-}
-
-const boost::shared_ptr<GeomAPI_Shape>& SketchPlugin_Circle::preview()
 {
   SketchPlugin_Sketch* aSketch = sketch();
   if (aSketch) {
@@ -64,15 +58,12 @@ const boost::shared_ptr<GeomAPI_Shape>& SketchPlugin_Circle::preview()
       }
     }
     boost::shared_ptr<GeomAPI_Shape> aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes);
-    setPreview(aCompound);
+      // store the result
+      boost::shared_ptr<ModelAPI_ResultConstruction> aConstr = 
+        document()->createConstruction(data());
+      aConstr->setShape(aCompound);
+      setResult(aConstr);
   }
-  return getPreview();
-}
-
-boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_Circle::getAISObject(
-                                boost::shared_ptr<GeomAPI_AISObject> thePrevious)
-{
-  return prepareAISShape(thePrevious);
 }
 
 void SketchPlugin_Circle::move(double theDeltaX, double theDeltaY)