1 // File: PartSet_OperationSketch.h
2 // Created: 20 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #include <PartSet_OperationSketch.h>
7 #include <SketchPlugin_Feature.h>
8 #include <ModelAPI_Data.h>
9 #include <ModelAPI_AttributeDocRef.h>
11 #include <AIS_Shape.hxx>
12 #include <AIS_ListOfInteractive.hxx>
20 PartSet_OperationSketch::PartSet_OperationSketch(const QString& theId,
22 : PartSet_OperationSketchBase(theId, theParent)
26 PartSet_OperationSketch::~PartSet_OperationSketch()
30 bool PartSet_OperationSketch::isPerformedImmediately() const
35 int PartSet_OperationSketch::getSelectionMode() const
40 void PartSet_OperationSketch::setSelectedObjects(const AIS_ListOfInteractive& theList)
42 if (theList.IsEmpty())
45 // 1. get selected fase
46 Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast(theList.First());
47 if (anAISShape.IsNull())
50 const TopoDS_Shape& aShape = anAISShape->Shape();
51 boost::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
52 aRes->setImpl(new TopoDS_Shape(aShape));
54 // get plane parameters
55 double anX = 1, anY = 0, aZ = 0, anOrigin = 0;
57 // set plane parameters to feature
58 //boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
59 //boost::shared_ptr<ModelAPI_AttributeDocRef> anAttr = aData->docRef(SKETCH_ATTR_X);
60 //anAttr->setValue(anX);