Drawing: Add SpreadsheetView command - fixes #1805

This commit is contained in:
Yorik van Havre 2016-01-03 16:44:56 -02:00
parent 145fe4a364
commit 85fdc8c76b
9 changed files with 1171 additions and 0 deletions

View File

@ -280,6 +280,7 @@ endif(BUILD_RAYTRACING)
#inferred from cmakelists.txt. appears to be working.
if(BUILD_DRAWING)
set(BUILD_PART ON)
set(BUILD_SPREADSHEET ON)
endif(BUILD_DRAWING)
#inferred from cmakelists.txt. appears to be working.

View File

@ -23,6 +23,7 @@
#include "FeatureViewAnnotation.h"
#include "FeatureViewSymbol.h"
#include "FeatureProjection.h"
#include "FeatureViewSpreadsheet.h"
#include "FeatureClip.h"
#include "PageGroup.h"
@ -63,6 +64,7 @@ void DrawingExport initDrawing()
Drawing::FeatureViewAnnotation ::init();
Drawing::FeatureViewSymbol ::init();
Drawing::FeatureClip ::init();
Drawing::FeatureViewSpreadsheet ::init();
}
} // extern "C"

View File

@ -17,6 +17,7 @@ link_directories(${OCC_LIBRARY_DIR})
set(Drawing_LIBS
Part
Spreadsheet
FreeCADApp
)
@ -37,6 +38,8 @@ SET(Features_SRCS
FeatureClip.h
PageGroup.cpp
PageGroup.h
FeatureViewSpreadsheet.cpp
FeatureViewSpreadsheet.h
)
SET(Drawing_SRCS

View File

@ -0,0 +1,252 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <sstream>
#endif
#include <iomanip>
#include <Base/Exception.h>
#include <Base/FileInfo.h>
#include <App/Property.h>
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include "FeatureViewSpreadsheet.h"
#include <Mod/Spreadsheet/App/Cell.h>
#include <Mod/Spreadsheet/App/Sheet.h>
using namespace Drawing;
using namespace std;
//===========================================================================
// FeatureViewSpreadsheet
//===========================================================================
PROPERTY_SOURCE(Drawing::FeatureViewSpreadsheet, Drawing::FeatureView)
FeatureViewSpreadsheet::FeatureViewSpreadsheet(void)
{
static const char *vgroup = "Drawing view";
ADD_PROPERTY_TYPE(CellStart ,("A1"),vgroup,App::Prop_None,"The top left cell of the range to display");
ADD_PROPERTY_TYPE(CellEnd ,("B2"),vgroup,App::Prop_None,"The bottom right cell of the range to display");
ADD_PROPERTY_TYPE(Font ,("Sans"),vgroup,App::Prop_None,"The name of the font to use");
ADD_PROPERTY_TYPE(Color,(0.0f,0.0f,0.0f),vgroup,App::Prop_None,"The default color of the text and lines");
ADD_PROPERTY_TYPE(Source ,(0),vgroup,App::Prop_None,"Spreadsheet to view");
ADD_PROPERTY_TYPE(LineWidth,(0.35),vgroup,App::Prop_None,"The thickness of the cell lines");
ADD_PROPERTY_TYPE(FontSize,(12.0),vgroup,App::Prop_None,"The size of the text");
}
FeatureViewSpreadsheet::~FeatureViewSpreadsheet()
{
}
App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
{
// quick tests
App::DocumentObject* link = Source.getValue();
std::string scellstart = CellStart.getValue();
std::string scellend = CellEnd.getValue();
if (!link)
return new App::DocumentObjectExecReturn("No spreadsheet linked");
if (!link->getTypeId().isDerivedFrom(Spreadsheet::Sheet::getClassTypeId()))
return new App::DocumentObjectExecReturn("The linked object is not a spreadsheet");
if ( (scellstart.empty()) || (scellend.empty()) )
return new App::DocumentObjectExecReturn("Empty cell value");
// build a list of available colums: A, B, C, ... AA, AB, ... ZY, ZZ.
std::string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
std::vector<std::string> availcolumns;
for (int i=0; i<26; ++i) {
std::stringstream s;
s << alphabet[i];
availcolumns.push_back(s.str());
}
for (int i=0; i<26; ++i) {
for (int j=0; i<26; ++i) {
std::stringstream s;
s << alphabet[i] << alphabet[j];
availcolumns.push_back(s.str());
}
}
// build rows range and columns range
std::vector<std::string> columns;
std::vector<int> rows;
try {
for (unsigned int i=0; i<scellstart.length(); ++i) {
if (isdigit(scellstart[i])) {
columns.push_back(scellstart.substr(0,i));
rows.push_back(std::atoi(scellstart.substr(i,scellstart.length()-1).c_str()));
}
}
for (unsigned int i=0; i<scellend.length(); ++i) {
if (isdigit(scellend[i])) {
std::string startcol = columns.back();
std::string endcol = scellend.substr(0,i);
bool valid = false;
for (std::vector<std::string>::const_iterator j = availcolumns.begin(); j != availcolumns.end(); ++j) {
if ( (*j) == startcol) {
if ( (*j) != endcol) {
valid = true;
}
} else {
if (valid) {
if ( (*j) == endcol) {
columns.push_back((*j));
valid = false;
} else {
columns.push_back((*j));
}
}
}
}
int endrow = std::atoi(scellend.substr(i,scellend.length()-1).c_str());
for (int j=rows.back()+1; j<=endrow; ++j) {
rows.push_back(j);
}
}
}
} catch (std::exception) {
return new App::DocumentObjectExecReturn("Invalid cell range");
}
// create the containing group
std::string ViewName = Label.getValue();
std::stringstream result,hr,hg,hb;
const App::Color& c = Color.getValue();
hr << hex << setfill('0') << setw(2) << (int)(255.0*c.r);
hg << hex << setfill('0') << setw(2) << (int)(255.0*c.g);
hb << hex << setfill('0') << setw(2) << (int)(255.0*c.b);
result << "<g id=\"" << ViewName << "\" transform=\"translate(" << X.getValue() << "," << Y.getValue() << ")"
<< " rotate(" << Rotation.getValue() << ")"
<< " scale(" << Scale.getValue() << ")\">" << endl;
// fill the cells
float rowoffset = 0.0;
float coloffset = 0.0;
float cellheight = 100;
float cellwidth = 100;
std::string celltext;
Spreadsheet::Sheet* sheet = static_cast<Spreadsheet::Sheet*>(link);
std::vector<std::string> skiplist;
for (std::vector<std::string>::const_iterator col = columns.begin(); col != columns.end(); ++col) {
// create a group for each column
result << " <g id=\"" << ViewName << "_col" << (*col) << "\">" << endl;
for (std::vector<int>::const_iterator row = rows.begin(); row != rows.end(); ++row) {
// get cell size
std::stringstream srow;
srow << (*row);
Spreadsheet::CellAddress address((*col) + srow.str());
cellwidth = sheet->getColumnWidth(address.col());
cellheight = sheet->getRowHeight(address.row());
celltext = "";
// get the text
App::Property* prop = sheet->getPropertyByName(address.toString().c_str());
std::stringstream field;
if (prop != 0) {
if (prop->isDerivedFrom((App::PropertyQuantity::getClassTypeId())))
field << static_cast<App::PropertyQuantity*>(prop)->getValue();
else if (prop->isDerivedFrom((App::PropertyFloat::getClassTypeId())))
field << static_cast<App::PropertyFloat*>(prop)->getValue();
else if (prop->isDerivedFrom((App::PropertyString::getClassTypeId())))
field << static_cast<App::PropertyString*>(prop)->getValue();
else
assert(0);
celltext = field.str();
}
// get colors, style and span
std::string bcolor = "none";
std::string fcolor = "#" + hr.str() + hg.str() + hb.str();
std::string textstyle = "";
Spreadsheet::Cell* cell = sheet->getCell(address);
if (cell) {
App::Color f,b;
std::set<std::string> st;
int colspan, rowspan;
if (cell->getBackground(b)) {
std::stringstream br,bg,bb;
br << hex << setfill('0') << setw(2) << (int)(255.0*b.r);
bg << hex << setfill('0') << setw(2) << (int)(255.0*b.g);
bb << hex << setfill('0') << setw(2) << (int)(255.0*b.b);
bcolor = "#" + br.str() + bg.str() + bb.str();
}
if (cell->getForeground(f)) {
std::stringstream fr,fg,fb;
fr << hex << setfill('0') << setw(2) << (int)(255.0*f.r);
fg << hex << setfill('0') << setw(2) << (int)(255.0*f.g);
fb << hex << setfill('0') << setw(2) << (int)(255.0*f.b);
fcolor = "#" + fr.str() + fg.str() + fb.str();
}
if (cell->getStyle(st)) {
for (std::set<std::string>::const_iterator i = st.begin(); i != st.end(); ++i) {
if ((*i) == "bold")
textstyle = textstyle + "font-weight: bold; ";
else if ((*i) == "italic")
textstyle = textstyle + "font-style: italic; ";
else if ((*i) == "underline")
textstyle = textstyle + "text-decoration: underline; ";
}
}
if (cell->getSpans(rowspan,colspan)) {
for (int i=0; i<colspan; ++i) {
for (int j=0; j<rowspan; ++j) {
Spreadsheet::CellAddress nextcell(address.row()+j,address.col()+i);
if (i > 0)
cellwidth = cellwidth + sheet->getColumnWidth(nextcell.col());
if (j > 0)
cellheight = cellheight + sheet->getRowHeight(nextcell.row());
if ( (i > 0) || (j > 0) )
skiplist.push_back(nextcell.toString());
}
}
}
}
// skip cell if found in skiplist
if (std::find(skiplist.begin(), skiplist.end(), address.toString()) == skiplist.end()) {
result << " <rect x=\"" << coloffset << "\" y=\"" << rowoffset << "\" width=\"" << cellwidth
<< "\" height=\"" << cellheight << "\" style=\"fill:" << bcolor << ";stroke-width:"
<< LineWidth.getValue()/Scale.getValue() << ";stroke:#" << hr.str() << hg.str() << hb.str() << ";\" />" << endl
<< " <text style=\"" << textstyle << "\" x=\"" << coloffset + FontSize.getValue()/2 << "\" y=\"" << rowoffset + 0.75 * cellheight << "\" font-family=\""
<< Font.getValue() << "\"" << " font-size=\"" << FontSize.getValue() << "\""
<< " fill=\"" << fcolor << "\">" << celltext << "</text>" << endl;
}
rowoffset = rowoffset + cellheight;
}
result << " </g>" << endl;
rowoffset = 0.0;
coloffset = coloffset + cellwidth;
}
// close the containing group
result << "</g>" << endl;
// Apply the resulting fragment
ViewResult.setValue(result.str().c_str());
return App::DocumentObject::StdReturn;
}

View File

@ -0,0 +1,68 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net 2015) *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef _FeatureViewSpreadsheet_h_
#define _FeatureViewSpreadsheet_h_
#include <App/DocumentObject.h>
#include <App/PropertyLinks.h>
#include "FeatureView.h"
namespace Drawing
{
/** Base class of all View Features in the drawing module
*/
class DrawingExport FeatureViewSpreadsheet : public FeatureView
{
PROPERTY_HEADER(Drawing::FeatureView);
public:
/// Constructor
FeatureViewSpreadsheet(void);
virtual ~FeatureViewSpreadsheet();
App::PropertyLink Source;
App::PropertyString CellStart;
App::PropertyString CellEnd;
App::PropertyString Font;
App::PropertyColor Color;
App::PropertyFloat LineWidth;
App::PropertyFloat FontSize;
/** @name methods overide Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
//@}
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
return "DrawingGui::ViewProviderDrawingView";
}
};
} //namespace Drawing
#endif

View File

@ -35,6 +35,7 @@
#include <Mod/Part/App/PartFeature.h>
#include <Mod/Drawing/App/FeaturePage.h>
#include <Mod/Spreadsheet/App/Sheet.h>
#include "DrawingView.h"
@ -727,6 +728,54 @@ bool CmdDrawingDraftView::isActive(void)
}
//===========================================================================
// Drawing_Spreadheet_View
//===========================================================================
DEF_STD_CMD_A(CmdDrawingSpreadsheetView);
CmdDrawingSpreadsheetView::CmdDrawingSpreadsheetView()
: Command("Drawing_SpreadsheetView")
{
// seting the
sGroup = QT_TR_NOOP("Drawing");
sMenuText = QT_TR_NOOP("&Spreadsheet View");
sToolTipText = QT_TR_NOOP("Inserts a view of a selected spreadsheet in the active drawing");
sWhatsThis = "Drawing_SpreadsheetView";
sStatusTip = QT_TR_NOOP("Inserts a view of a selected spreadsheet in the active drawing");
sPixmap = "actions/drawing-spreadsheet";
}
void CmdDrawingSpreadsheetView::activated(int iMsg)
{
const std::vector<App::DocumentObject*> spreads = getSelection().getObjectsOfType(Spreadsheet::Sheet::getClassTypeId());
if (spreads.size() != 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select exactly one Spreadsheet object."));
return;
}
const std::vector<App::DocumentObject*> pages = this->getDocument()->getObjectsOfType(Drawing::FeaturePage::getClassTypeId());
if (pages.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No page found"),
QObject::tr("Create a page first."));
return;
}
std::string SpreadName = spreads.front()->getNameInDocument();
std::string PageName = pages.front()->getNameInDocument();
openCommand("Create spreadsheet view");
std::string FeatName = getUniqueObjectName("View");
doCommand(Doc,"App.activeDocument().addObject('Drawing::FeatureViewSpreadsheet','%s')",FeatName.c_str());
doCommand(Doc,"App.activeDocument().%s.Source = App.activeDocument().%s",FeatName.c_str(),SpreadName.c_str());
doCommand(Doc,"App.activeDocument().%s.addObject(App.activeDocument().%s)",PageName.c_str(),FeatName.c_str());
updateActive();
commitCommand();
}
bool CmdDrawingSpreadsheetView::isActive(void)
{
return (getActiveGuiDocument() ? true : false);
}
void CreateDrawingCommands(void)
{
@ -744,4 +793,5 @@ void CreateDrawingCommands(void)
rcCmdMgr.addCommand(new CmdDrawingExportPage());
rcCmdMgr.addCommand(new CmdDrawingProjectShape());
rcCmdMgr.addCommand(new CmdDrawingDraftView());
rcCmdMgr.addCommand(new CmdDrawingSpreadsheetView());
}

View File

@ -20,6 +20,7 @@
<file>icons/actions/drawing-clip.svg</file>
<file>icons/actions/drawing-symbol.svg</file>
<file>icons/actions/drawing-draft-view.svg</file>
<file>icons/actions/drawing-spreadsheet.svg</file>
<file>translations/Drawing_af.qm</file>
<file>translations/Drawing_de.qm</file>
<file>translations/Drawing_fi.qm</file>

View File

@ -0,0 +1,792 @@
<?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="svg2985"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="drawing-spreadsheet.svg">
<defs
id="defs2987">
<linearGradient
id="linearGradient3883">
<stop
style="stop-color:#ffb400;stop-opacity:1;"
offset="0"
id="stop3885" />
<stop
style="stop-color:#ffe900;stop-opacity:1;"
offset="1"
id="stop3887" />
</linearGradient>
<linearGradient
id="linearGradient3793">
<stop
style="stop-color:#000f8a;stop-opacity:1;"
offset="0"
id="stop3795" />
<stop
style="stop-color:#0066ff;stop-opacity:1;"
offset="1"
id="stop3797" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3793-2"
id="linearGradient3799-8"
x1="12.037806"
y1="54.001419"
x2="52.882648"
y2="9.274148"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3793-2">
<stop
style="stop-color:#000f8a;stop-opacity:1;"
offset="0"
id="stop3795-6" />
<stop
style="stop-color:#0066ff;stop-opacity:1;"
offset="1"
id="stop3797-0" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3883-6"
id="linearGradient3889-4"
x1="3"
y1="31.671875"
x2="59.25"
y2="31.671875"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-1.2727273,-0.18181818)" />
<linearGradient
id="linearGradient3883-6">
<stop
style="stop-color:#ffb400;stop-opacity:1;"
offset="0"
id="stop3885-4" />
<stop
style="stop-color:#ffe900;stop-opacity:1;"
offset="1"
id="stop3887-5" />
</linearGradient>
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0526127,0,0,0.7540853,-19.699324,101.21241)"
r="225.89062"
fy="655.5625"
fx="374.42188"
cy="655.5625"
cx="374.42188"
id="radialGradient4475"
xlink:href="#linearGradient3533"
inkscape:collect="always" />
<radialGradient
r="149.30214"
fy="315.40961"
fx="298.10294"
cy="315.40961"
cx="298.10294"
gradientTransform="matrix(1.131046,0,0,0.5900932,-22.100471,489.57569)"
gradientUnits="userSpaceOnUse"
id="radialGradient4466"
xlink:href="#linearGradient3364"
inkscape:collect="always" />
<radialGradient
r="149.30214"
fy="315.40961"
fx="298.10294"
cy="315.40961"
cx="298.10294"
gradientTransform="matrix(1.131046,0,0,1.131204,-22.100471,282.3446)"
gradientUnits="userSpaceOnUse"
id="radialGradient4429"
xlink:href="#linearGradient3364"
inkscape:collect="always" />
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.2871291,0,0,0.588703,-103.70783,273.98098)"
r="143.60872"
fy="641.82562"
fx="361.18896"
cy="641.82562"
cx="361.18896"
id="radialGradient3539"
xlink:href="#linearGradient3533"
inkscape:collect="always" />
<radialGradient
r="149.30214"
fy="315.40961"
fx="298.10294"
cy="315.40961"
cx="298.10294"
gradientTransform="matrix(1.131046,0,0,1.131204,-22.100471,-17.655402)"
gradientUnits="userSpaceOnUse"
id="radialGradient3979"
xlink:href="#linearGradient3364"
inkscape:collect="always" />
<radialGradient
r="141.81195"
fy="249.47238"
fx="317.86237"
cy="249.47238"
cx="317.86237"
spreadMethod="reflect"
gradientTransform="matrix(0.9225535,0.5499376,-0.6128212,1.0614374,218.04449,-49.879453)"
gradientUnits="userSpaceOnUse"
id="radialGradient3976"
xlink:href="#linearGradient6692"
inkscape:collect="always" />
<radialGradient
r="130.08176"
fy="309.10764"
fx="298.66852"
cy="309.10764"
cx="298.66852"
gradientTransform="matrix(0.2436217,0.8776417,-1.1344403,0.3149057,586.4121,-25.658023)"
gradientUnits="userSpaceOnUse"
id="radialGradient3969"
xlink:href="#linearGradient3351"
inkscape:collect="always" />
<radialGradient
r="149.30214"
fy="315.40961"
fx="298.10294"
cy="315.40961"
cx="298.10294"
gradientTransform="matrix(1.131046,0,0,1.131204,-22.100471,-17.655402)"
gradientUnits="userSpaceOnUse"
id="radialGradient3813"
xlink:href="#linearGradient3364"
inkscape:collect="always" />
<radialGradient
r="141.81195"
fy="249.47238"
fx="317.86237"
cy="249.47238"
cx="317.86237"
spreadMethod="reflect"
gradientTransform="matrix(0.9225535,0.5499376,-0.6128212,1.0614374,218.04449,-49.879453)"
gradientUnits="userSpaceOnUse"
id="radialGradient3732"
xlink:href="#linearGradient6692"
inkscape:collect="always" />
<radialGradient
r="130.08176"
fy="314.29395"
fx="290.86432"
cy="314.29395"
cx="290.86432"
gradientTransform="matrix(1.4674635,0,0,1.0734203,-127.41403,-8.614628)"
gradientUnits="userSpaceOnUse"
id="radialGradient3686"
xlink:href="#linearGradient3351"
inkscape:collect="always" />
<radialGradient
r="130.08176"
fy="314.29395"
fx="290.86432"
cy="314.29395"
cx="290.86432"
gradientTransform="matrix(1.4674635,0,0,1.0734203,-134.66628,-8.6146276)"
gradientUnits="userSpaceOnUse"
id="radialGradient3396"
xlink:href="#linearGradient3351"
inkscape:collect="always" />
<radialGradient
r="141.81195"
fy="249.47238"
fx="317.86237"
cy="249.47238"
cx="317.86237"
gradientTransform="matrix(0.9225535,0.5499376,-0.6128212,1.0614374,210.79224,-49.879453)"
gradientUnits="userSpaceOnUse"
id="radialGradient3394"
xlink:href="#linearGradient6692"
inkscape:collect="always" />
<radialGradient
r="149.30214"
fy="315.40961"
fx="298.10294"
cy="315.40961"
cx="298.10294"
gradientTransform="matrix(1.131046,0,0,1.131204,-29.352716,-17.655402)"
gradientUnits="userSpaceOnUse"
id="radialGradient3392"
xlink:href="#linearGradient3364"
inkscape:collect="always" />
<radialGradient
r="179.50987"
fy="365.75668"
fx="318.06638"
cy="365.75668"
cx="318.06638"
gradientTransform="matrix(1.0565445,0,0,0.5956187,-200.72763,179.91578)"
gradientUnits="userSpaceOnUse"
id="radialGradient3385"
xlink:href="#linearGradient4328"
inkscape:collect="always" />
<radialGradient
r="179.38509"
fy="244.68217"
fx="333.362"
cy="244.68217"
cx="333.362"
gradientTransform="matrix(1.0565445,0,0,0.5952981,-200.72763,124.1879)"
gradientUnits="userSpaceOnUse"
id="radialGradient3383"
xlink:href="#linearGradient4328"
inkscape:collect="always" />
<radialGradient
r="179.50987"
fy="365.75668"
fx="318.06638"
cy="365.75668"
cx="318.06638"
gradientTransform="matrix(1.0565445,0,0,0.5956187,-200.72763,179.91578)"
gradientUnits="userSpaceOnUse"
id="radialGradient3377"
xlink:href="#linearGradient4328"
inkscape:collect="always" />
<radialGradient
r="179.38509"
fy="244.68217"
fx="333.362"
cy="244.68217"
cx="333.362"
gradientTransform="matrix(1.0565445,0,0,0.5952981,-200.72763,124.1879)"
gradientUnits="userSpaceOnUse"
id="radialGradient3375"
xlink:href="#linearGradient4328"
inkscape:collect="always" />
<radialGradient
r="141.81195"
fy="249.47238"
fx="317.86237"
cy="249.47238"
cx="317.86237"
gradientTransform="matrix(0.9225535,0.5499376,-0.6128212,1.0614374,-0.1554987,-133.93797)"
gradientUnits="userSpaceOnUse"
id="radialGradient3373"
xlink:href="#linearGradient6692"
inkscape:collect="always" />
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.131046,0,0,1.131204,-29.352716,-17.655402)"
r="149.30214"
fy="315.40961"
fx="298.10294"
cy="315.40961"
cx="298.10294"
id="radialGradient3361"
xlink:href="#linearGradient3364"
inkscape:collect="always" />
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.4674635,0,0,1.0734203,-134.66628,-8.6146276)"
r="130.08176"
fy="314.29395"
fx="290.86432"
cy="314.29395"
cx="290.86432"
id="radialGradient3357"
xlink:href="#linearGradient3351"
inkscape:collect="always" />
<radialGradient
r="179.50987"
fy="365.75668"
fx="318.06638"
cy="365.75668"
cx="318.06638"
gradientTransform="matrix(1.0565445,0,0,0.5956187,10.2201,263.97431)"
gradientUnits="userSpaceOnUse"
id="radialGradient2337"
xlink:href="#linearGradient4328"
inkscape:collect="always" />
<linearGradient
id="linearGradient4328">
<stop
id="stop4330"
offset="0"
style="stop-color:#398fe5;stop-opacity:1;" />
<stop
id="stop4332"
offset="1"
style="stop-color:#0066cc;stop-opacity:1" />
</linearGradient>
<radialGradient
r="179.38509"
fy="244.68217"
fx="333.362"
cy="244.68217"
cx="333.362"
gradientTransform="matrix(1.0565445,0,0,0.5952981,10.2201,208.24643)"
gradientUnits="userSpaceOnUse"
id="radialGradient2335"
xlink:href="#linearGradient4328"
inkscape:collect="always" />
<radialGradient
r="141.81195"
fy="249.47238"
fx="317.86237"
cy="249.47238"
cx="317.86237"
gradientTransform="matrix(0.9225535,0.5499376,-0.6128212,1.0614374,210.79224,-49.879453)"
gradientUnits="userSpaceOnUse"
id="radialGradient2331"
xlink:href="#linearGradient6692"
inkscape:collect="always" />
<linearGradient
id="linearGradient6692">
<stop
id="stop6694"
offset="0"
style="stop-color:#9bffbd;stop-opacity:1;" />
<stop
style="stop-color:#689e33;stop-opacity:1;"
offset="1"
id="stop6700" />
</linearGradient>
<linearGradient
id="linearGradient3364">
<stop
id="stop3366"
offset="0"
style="stop-color:#79a7fc;stop-opacity:1;" />
<stop
id="stop3368"
offset="1"
style="stop-color:#1d3340;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3351">
<stop
id="stop3353"
offset="0"
style="stop-color:#ffffff;stop-opacity:0.86734694;" />
<stop
id="stop3355"
offset="1"
style="stop-color:#ffffff;stop-opacity:0;" />
</linearGradient>
<radialGradient
r="19.966738"
fy="578.88593"
fx="82.9272"
cy="578.88593"
cx="82.9272"
gradientTransform="matrix(7.6237907,4.4015976,-5.0675166,8.7771962,2328.4492,-5270.6109)"
gradientUnits="userSpaceOnUse"
id="radialGradient2333"
xlink:href="#linearGradient3364"
inkscape:collect="always" />
<linearGradient
id="linearGradient3615">
<stop
id="stop3619"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
style="stop-color:#398fe5;stop-opacity:1;"
offset="1"
id="stop3621" />
</linearGradient>
<linearGradient
id="linearGradient3624">
<stop
style="stop-color:#398fe5;stop-opacity:1;"
offset="0"
id="stop3628" />
<stop
id="stop3630"
offset="1"
style="stop-color:#acc1d5;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3533">
<stop
id="stop3535"
offset="0"
style="stop-color:#3a3a3a;stop-opacity:1;" />
<stop
id="stop3537"
offset="1"
style="stop-color:#ffffff;stop-opacity:1;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3364"
id="radialGradient3258"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.131046,0,0,1.131204,-22.100471,-17.655402)"
cx="298.10294"
cy="315.40961"
fx="298.10294"
fy="315.40961"
r="149.30214" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient6692"
id="radialGradient3260"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9225535,0.5499376,-0.6128212,1.0614374,218.04449,-49.879453)"
spreadMethod="reflect"
cx="317.86237"
cy="249.47238"
fx="317.86237"
fy="249.47238"
r="141.81195" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3351"
id="radialGradient3262"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.2436217,0.8776417,-1.1344403,0.3149057,586.4121,-25.658023)"
cx="298.66852"
cy="309.10764"
fx="298.66852"
fy="309.10764"
r="130.08176" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3364"
id="radialGradient3268"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.131046,0,0,1.131204,-22.100471,-17.655402)"
cx="298.10294"
cy="315.40961"
fx="298.10294"
fy="315.40961"
r="149.30214" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient6692"
id="radialGradient3270"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9225535,0.5499376,-0.6128212,1.0614374,218.04449,-49.879453)"
spreadMethod="reflect"
cx="317.86237"
cy="249.47238"
fx="317.86237"
fy="249.47238"
r="141.81195" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3351"
id="radialGradient3272"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.2436217,0.8776417,-1.1344403,0.3149057,586.4121,-25.658023)"
cx="298.66852"
cy="309.10764"
fx="298.66852"
fy="309.10764"
r="130.08176" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3351"
id="radialGradient3275"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.2436217,0.8776417,-1.1344403,0.3149057,23.62227,-368.49652)"
cx="298.66852"
cy="309.10764"
fx="298.66852"
fy="309.10764"
r="130.08176" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient6692"
id="radialGradient3278"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9225535,0.5499376,-0.6128212,1.0614374,-344.74534,-392.71795)"
spreadMethod="reflect"
cx="317.86237"
cy="249.47238"
fx="317.86237"
fy="249.47238"
r="141.81195" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3364"
id="radialGradient3281"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.1174411,0,0,0.1174575,-18.224818,-25.892201)"
cx="298.10294"
cy="315.40961"
fx="298.10294"
fy="315.40961"
r="149.30214" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient6692"
id="radialGradient3284"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9225535,0.5499376,-0.6128212,1.0614374,-344.74534,-392.71795)"
spreadMethod="reflect"
cx="317.86237"
cy="249.47238"
fx="317.86237"
fy="249.47238"
r="141.81195" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient6692"
id="radialGradient3287"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9225535,0.5499376,-0.6128212,1.0614374,-344.74534,-392.71795)"
spreadMethod="reflect"
cx="317.86237"
cy="249.47238"
fx="317.86237"
fy="249.47238"
r="141.81195" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient6692"
id="radialGradient3290"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.09579247,0.05710226,-0.06363172,0.11021335,6.7104086,-29.238154)"
spreadMethod="reflect"
cx="317.86237"
cy="249.47238"
fx="317.86237"
fy="249.47238"
r="141.81195" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3364-1"
id="radialGradient3281-8"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.1174411,0,0,0.1174575,-18.224818,-25.892201)"
cx="298.10294"
cy="315.40961"
fx="298.10294"
fy="315.40961"
r="149.30214" />
<linearGradient
id="linearGradient3364-1">
<stop
id="stop3366-0"
offset="0"
style="stop-color:#79a7fc;stop-opacity:1;" />
<stop
id="stop3368-2"
offset="1"
style="stop-color:#1d3340;stop-opacity:1;" />
</linearGradient>
<radialGradient
r="149.30214"
fy="315.40961"
fx="298.10294"
cy="315.40961"
cx="298.10294"
gradientTransform="matrix(0.1174411,0,0,0.1174575,-24.327872,-29.478297)"
gradientUnits="userSpaceOnUse"
id="radialGradient4075"
xlink:href="#linearGradient3364-1"
inkscape:collect="always" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3364-7"
id="radialGradient3281-0"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.1174411,0,0,0.1174575,-18.224818,-25.892201)"
cx="298.10294"
cy="315.40961"
fx="298.10294"
fy="315.40961"
r="149.30214" />
<linearGradient
id="linearGradient3364-7">
<stop
id="stop3366-6"
offset="0"
style="stop-color:#79a7fc;stop-opacity:1;" />
<stop
id="stop3368-3"
offset="1"
style="stop-color:#1d3340;stop-opacity:1;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3364"
id="radialGradient4158"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.1174411,0,0,0.1174575,-18.224818,-25.892201)"
cx="298.10294"
cy="315.40961"
fx="298.10294"
fy="315.40961"
r="149.30214" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient6692"
id="radialGradient4160"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.09579247,0.05710226,-0.06363172,0.11021335,6.7104086,-29.238154)"
spreadMethod="reflect"
cx="317.86237"
cy="249.47238"
fx="317.86237"
fy="249.47238"
r="141.81195" />
<radialGradient
gradientUnits="userSpaceOnUse"
r="19.467436"
fy="28.869568"
fx="45.883327"
cy="28.869568"
cx="45.883327"
id="radialGradient3692"
xlink:href="#linearGradient3377"
inkscape:collect="always" />
<radialGradient
gradientTransform="matrix(0.97435,0.2250379,-0.4623105,2.0016728,48.487554,-127.99883)"
r="19.467436"
fy="97.369568"
fx="135.38333"
cy="97.369568"
cx="135.38333"
gradientUnits="userSpaceOnUse"
id="radialGradient3703"
xlink:href="#linearGradient3377"
inkscape:collect="always" />
<linearGradient
id="linearGradient3377">
<stop
style="stop-color:#faff2b;stop-opacity:1;"
offset="0"
id="stop3379" />
<stop
style="stop-color:#ffaa00;stop-opacity:1;"
offset="1"
id="stop3381" />
</linearGradient>
<radialGradient
gradientTransform="matrix(1.3852588,-0.05136783,0.03705629,0.9993132,-60.392403,7.7040438)"
r="19.467436"
fy="81.869568"
fx="148.88333"
cy="81.869568"
cx="148.88333"
gradientUnits="userSpaceOnUse"
id="radialGradient3705"
xlink:href="#linearGradient3377"
inkscape:collect="always" />
<inkscape:perspective
id="perspective2868"
inkscape:persp3d-origin="32 : 21.333333 : 1"
inkscape:vp_z="64 : 32 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 32 : 1"
sodipodi:type="inkscape:persp3d" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.5"
inkscape:cx="2.1719797"
inkscape:cy="32.387587"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1920"
inkscape:window-height="1053"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata2990">
<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></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g4153">
<path
inkscape:connector-curvature="0"
id="rect3005-1"
d="m 6.208006,14.025321 0,41.67663 45.365638,0 11.036532,-8.201181 0,-33.475449 -56.40217,0 z"
style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.95121026000000009;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;opacity:0.54166667" />
<path
inkscape:connector-curvature="0"
id="rect3005"
d="m 3.0693551,10.163105 0,41.676631 45.3656379,0 11.036532,-8.201181 0,-33.47545 -56.4021699,0 z"
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#3f3f3f;stroke-width:1.95121026;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
sodipodi:nodetypes="cccc"
inkscape:connector-curvature="0"
id="path3778"
d="m 59.296915,43.948975 c 0.160894,-1.443027 -0.62697,-3.44837 -4.966718,-4.52326 0,0 -1.330371,7.361384 -5.232791,11.884644 z"
style="color:#000000;fill:#b4b4b4;fill-opacity:1;fill-rule:evenodd;stroke:#3f3f3f;stroke-width:1.95121026;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" />
</g>
<g
id="layer2"
inkscape:label="layer2"
transform="translate(-562.78983,-342.8385)" />
<g
inkscape:label="Layer 1"
id="layer1-7"
transform="matrix(0.6115108,0,0,0.6115108,7.5206005,11.370829)">
<rect
y="9.272728"
x="4"
height="46.545456"
width="56.18182"
id="rect3002"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
<rect
y="9.272728"
x="4"
height="46.545456"
width="56.18182"
id="rect3002-9"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
id="path3790"
d="m 4,20.545455 55.636364,0"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path3792"
d="M 20.909091,9.6363636 20.909091,56"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path3794"
d="m 4,32.429811 55.090909,0"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path3796"
d="m 4,44.483064 55.636364,0"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -66,6 +66,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
*part << "Drawing_Clip";
*part << "Drawing_Symbol";
*part << "Drawing_DraftView";
*part << "Drawing_SpreadsheetView";
*part << "Drawing_ExportPage";
*part << "Separator";
*part << "Drawing_ProjectShape";
@ -88,6 +89,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
*part << "Drawing_Clip";
*part << "Drawing_Symbol";
*part << "Drawing_DraftView";
*part << "Drawing_SpreadsheetView";
*part << "Drawing_ExportPage";
return root;
}