Salome HOME
Added interfaces to OCC data and algos: features must not depend on OCC
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Sketch.cpp
1 // File:        SketchPlugin_Sketch.cxx
2 // Created:     27 Mar 2014
3 // Author:      Mikhail PONIKAROV
4
5 #include "SketchPlugin_Sketch.h"
6 #include <ModelAPI_Data.h>
7 #include <GeomAlgoAPI_FaceBuilder.h>
8
9 using namespace std;
10
11 // face of the square-face displayed for selection of general plane
12 const double PLANE_SIZE = 200;
13
14 SketchPlugin_Sketch::SketchPlugin_Sketch()
15 {
16 }
17
18 void SketchPlugin_Sketch::initAttributes()
19 {
20   //data()->addAttribute(PART_ATTR_DOC_REF, ModelAPI_AttributeDocRef::type());
21 }
22
23 void SketchPlugin_Sketch::execute() 
24 {
25 }
26
27 const shared_ptr<GeomAPI_Shape>& SketchPlugin_Sketch::preview()
28 {
29   if (!SketchPlugin_Feature::preview())
30   {
31
32     shared_ptr<GeomAPI_Pnt> anOrigin(new GeomAPI_Pnt(0, 0, 0));
33     shared_ptr<GeomAPI_Dir> aNormal(new GeomAPI_Dir(1, 0, 0));
34     shared_ptr<GeomAPI_Shape> aFace = 
35       GeomAlgoAPI_FaceBuilder::square(anOrigin, aNormal, PLANE_SIZE);
36     setPreview(aFace);
37   }
38   return SketchPlugin_Feature::preview();
39 }