| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #include <QApplication>
|
| |
|
| | #include <App/Application.h>
|
| | #include <App/Document.h>
|
| | #include <Gui/Application.h>
|
| | #include <Gui/Command.h>
|
| | #include <Gui/Control.h>
|
| | #include <Gui/MainWindow.h>
|
| | #include <Gui/MDIView.h>
|
| | #include <Gui/View3DInventor.h>
|
| | #include <Gui/View3DInventorViewer.h>
|
| |
|
| | #include "TaskMeasure.h"
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| | DEF_STD_CMD_A(StdCmdMeasure)
|
| |
|
| | StdCmdMeasure::StdCmdMeasure()
|
| | : Command("Std_Measure")
|
| | {
|
| | sGroup = "Measure";
|
| | sMenuText = QT_TR_NOOP("&Measure");
|
| | sToolTipText = QT_TR_NOOP("Measure a feature");
|
| | sWhatsThis = "Std_Measure";
|
| | sStatusTip = QT_TR_NOOP("Measure a feature");
|
| | sPixmap = "umf-measurement";
|
| | }
|
| |
|
| | void StdCmdMeasure::activated(int iMsg)
|
| | {
|
| | Q_UNUSED(iMsg);
|
| |
|
| | MeasureGui::TaskMeasure* task = new MeasureGui::TaskMeasure();
|
| | task->setDocumentName(this->getDocument()->getName());
|
| | Gui::Control().showDialog(task);
|
| | }
|
| |
|
| | bool StdCmdMeasure::isActive()
|
| | {
|
| | App::Document* doc = App::GetApplication().getActiveDocument();
|
| | if (!doc || doc->countObjectsOfType<App::GeoFeature>() == 0) {
|
| | return false;
|
| | }
|
| |
|
| | Gui::MDIView* view = Gui::getMainWindow()->activeWindow();
|
| | if (view && view->isDerivedFrom<Gui::View3DInventor>()) {
|
| | Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
|
| | return !viewer->isEditing();
|
| | }
|
| | return false;
|
| | }
|
| |
|
| | void CreateMeasureCommands()
|
| | {
|
| | Gui::CommandManager& rcCmdMgr = Gui::Application::Instance->commandManager();
|
| |
|
| | auto cmd = new StdCmdMeasure();
|
| | cmd->initAction();
|
| | rcCmdMgr.addCommand(cmd);
|
| | }
|
| |
|