Gui: add toolbar button for toggling selection bounding box
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
#include "SoAxisCrossKit.h"
|
||||
#include "View3DInventor.h"
|
||||
#include "View3DInventorViewer.h"
|
||||
#include "ViewParams.h"
|
||||
#include "WaitCursor.h"
|
||||
#include "ViewProviderMeasureDistance.h"
|
||||
#include "ViewProviderGeometryObject.h"
|
||||
@@ -3445,6 +3446,50 @@ void StdCmdTreeViewActions::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// Std_SelBoundingBox
|
||||
//===========================================================================
|
||||
DEF_STD_CMD_AC(StdCmdSelBoundingBox);
|
||||
|
||||
StdCmdSelBoundingBox::StdCmdSelBoundingBox()
|
||||
:Command("Std_SelBoundingBox")
|
||||
{
|
||||
sGroup = QT_TR_NOOP("View");
|
||||
sMenuText = QT_TR_NOOP("&Bounding box");
|
||||
sToolTipText = QT_TR_NOOP("Show selection bounding box");
|
||||
sWhatsThis = "Std_SelBack";
|
||||
sStatusTip = QT_TR_NOOP("Show selection bounding box");
|
||||
sPixmap = "sel-bbox";
|
||||
eType = Alter3DView;
|
||||
}
|
||||
|
||||
void StdCmdSelBoundingBox::activated(int iMsg)
|
||||
{
|
||||
bool checked = !!iMsg;
|
||||
if(checked != ViewParams::instance()->getShowSelectionBoundingBox()) {
|
||||
ViewParams::instance()->setShowSelectionBoundingBox(checked);
|
||||
if(_pcAction)
|
||||
_pcAction->setChecked(checked,true);
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdSelBoundingBox::isActive(void)
|
||||
{
|
||||
if(_pcAction) {
|
||||
bool checked = _pcAction->isChecked();
|
||||
if(checked != ViewParams::instance()->getShowSelectionBoundingBox())
|
||||
_pcAction->setChecked(!checked,true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Action * StdCmdSelBoundingBox::createAction(void)
|
||||
{
|
||||
Action *pcAction = Command::createAction();
|
||||
pcAction->setCheckable(true);
|
||||
return pcAction;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Instantiation
|
||||
//===========================================================================
|
||||
@@ -3518,6 +3563,7 @@ void CreateViewStdCommands(void)
|
||||
rcCmdMgr.addCommand(new StdCmdAxisCross());
|
||||
rcCmdMgr.addCommand(new CmdViewMeasureClearAll());
|
||||
rcCmdMgr.addCommand(new CmdViewMeasureToggleAll());
|
||||
rcCmdMgr.addCommand(new StdCmdSelBoundingBox());
|
||||
rcCmdMgr.addCommand(new StdCmdSelBack());
|
||||
rcCmdMgr.addCommand(new StdCmdSelForward());
|
||||
rcCmdMgr.addCommand(new StdCmdTreeViewActions());
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
<file>sel-back.svg</file>
|
||||
<file>sel-forward.svg</file>
|
||||
<file>sel-instance.svg</file>
|
||||
<file>sel-bbox.svg</file>
|
||||
<file>help-browser.svg</file>
|
||||
<file>preferences-system.svg</file>
|
||||
<file>process-stop.svg</file>
|
||||
@@ -241,6 +242,7 @@
|
||||
<file>sel-back.svg</file>
|
||||
<file>sel-forward.svg</file>
|
||||
<file>sel-instance.svg</file>
|
||||
<file>sel-bbox.svg</file>
|
||||
<file>help-browser.svg</file>
|
||||
<file>preferences-system.svg</file>
|
||||
<file>window-new.svg</file>
|
||||
|
||||
283
src/Gui/Icons/sel-bbox.svg
Normal file
283
src/Gui/Icons/sel-bbox.svg
Normal file
@@ -0,0 +1,283 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64px"
|
||||
height="64px"
|
||||
id="svg6248"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="sel-bbox.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs6250">
|
||||
<linearGradient
|
||||
id="linearGradient3253">
|
||||
<stop
|
||||
style="stop-color:#89d5f8;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3255" />
|
||||
<stop
|
||||
style="stop-color:#00899e;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3257" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient6816">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop6818" />
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop6820" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient6781">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop6783" />
|
||||
<stop
|
||||
style="stop-color:#3465a4;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop6785" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="-81.834999 : 121.93486 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="158.69906 : 94.577031 : 1"
|
||||
inkscape:persp3d-origin="32 : 21.333333 : 1"
|
||||
id="perspective6256" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient6816"
|
||||
id="radialGradient6822"
|
||||
cx="33.369828"
|
||||
cy="51.929391"
|
||||
fx="33.369828"
|
||||
fy="51.929391"
|
||||
r="25.198714"
|
||||
gradientTransform="matrix(1.1581633,0,0,0.6558985,-7.29237,16.126077)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3253"
|
||||
id="radialGradient3259"
|
||||
cx="18.417862"
|
||||
cy="17.013988"
|
||||
fx="18.417862"
|
||||
fy="17.013988"
|
||||
r="27.986705"
|
||||
gradientTransform="matrix(0.9724373,-0.105657,5.0523169e-2,0.4650009,-0.3519546,9.5854384)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3253"
|
||||
id="radialGradient3270"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9724373,-0.105657,0.05052317,0.4650009,-0.3519546,9.5854384)"
|
||||
cx="18.417862"
|
||||
cy="17.013988"
|
||||
fx="18.417862"
|
||||
fy="17.013988"
|
||||
r="27.986705" />
|
||||
<linearGradient
|
||||
id="linearGradient3806">
|
||||
<stop
|
||||
id="stop3808"
|
||||
offset="0"
|
||||
style="stop-color:#34e0e2;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop3810"
|
||||
offset="1"
|
||||
style="stop-color:#06989a;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3836-0-6-92-4-62">
|
||||
<stop
|
||||
style="stop-color:#a40000;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3838-2-7-06-8-9" />
|
||||
<stop
|
||||
style="stop-color:#ef2929;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3840-5-5-8-7-1" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600"
|
||||
id="radialGradient3808"
|
||||
cx="20.802507"
|
||||
cy="18.626959"
|
||||
fx="20.802507"
|
||||
fy="18.626959"
|
||||
r="27.084639"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.46998728,0.49348663,-0.95248379,0.90712735,-91.600844,-77.758763)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600">
|
||||
<stop
|
||||
style="stop-color:#729fcf;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3602" />
|
||||
<stop
|
||||
style="stop-color:#204a87;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3604" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3765"
|
||||
id="linearGradient3771"
|
||||
x1="35"
|
||||
y1="51"
|
||||
x2="31"
|
||||
y2="18"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient3765">
|
||||
<stop
|
||||
style="stop-color:#d3d7cf;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3767" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3769" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="2.75"
|
||||
inkscape:cx="48.103924"
|
||||
inkscape:cy="-10.073587"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:window-width="1375"
|
||||
inkscape:window-height="876"
|
||||
inkscape:window-x="65"
|
||||
inkscape:window-y="24"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:snap-nodes="true"
|
||||
inkscape:window-maximized="1">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid3001"
|
||||
empspacing="2"
|
||||
visible="true"
|
||||
enabled="true"
|
||||
snapvisiblegridlinesonly="true" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata6253">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<g
|
||||
id="g4311"
|
||||
transform="matrix(1.0837296,0,0,1.0837296,131.29955,77.715925)">
|
||||
<circle
|
||||
r="18.457682"
|
||||
id="path2826"
|
||||
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:url(#radialGradient3808);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:1.84547901;marker:none;enable-background:accumulate"
|
||||
cx="-91.928146"
|
||||
cy="-42.321846" />
|
||||
<circle
|
||||
r="17.184738"
|
||||
id="path2826-4"
|
||||
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#729fcf;stroke-width:1.84547901;marker:none;enable-background:accumulate"
|
||||
cx="-91.928146"
|
||||
cy="-42.321846" />
|
||||
<circle
|
||||
r="18.457682"
|
||||
id="path2826-5"
|
||||
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#0b1521;stroke-width:1.84547901;marker:none;enable-background:accumulate"
|
||||
cx="-91.928146"
|
||||
cy="-42.321846" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:none;stroke:#042a2a;stroke-width:6;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
|
||||
d="M 5,17 41,23 59,9 25,5 z"
|
||||
id="path3961"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
style="fill:none;stroke:#042a2a;stroke-width:6;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
|
||||
d="M 59,9 59,43 41,59 41,23 z"
|
||||
id="path2995"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc"
|
||||
id="path3825"
|
||||
d="M 5,17 41,23 41,59 5,53 z"
|
||||
style="fill:none;stroke:#042a2a;stroke-width:6;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
|
||||
<path
|
||||
style="fill:none;stroke:#19ff19;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;fill-opacity:1"
|
||||
d="M 59,9 59,43 41,59 41,23 z"
|
||||
id="path2995-7"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc"
|
||||
id="path3825-9"
|
||||
d="M 5,17 41,23 41,59 5,53 z"
|
||||
style="fill:none;stroke:#19ff19;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;fill-opacity:1" />
|
||||
<path
|
||||
style="fill:none;stroke:#19ff19;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="M 5,17 25,5 59,9 41,23 z"
|
||||
id="path3970"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<g
|
||||
transform="matrix(-0.54545355,0,0,0.54545355,66.605911,31.253185)"
|
||||
id="g4147">
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3761"
|
||||
d="M 7,49 15,57 35,37 41,49 57,7 15,23 27,29 Z"
|
||||
style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:3.66667342;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3763"
|
||||
d="M 10.962357,49 31.571972,28.196969 21.91667,23.314394 52.305932,11.59872 40.631925,42.093042 35.82706,32.778233 15.095348,53.132991 Z"
|
||||
style="fill:none;stroke:#ffffff;stroke-width:1.83333671;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.8 KiB |
@@ -578,7 +578,8 @@ MenuItem* StdWorkbench::setupMenuBar() const
|
||||
MenuItem* view = new MenuItem( menuBar );
|
||||
view->setCommand("&View");
|
||||
*view << "Std_ViewCreate" << "Std_OrthographicCamera" << "Std_PerspectiveCamera" << "Std_MainFullscreen" << "Separator"
|
||||
<< stdviews << "Std_FreezeViews" << "Std_DrawStyle" << "Separator" << view3d << zoom
|
||||
<< stdviews << "Std_FreezeViews" << "Std_DrawStyle" << "Std_SelBoundingBox"
|
||||
<< "Separator" << view3d << zoom
|
||||
<< "Std_ViewDockUndockFullscreen" << "Std_AxisCross" << "Std_ToggleClipPlane"
|
||||
<< "Std_TextureMapping"
|
||||
#ifdef BUILD_VR
|
||||
@@ -658,7 +659,7 @@ ToolBarItem* StdWorkbench::setupToolBars() const
|
||||
// View
|
||||
ToolBarItem* view = new ToolBarItem( root );
|
||||
view->setCommand("View");
|
||||
*view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_DrawStyle"
|
||||
*view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_DrawStyle" << "Std_SelBoundingBox"
|
||||
<< "Separator" << "Std_TreeViewActions" << "Std_ViewIsometric" << "Separator" << "Std_ViewFront"
|
||||
<< "Std_ViewTop" << "Std_ViewRight" << "Separator" << "Std_ViewRear" << "Std_ViewBottom"
|
||||
<< "Std_ViewLeft" << "Separator" << "Std_MeasureDistance" ;
|
||||
|
||||
Reference in New Issue
Block a user