PartDesign Hole Feature implemented.
Minor contributions from Mateusz Skowroński <skowri@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user