Remove Std_MeasurementSimple

This commit is contained in:
hlorus
2024-05-03 19:09:04 +02:00
parent b42c3aade0
commit bb7aa6ac74

View File

@@ -732,64 +732,6 @@ void StdCmdReportBug::activated(int iMsg)
OpenURLInBrowser(url.c_str());
}
//===========================================================================
// Std_MeasurementSimple
//===========================================================================
DEF_STD_CMD(StdCmdMeasurementSimple)
StdCmdMeasurementSimple::StdCmdMeasurementSimple()
:Command("Std_MeasurementSimple")
{
sGroup = "Tools";
sMenuText = QT_TR_NOOP("Measure distance");
sToolTipText = QT_TR_NOOP("Measures distance between two selected objects");
sWhatsThis = "Std_MeasurementSimple";
sStatusTip = QT_TR_NOOP("Measures distance between two selected objects");
sPixmap = "view-measurement";
eType = 0;
}
void StdCmdMeasurementSimple::activated(int iMsg)
{
Q_UNUSED(iMsg);
unsigned int n = getSelection().countObjectsOfType(App::DocumentObject::getClassTypeId());
if (n == 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Only one object selected. Please select two objects.\n"
"Be aware the point where you click matters."));
return;
}
if (n < 1 || n > 2) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Please select two objects.\n"
"Be aware the point where you click matters."));
return;
}
std::vector<Gui::SelectionSingleton::SelObj> Sel = getSelection().getSelection();
std::string name;
name += "Dist ";
name += Sel[0].FeatName;
name += "-";
name += Sel[0].SubName;
name += " to ";
name += Sel[1].FeatName;
name += "-";
name += Sel[1].SubName;
openCommand(QT_TRANSLATE_NOOP("Command", "Insert measurement"));
doCommand(Doc,"_f = App.activeDocument().addObject(\"App::MeasureDistance\",\"%s\")","Measurement");
doCommand(Doc,"_f.Label ='%s'",name.c_str());
doCommand(Doc,"_f.P1 = FreeCAD.Vector(%f,%f,%f)",Sel[0].x,Sel[0].y,Sel[0].z);
doCommand(Doc,"_f.P2 = FreeCAD.Vector(%f,%f,%f)",Sel[1].x,Sel[1].y,Sel[1].z);
updateActive();
commitCommand();
}
//===========================================================================
// Std_TextDocument
//===========================================================================
@@ -1011,7 +953,6 @@ void CreateStdCommands()
rcCmdMgr.addCommand(new StdCmdUnitsCalculator());
rcCmdMgr.addCommand(new StdCmdUserEditMode());
rcCmdMgr.addCommand(new StdCmdReloadStyleSheet());
//rcCmdMgr.addCommand(new StdCmdMeasurementSimple());
//rcCmdMgr.addCommand(new StdCmdDownloadOnlineHelp());
//rcCmdMgr.addCommand(new StdCmdDescription());
}