Inspection: Final application of pre-commit

This commit is contained in:
Chris Hennes
2023-09-04 07:29:31 -05:00
committed by Chris Hennes
parent c5c2ea3498
commit b8f8b232cb
3 changed files with 26 additions and 25 deletions

View File

@@ -22,7 +22,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Inventor/events/SoButtonEvent.h>
#include <Inventor/events/SoButtonEvent.h>
#endif
#include <App/Document.h>
@@ -35,21 +35,21 @@
#include <Gui/View3DInventorViewer.h>
#include <Mod/Inspection/App/InspectionFeature.h>
#include "VisualInspection.h"
#include "ViewProviderInspection.h"
#include "VisualInspection.h"
DEF_STD_CMD_A(CmdVisualInspection)
CmdVisualInspection::CmdVisualInspection()
: Command("Inspection_VisualInspection")
: Command("Inspection_VisualInspection")
{
sAppModule = "Inspection";
sGroup = QT_TR_NOOP("Inspection");
sMenuText = QT_TR_NOOP("Visual inspection...");
sToolTipText = QT_TR_NOOP("Visual inspection");
sStatusTip = QT_TR_NOOP("Visual inspection");
sWhatsThis = "Inspection_VisualInspection";
sAppModule = "Inspection";
sGroup = QT_TR_NOOP("Inspection");
sMenuText = QT_TR_NOOP("Visual inspection...");
sToolTipText = QT_TR_NOOP("Visual inspection");
sStatusTip = QT_TR_NOOP("Visual inspection");
sWhatsThis = "Inspection_VisualInspection";
}
void CmdVisualInspection::activated(int)
@@ -68,15 +68,15 @@ bool CmdVisualInspection::isActive()
DEF_STD_CMD_A(CmdInspectElement)
CmdInspectElement::CmdInspectElement()
: Command("Inspection_InspectElement")
: Command("Inspection_InspectElement")
{
sAppModule = "Inspection";
sGroup = QT_TR_NOOP("Inspection");
sMenuText = QT_TR_NOOP("Inspection...");
sToolTipText = QT_TR_NOOP("Get distance information");
sWhatsThis = "Inspection_InspectElement";
sStatusTip = sToolTipText;
sPixmap = "inspect_pipette";
sAppModule = "Inspection";
sGroup = QT_TR_NOOP("Inspection");
sMenuText = QT_TR_NOOP("Inspection...");
sToolTipText = QT_TR_NOOP("Get distance information");
sWhatsThis = "Inspection_InspectElement";
sStatusTip = sToolTipText;
sPixmap = "inspect_pipette";
}
void CmdInspectElement::activated(int)
@@ -89,17 +89,19 @@ void CmdInspectElement::activated(int)
viewer->setRedirectToSceneGraphEnabled(true);
viewer->setRedirectToSceneGraph(true);
viewer->setSelectionEnabled(false);
viewer->setEditingCursor(QCursor(Gui::BitmapFactory().pixmapFromSvg("inspect_pipette",QSize(32,32)),4,29));
viewer->setEditingCursor(
QCursor(Gui::BitmapFactory().pixmapFromSvg("inspect_pipette", QSize(32, 32)), 4, 29));
viewer->addEventCallback(SoButtonEvent::getClassTypeId(),
InspectionGui::ViewProviderInspection::inspectCallback);
}
InspectionGui::ViewProviderInspection::inspectCallback);
}
}
bool CmdInspectElement::isActive()
{
App::Document* doc = App::GetApplication().getActiveDocument();
if (!doc || doc->countObjectsOfType(Inspection::Feature::getClassTypeId()) == 0)
if (!doc || doc->countObjectsOfType(Inspection::Feature::getClassTypeId()) == 0) {
return false;
}
Gui::MDIView* view = Gui::getMainWindow()->activeWindow();
if (view && view->isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
@@ -112,7 +114,7 @@ bool CmdInspectElement::isActive()
void CreateInspectionCommands()
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
Gui::CommandManager& rcCmdMgr = Gui::Application::Instance->commandManager();
rcCmdMgr.addCommand(new CmdVisualInspection());
rcCmdMgr.addCommand(new CmdInspectElement());
}

View File

@@ -1,5 +1,5 @@
<RCC>
<qresource>
<qresource>
<file>icons/inspect_pipette.svg</file>
<file>icons/InspectionWorkbench.svg</file>
<file>translations/Inspection_fr.qm</file>
@@ -36,4 +36,4 @@
<file>translations/Inspection_ko.qm</file>
<file>translations/Inspection_id.qm</file>
</qresource>
</RCC>
</RCC>

View File

@@ -1,3 +1,2 @@
/** \defgroup TEMPLATE Inspection
* \ingroup CWORKBENCHES */