Add command to create coordinate system as datum item

This commit is contained in:
wmayer
2019-01-08 12:48:37 +01:00
parent 6efd6de4c1
commit 55a4f78adf
2 changed files with 37 additions and 0 deletions

View File

@@ -233,6 +233,34 @@ bool CmdPartDesignPoint::isActive(void)
return false;
}
DEF_STD_CMD_A(CmdPartDesignCS)
CmdPartDesignCS::CmdPartDesignCS()
:Command("PartDesign_CoordinateSystem")
{
sAppModule = "PartDesign";
sGroup = QT_TR_NOOP("PartDesign");
sMenuText = QT_TR_NOOP("Create a local coordinate system");
sToolTipText = QT_TR_NOOP("Create a new local coordinate system");
sWhatsThis = "PartDesign_CoordinateSystem";
sStatusTip = sToolTipText;
sPixmap = "PartDesign_CoordinateSystem";
}
void CmdPartDesignCS::activated(int iMsg)
{
Q_UNUSED(iMsg);
UnifiedDatumCommand(*this, Base::Type::fromName("PartDesign::CoordinateSystem"),"Local_CS");
}
bool CmdPartDesignCS::isActive(void)
{
if (getActiveGuiDocument())
return true;
else
return false;
}
//===========================================================================
// PartDesign_ShapeBinder
//===========================================================================
@@ -2270,6 +2298,7 @@ void CreatePartDesignCommands(void)
rcCmdMgr.addCommand(new CmdPartDesignPlane());
rcCmdMgr.addCommand(new CmdPartDesignLine());
rcCmdMgr.addCommand(new CmdPartDesignPoint());
rcCmdMgr.addCommand(new CmdPartDesignCS());
rcCmdMgr.addCommand(new CmdPartDesignNewSketch());

View File

@@ -245,6 +245,7 @@ void Workbench::activated()
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
"PartDesign_CoordinateSystem",
0};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT Part::Feature SUBELEMENT Vertex COUNT 1..",
@@ -259,6 +260,7 @@ void Workbench::activated()
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
"PartDesign_CoordinateSystem",
0};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT Part::Feature SUBELEMENT Edge COUNT 1..",
@@ -276,6 +278,7 @@ void Workbench::activated()
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
"PartDesign_CoordinateSystem",
0};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT Part::Feature SUBELEMENT Face COUNT 1",
@@ -309,6 +312,7 @@ void Workbench::activated()
"PartDesign_Plane",
"PartDesign_Line",
"PartDesign_Point",
"PartDesign_CoordinateSystem",
0};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT App::Plane COUNT 1",
@@ -321,6 +325,7 @@ void Workbench::activated()
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
"PartDesign_CoordinateSystem",
0};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT PartDesign::Plane COUNT 1",
@@ -345,6 +350,7 @@ void Workbench::activated()
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
"PartDesign_CoordinateSystem",
0};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT PartDesign::Point COUNT 1",
@@ -460,6 +466,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
<< "PartDesign_Point"
<< "PartDesign_Line"
<< "PartDesign_Plane"
<< "PartDesign_CoordinateSystem"
<< "PartDesign_ShapeBinder"
<< "PartDesign_Clone"
<< "Separator"
@@ -525,6 +532,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
<< "PartDesign_Point"
<< "PartDesign_Line"
<< "PartDesign_Plane"
<< "PartDesign_CoordinateSystem"
<< "PartDesign_ShapeBinder"
<< "PartDesign_Clone";