Mod/Part/Gui/Workbench.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2005 Werner Mayer <wmayer[at]users.sourceforge.net>     *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #include "PreCompiled.h"
00025 
00026 #ifndef _PreComp_
00027 # include <qobject.h>
00028 #endif
00029 
00030 #include "Workbench.h"
00031 #include <Gui/MenuManager.h>
00032 #include <Gui/ToolBarManager.h>
00033 
00034 using namespace PartGui;
00035 
00036 #if 0 // needed for Qt's lupdate utility
00037     qApp->translate("Workbench", "&Part");
00038     qApp->translate("Workbench", "&Simple");
00039     qApp->translate("Workbench", "&Parametric");
00040     qApp->translate("Workbench", "Solids");
00041     qApp->translate("Workbench", "Part tools");
00042     qApp->translate("Workbench", "Boolean");
00043 #endif
00044 
00046 TYPESYSTEM_SOURCE(PartGui::Workbench, Gui::StdWorkbench)
00047 
00048 Workbench::Workbench()
00049 {
00050 }
00051 
00052 Workbench::~Workbench()
00053 {
00054 }
00055 
00056 Gui::MenuItem* Workbench::setupMenuBar() const
00057 {
00058     Gui::MenuItem* root = StdWorkbench::setupMenuBar();
00059     Gui::MenuItem* item = root->findItem("&Windows");
00060 
00061     Gui::MenuItem* part = new Gui::MenuItem;
00062     root->insertItem(item, part);
00063     part->setCommand("&Part");
00064     *part << "Part_Import" << "Part_Export" << "Separator";
00065     *part << "Part_Primitives" << "Part_ShapeFromMesh"
00066           << "Part_MakeSolid" << "Part_ReverseShape" << "Part_SimpleCopy" << "Separator"
00067           << "Part_Boolean" << "Part_CrossSections" << "Part_Extrude"
00068           << "Part_Revolve" << "Part_Mirror" << "Part_Fillet"
00069           << "Part_RuledSurface" << "Part_Loft"
00070           << "Part_Builder";
00071 
00072     Gui::MenuItem* partSimple = new Gui::MenuItem;
00073     root->insertItem(item, partSimple);
00074     partSimple->setCommand("&Simple");
00075     *partSimple << "Part_SimpleCylinder";
00076 
00077     Gui::MenuItem* solids = new Gui::MenuItem;
00078     root->insertItem(item, solids);
00079     solids->setCommand("&Parametric");
00080     *solids << "Part_Box" << "Part_Cylinder" << "Part_Sphere" << "Part_Cone"
00081             << "Part_Torus" << "Separator" << "Part_Primitives";
00082 
00083     return root;
00084 }
00085 
00086 Gui::ToolBarItem* Workbench::setupToolBars() const
00087 {
00088     Gui::ToolBarItem* root = StdWorkbench::setupToolBars();
00089 
00090     Gui::ToolBarItem* solids = new Gui::ToolBarItem(root);
00091     solids->setCommand("Solids");
00092     *solids << "Part_Box" << "Part_Cylinder" << "Part_Sphere" << "Part_Cone" << "Part_Torus" << "Part_Primitives";
00093 
00094     Gui::ToolBarItem* tool = new Gui::ToolBarItem(root);
00095     tool->setCommand("Part tools");
00096     *tool << "Part_Extrude" << "Part_Revolve" << "Part_Mirror" << "Part_Fillet" << "Part_RuledSurface";
00097 
00098     Gui::ToolBarItem* boolop = new Gui::ToolBarItem(root);
00099     boolop->setCommand("Boolean");
00100     *boolop << "Part_Boolean" << "Part_Cut" << "Part_Fuse" << "Part_Common" << "Part_Section";
00101 
00102     return root;
00103 }
00104 
00105 Gui::ToolBarItem* Workbench::setupCommandBars() const
00106 {
00107     // Part tools
00108     Gui::ToolBarItem* root = new Gui::ToolBarItem;
00109     return root;
00110 }
00111 

Generated on Wed Nov 23 19:01:11 2011 for FreeCAD by  doxygen 1.6.1