void PartSet_Module::addViewerItems(QMenu* theMenu) const
{
- if (isSketchOperationActive()) {
+ if (isSketchOperationActive() || isSketchFeatureOperationActive()) {
ModuleBase_ISelection* aSelection = myWorkshop->selection();
QObjectPtrList aObjects = aSelection->selectedPresentations();
if (aObjects.size() > 0) {
void PartSet_Module::onOperationActivatedByPreselection()
{
ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
- if(aOperation && isSketchOperationActive()) {
+ if(aOperation && isSketchFeatureOperationActive()) {
// Set final definitions if they are necessary
//propertyPanelDefined(aOperation);
void PartSet_Module::onNoMoreWidgets()
{
- if (isSketchOperationActive()) {
+ if (isSketchFeatureOperationActive()) {
ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
if (aOperation) {
if (myRestartingMode != RM_Forbided)
}
bool PartSet_Module::isSketchOperationActive() const
+{
+ ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
+
+ bool isSketchOp = aOperation && aOperation->id().toStdString() == SketchPlugin_Sketch::ID();
+ return isSketchOp;
+}
+
+bool PartSet_Module::isSketchFeatureOperationActive() const
{
bool isCurrentSketchOp = false;
ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
void PartSet_Module::deleteObjects()
{
- if (!isSketchOperationActive())
+ if (isSketchOperationActive() || isSketchFeatureOperationActive())
return;
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
/// Breaks sequense of automatically resterted operations
void breakOperationSequence();
- /// Check whether there is active opeation and it is the sketch one
+ /// Check whether the sketch operation is active
/// \return boolean result
bool isSketchOperationActive() const;
+ /// Check whether the sketch feature operation is active
+ /// \return boolean result
+ bool isSketchFeatureOperationActive() const;
+
/// Create all actions for context menus. It is called on creation of module
/// Put the created actions into an internal map
void createActions();