Remove Std_MeasureDistance
This commit is contained in:
@@ -51,7 +51,6 @@
|
||||
#include <App/GeoFeatureGroupExtension.h>
|
||||
#include <App/Part.h>
|
||||
#include <App/Link.h>
|
||||
#include <App/MeasureDistance.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Parameter.h>
|
||||
|
||||
@@ -85,7 +84,6 @@
|
||||
#include "View3DInventor.h"
|
||||
#include "View3DInventorViewer.h"
|
||||
#include "ViewParams.h"
|
||||
#include "ViewProviderMeasureDistance.h"
|
||||
#include "ViewProviderGeometryObject.h"
|
||||
#include "WaitCursor.h"
|
||||
|
||||
@@ -3139,62 +3137,6 @@ void StdCmdTreeSelectAllInstances::activated(int iMsg)
|
||||
Selection().selStackPush();
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Std_MeasureDistance
|
||||
//===========================================================================
|
||||
|
||||
DEF_STD_CMD_A(StdCmdMeasureDistance)
|
||||
|
||||
StdCmdMeasureDistance::StdCmdMeasureDistance()
|
||||
: Command("Std_MeasureDistance")
|
||||
{
|
||||
sGroup = "View";
|
||||
sMenuText = QT_TR_NOOP("Measure distance");
|
||||
sToolTipText = QT_TR_NOOP("Activate the distance measurement tool");
|
||||
sWhatsThis = "Std_MeasureDistance";
|
||||
sStatusTip = QT_TR_NOOP("Activate the distance measurement tool");
|
||||
sPixmap = "view-measurement";
|
||||
eType = Alter3DView;
|
||||
}
|
||||
|
||||
void StdCmdMeasureDistance::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
auto view = static_cast<Gui::View3DInventor*>(doc->getActiveView());
|
||||
if (view) {
|
||||
Gui::View3DInventorViewer* viewer = view->getViewer();
|
||||
viewer->setEditing(true);
|
||||
|
||||
// NOLINTBEGIN
|
||||
QCursor cursor = SelectionCallbackHandler::makeCursor(viewer, QSize(32, 32),
|
||||
"view-measurement-cross", 6, 25);
|
||||
viewer->setEditingCursor(cursor);
|
||||
// NOLINTEND
|
||||
|
||||
// Derives from QObject and we have a parent object, so we don't
|
||||
// require a delete.
|
||||
auto marker = new PointMarker(viewer);
|
||||
viewer->addEventCallback(SoEvent::getClassTypeId(),
|
||||
ViewProviderMeasureDistance::measureDistanceCallback, marker);
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdMeasureDistance::isActive()
|
||||
{
|
||||
App::Document* doc = App::GetApplication().getActiveDocument();
|
||||
if (!doc || doc->countObjectsOfType(App::GeoFeature::getClassTypeId()) == 0)
|
||||
return false;
|
||||
|
||||
Gui::MDIView* view = Gui::getMainWindow()->activeWindow();
|
||||
if (view && view->isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
|
||||
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
|
||||
return !viewer->isEditing();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Std_Measure
|
||||
// this is the Unified Measurement Facility Measure command
|
||||
@@ -4124,7 +4066,6 @@ void CreateViewStdCommands()
|
||||
rcCmdMgr.addCommand(new StdCmdTreeExpand());
|
||||
rcCmdMgr.addCommand(new StdCmdTreeCollapse());
|
||||
rcCmdMgr.addCommand(new StdCmdTreeSelectAllInstances());
|
||||
rcCmdMgr.addCommand(new StdCmdMeasureDistance());
|
||||
rcCmdMgr.addCommand(new StdCmdMeasure());
|
||||
rcCmdMgr.addCommand(new StdCmdSceneInspector());
|
||||
rcCmdMgr.addCommand(new StdCmdTextureMapping());
|
||||
|
||||
Reference in New Issue
Block a user