1
/***************************************************************************
2
* Copyright (c) 2005 Werner Mayer <wmayer[at]users.sourceforge.net> *
4
* This file is part of the FreeCAD CAx development system. *
6
* This library is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Library General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2 of the License, or (at your option) any later version. *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Library General Public License for more details. *
16
* You should have received a copy of the GNU Library General Public *
17
* License along with this library; see the file COPYING.LIB. If not, *
18
* write to the Free Software Foundation, Inc., 59 Temple Place, *
19
* Suite 330, Boston, MA 02111-1307, USA *
21
***************************************************************************/
24
#include "PreCompiled.h"
27
#include <Gui/MenuManager.h>
28
#include <Gui/ToolBarManager.h>
30
using namespace PartGui;
32
#if 0 // needed for Qt's lupdate utility
33
qApp->translate("Workbench", "&Part");
34
qApp->translate("Workbench", "&Simple");
35
qApp->translate("Workbench", "&Parametric");
36
qApp->translate("Workbench", "Solids");
37
qApp->translate("Workbench", "Part tools");
38
qApp->translate("Workbench", "Boolean");
39
qApp->translate("Workbench", "Primitives");
40
qApp->translate("Workbench", "Join");
41
qApp->translate("Workbench", "Split");
42
qApp->translate("Workbench", "Compound");
43
qApp->translate("Workbench", "Create a copy");
46
/// @namespace PartGui @class Workbench
47
TYPESYSTEM_SOURCE(PartGui::Workbench, Gui::StdWorkbench)
49
Workbench::Workbench() = default;
51
Workbench::~Workbench() = default;
53
Gui::MenuItem* Workbench::setupMenuBar() const
55
Gui::MenuItem* root = StdWorkbench::setupMenuBar();
56
Gui::MenuItem* item = root->findItem("&Windows");
58
Gui::MenuItem* prim = new Gui::MenuItem;
59
prim->setCommand("Primitives");
68
Gui::MenuItem* copy = new Gui::MenuItem;
69
copy->setCommand("Create a copy");
70
*copy << "Part_SimpleCopy"
71
<< "Part_TransformedCopy"
73
<< "Part_RefineShape";
75
Gui::MenuItem* bop = new Gui::MenuItem;
76
bop->setCommand("Boolean");
77
*bop << "Part_Boolean"
82
Gui::MenuItem* join = new Gui::MenuItem;
83
join->setCommand("Join");
84
*join << "Part_JoinConnect"
88
Gui::MenuItem* split = new Gui::MenuItem;
89
split->setCommand("Split");
90
*split << "Part_BooleanFragments"
95
Gui::MenuItem* compound = new Gui::MenuItem;
96
compound->setCommand("Compound");
97
*compound << "Part_Compound"
98
<< "Part_ExplodeCompound"
99
<< "Part_CompoundFilter";
101
Gui::MenuItem* part = new Gui::MenuItem;
102
root->insertItem(item, part);
103
part->setCommand("&Part");
104
*part << "Part_Import"
107
<< "Part_BoxSelection"
113
<< "Part_ShapeFromMesh"
114
<< "Part_PointsFromMesh"
116
<< "Part_ReverseShape"
118
<< "Part_CheckGeometry"
119
<< "Part_Defeaturing"
120
<< "Materials_InspectAppearance"
121
<< "Materials_InspectMaterial"
123
<< bop << join << split << compound
125
<< "Sketcher_NewSketch"
133
<< "Part_RuledSurface"
137
<< "Part_CrossSections"
141
<< "Part_ProjectionOnSurface"
143
<< "Part_EditAttachment";
145
Gui::MenuItem* view = root->findItem("&View");
147
Gui::MenuItem* appr = view->findItem("Std_RandomColor");
148
appr = view->afterItem(appr);
149
Gui::MenuItem* face = new Gui::MenuItem();
150
face->setCommand("Part_ColorPerFace");
151
view->insertItem(appr, face);
157
Gui::ToolBarItem* Workbench::setupToolBars() const
159
Gui::ToolBarItem* root = StdWorkbench::setupToolBars();
161
Gui::ToolBarItem* solids = new Gui::ToolBarItem(root);
162
solids->setCommand("Solids");
163
*solids << "Part_Box"
172
Gui::ToolBarItem* tool = new Gui::ToolBarItem(root);
173
tool->setCommand("Part tools");
174
*tool << "Sketcher_NewSketch"
182
<< "Part_RuledSurface"
186
<< "Part_CrossSections"
189
<< "Part_ProjectionOnSurface"
190
<< "Part_ColorPerFace"; // See issues #0477 and #1954 in the tracker
192
Gui::ToolBarItem* boolop = new Gui::ToolBarItem(root);
193
boolop->setCommand("Boolean");
194
*boolop << "Part_CompCompoundTools"
199
<< "Part_CompJoinFeatures"
200
<< "Part_CompSplitFeatures"
201
<< "Part_CheckGeometry"
202
<< "Part_Defeaturing";
207
Gui::ToolBarItem* Workbench::setupCommandBars() const
210
Gui::ToolBarItem* root = new Gui::ToolBarItem;