#include <PartSet_OperationSketchBase.h>
#include <SketchPlugin_Feature.h>
-#include <ModelAPI_Object.h>
#include <V3d_View.hxx>
+#include <QKeyEvent>
+
#ifdef _DEBUG
#include <QDebug>
#endif
}
boost::shared_ptr<GeomAPI_Shape> PartSet_OperationSketchBase::preview(
- boost::shared_ptr<ModelAPI_Feature> theFeature) const
+ FeaturePtr theFeature)
{
boost::shared_ptr<SketchPlugin_Feature> aFeature =
boost::dynamic_pointer_cast<SketchPlugin_Feature>(theFeature);
- if (!aFeature) { // if it is reference to a object feature
- boost::shared_ptr<ModelAPI_Object> anObj =
- boost::dynamic_pointer_cast<ModelAPI_Object>(theFeature);
- if (anObj)
- aFeature = boost::dynamic_pointer_cast<SketchPlugin_Feature>(anObj->featureRef());
- }
if (!aFeature)
return boost::shared_ptr<GeomAPI_Shape>();
return aFeature->preview();
}
-std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
+std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >
PartSet_OperationSketchBase::subPreview() const
{
- return std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >();
+ return std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >();
}
-std::list<int> PartSet_OperationSketchBase::getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const
+std::list<int> PartSet_OperationSketchBase::getSelectionModes(FeaturePtr theFeature) const
{
std::list<int> aModes;
aModes.push_back(TopAbs_VERTEX);
aModes.push_back(TopAbs_EDGE);
return aModes;
}
-boost::shared_ptr<ModelAPI_Feature> PartSet_OperationSketchBase::createFeature(const bool theFlushMessage)
+FeaturePtr PartSet_OperationSketchBase::createFeature(const bool theFlushMessage)
{
- boost::shared_ptr<ModelAPI_Feature> aFeature = ModuleBase_Operation::createFeature(theFlushMessage);
+ FeaturePtr aFeature = ModuleBase_Operation::createFeature(theFlushMessage);
if (aFeature)
emit featureConstructed(aFeature, FM_Activation);
return aFeature;
break;
}
}
+
+void PartSet_OperationSketchBase::keyReleased(std::string theName, QKeyEvent* theEvent)
+{
+ keyReleased(theEvent->key());
+}
+
+void PartSet_OperationSketchBase::restartOperation(const std::string& theType,
+ FeaturePtr theFeature)
+{
+ emit launchOperation(theType, theFeature);
+}