#include <ModelAPI_ResultBody.h>
#include <ModuleBase_IPropertyPanel.h>
+#include <ModuleBase_IViewer.h>
#include <ModuleBase_ModelWidget.h>
#include <ModuleBase_WidgetValueFeature.h>
{
}
-boost::shared_ptr<GeomAPI_Shape> PartSet_OperationSketchBase::preview(FeaturePtr theFeature)
+std::shared_ptr<GeomAPI_Shape> PartSet_OperationSketchBase::preview(FeaturePtr theFeature)
{
- boost::shared_ptr<SketchPlugin_Feature> aFeature = boost::dynamic_pointer_cast<
+ std::shared_ptr<SketchPlugin_Feature> aFeature = std::dynamic_pointer_cast<
SketchPlugin_Feature>(theFeature);
if (aFeature) {
ResultPtr aRes = aFeature->firstResult();
- ResultBodyPtr aBody = boost::dynamic_pointer_cast<ModelAPI_ResultBody>(aRes);
+ ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aRes);
if (aBody)
return aBody->shape();
}
- return boost::shared_ptr<GeomAPI_Shape>();
+ return std::shared_ptr<GeomAPI_Shape>();
}
std::list<FeaturePtr> PartSet_OperationSketchBase::subFeatures() const
return std::list<FeaturePtr>();
}
-std::list<int> PartSet_OperationSketchBase::getSelectionModes(ObjectPtr theFeature) const
-{
- //TODO: Define position of selection modes definition
- std::list<int> aModes;
- FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(theFeature);
- if (aFeature && PartSet_Tools::isConstraintFeature(aFeature->getKind())) {
- aModes.push_back(AIS_DSM_Text);
- aModes.push_back(AIS_DSM_Line);
- } else {
- aModes.push_back(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_VERTEX));
- aModes.push_back(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_EDGE));
- }
- return aModes;
-}
FeaturePtr PartSet_OperationSketchBase::createFeature(const bool theFlushMessage)
{
ModuleBase_Operation::createFeature(theFlushMessage);
return myFeature;
}
-void PartSet_OperationSketchBase::mousePressed(
- QMouseEvent* theEvent, Handle_V3d_View theView,
- const std::list<ModuleBase_ViewerPrs>& theSelected,
- const std::list<ModuleBase_ViewerPrs>& theHighlighted)
+void PartSet_OperationSketchBase::mousePressed(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer, ModuleBase_ISelection* theSelection)
{
}
void PartSet_OperationSketchBase::mouseReleased(
- QMouseEvent* theEvent, Handle_V3d_View theView,
- const std::list<ModuleBase_ViewerPrs>& theSelected,
- const std::list<ModuleBase_ViewerPrs>& theHighlighted)
+ QMouseEvent* theEvent, ModuleBase_IViewer* theViewer,
+ ModuleBase_ISelection* theSelection)
{
}
-void PartSet_OperationSketchBase::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView)
+void PartSet_OperationSketchBase::mouseMoved(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer)
{
}
void PartSet_OperationSketchBase::mouseDoubleClick(
QMouseEvent* theEvent, Handle_V3d_View theView,
- const std::list<ModuleBase_ViewerPrs>& theSelected,
- const std::list<ModuleBase_ViewerPrs>& theHighlighted)
+ ModuleBase_ISelection* theSelection)
+{
+}
+
+void PartSet_OperationSketchBase::selectionChanged(ModuleBase_ISelection* theSelection)
{
}
}
-
-void PartSet_OperationSketchBase::activateByPreselection()
-{
- if (!myPropertyPanel)
- return;
- ModuleBase_ModelWidget* aActiveWgt = myPropertyPanel->activeWidget();
- if ((myPreSelection.size() > 0) && aActiveWgt) {
- const ModuleBase_ViewerPrs& aPrs = myPreSelection.front();
- ModuleBase_WidgetValueFeature aValue;
- aValue.setObject(aPrs.object());
- if (aActiveWgt->setValue(&aValue)) {
- myPreSelection.remove(aPrs);
- if(isValid()) {
- //myActiveWidget = NULL;
- commit();
- } else {
- myPropertyPanel->activateNextWidget();
- //emit activateNextWidget(myActiveWidget);
- }
- }
- // If preselection is enough to make a valid feature - apply it immediately
- }
-}