PartDesign Hole Feature implemented.

Minor contributions from Mateusz Skowroński <skowri@gmail.com>
This commit is contained in:
Eivind Kvedalen
2017-07-24 16:11:51 +02:00
committed by wmayer
parent 04065564ae
commit 04b176ebfb
12 changed files with 2598 additions and 245 deletions

View File

@@ -1038,6 +1038,52 @@ bool CmdPartDesignPocket::isActive(void)
return hasActiveDocument();
}
//===========================================================================
// PartDesign_Hole
//===========================================================================
DEF_STD_CMD_A(CmdPartDesignHole);
CmdPartDesignHole::CmdPartDesignHole()
: Command("PartDesign_Hole")
{
sAppModule = "PartDesign";
sGroup = QT_TR_NOOP("PartDesign");
sMenuText = QT_TR_NOOP("Hole");
sToolTipText = QT_TR_NOOP("Create a hole with the selected sketch");
sWhatsThis = sToolTipText;
sStatusTip = sToolTipText;
sPixmap = "PartDesign_Hole";
}
void CmdPartDesignHole::activated(int iMsg)
{
Q_UNUSED(iMsg);
App::Document *doc = getDocument();
if (!PartDesignGui::assureModernWorkflow(doc))
return;
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(true);
if (!pcActiveBody)
return;
Gui::Command* cmd = this;
auto worker = [this, cmd](Part::Feature* sketch, std::string FeatName) {
if (FeatName.empty()) return;
finishProfileBased(cmd, sketch, FeatName);
cmd->adjustCameraPosition();
};
prepareProfileBased(this, "Hole", worker);
}
bool CmdPartDesignHole::isActive(void)
{
return hasActiveDocument();
}
//===========================================================================
// PartDesign_Revolution
//===========================================================================
@@ -2138,6 +2184,7 @@ void CreatePartDesignCommands(void)
rcCmdMgr.addCommand(new CmdPartDesignPad());
rcCmdMgr.addCommand(new CmdPartDesignPocket());
rcCmdMgr.addCommand(new CmdPartDesignHole());
rcCmdMgr.addCommand(new CmdPartDesignRevolution());
rcCmdMgr.addCommand(new CmdPartDesignGroove());
rcCmdMgr.addCommand(new CmdPartDesignAdditivePipe);