1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_OperationSketch.h
4 // Created: 20 Apr 2014
5 // Author: Natalia ERMOLAEVA
7 #include <PartSet_OperationSketch.h>
8 #include <PartSet_Tools.h>
10 #include <SketchPlugin_Sketch.h>
11 #include <SketchPlugin_ConstraintLength.h>
13 #include <ModelAPI_Data.h>
14 #include <ModelAPI_AttributeDouble.h>
15 #include <ModelAPI_AttributeRefList.h>
16 #include <ModelAPI_Events.h>
18 #include <GeomAlgoAPI_FaceBuilder.h>
19 #include <GeomDataAPI_Point.h>
20 #include <GeomDataAPI_Dir.h>
21 #include <GeomAPI_XYZ.h>
23 #include <ModuleBase_ViewerPrs.h>
24 #include <ModuleBase_ISelection.h>
25 #include <ModuleBase_IViewer.h>
26 #include <Events_Loop.h>
32 #include <QMouseEvent>
36 PartSet_OperationSketch::PartSet_OperationSketch(const QString& theId, QObject* theParent)
37 : ModuleBase_Operation(theId, theParent)
41 PartSet_OperationSketch::~PartSet_OperationSketch()
45 bool PartSet_OperationSketch::isNestedOperationsEnabled() const
47 bool aHasSketchPlane = false;
49 std::shared_ptr<ModelAPI_Data> aData = feature()->data();
50 AttributeDoublePtr anAttr;
51 std::shared_ptr<GeomDataAPI_Dir> aNormal = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
52 aData->attribute(SketchPlugin_Sketch::NORM_ID()));
53 aHasSketchPlane = aNormal && !(aNormal->x() == 0 && aNormal->y() == 0 && aNormal->z() == 0);
55 return aHasSketchPlane;