Merge pull request #13906 from Rexbas/align-camera

Align camera to faces and edges
This commit is contained in:
Chris Hennes
2024-05-20 11:28:24 -05:00
committed by GitHub
11 changed files with 278 additions and 1 deletions

View File

@@ -4018,6 +4018,33 @@ bool StdRecallWorkingView::isActive()
return view && view->getViewer()->hasHomePosition();
}
//===========================================================================
// Std_AlignToSelection
//===========================================================================
DEF_STD_CMD_A(StdCmdAlignToSelection)
StdCmdAlignToSelection::StdCmdAlignToSelection()
: Command("Std_AlignToSelection")
{
sGroup = "View";
sMenuText = QT_TR_NOOP("Align to selection");
sToolTipText = QT_TR_NOOP("Align the view with the selection");
sWhatsThis = "Std_AlignToSelection";
sPixmap = "align-to-selection";
eType = Alter3DView;
}
void StdCmdAlignToSelection::activated(int iMsg)
{
Q_UNUSED(iMsg);
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"AlignToSelection\")");
}
bool StdCmdAlignToSelection::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("AlignToSelection");
}
//===========================================================================
// Instantiation
//===========================================================================
@@ -4049,6 +4076,7 @@ void CreateViewStdCommands()
rcCmdMgr.addCommand(new StdStoreWorkingView());
rcCmdMgr.addCommand(new StdRecallWorkingView());
rcCmdMgr.addCommand(new StdCmdViewGroup());
rcCmdMgr.addCommand(new StdCmdAlignToSelection());
rcCmdMgr.addCommand(new StdCmdViewExample1());
rcCmdMgr.addCommand(new StdCmdViewExample2());