Merge branch 'master' into openscadLinearExtrudeAngleFix

This commit is contained in:
Chris Hennes
2021-04-16 11:52:58 -05:00
committed by GitHub
46 changed files with 795 additions and 776 deletions

1
.gitignore vendored
View File

@@ -34,7 +34,6 @@ install_manifest.txt
/src/Tools/offlinedoc/localwiki/
/src/Tools/offlinedoc/*.txt
OpenSCAD_rc.py
.subuser-dev
/\.idea/
.tags
tags

View File

@@ -1 +0,0 @@
{"image-sources-dir": "./subuser"}

View File

@@ -185,11 +185,12 @@ public:
}
operator T() const
{
// cast the PyObject pointer to the matching sub-class
// and call then the defined member function
return getValue();
}
PyT* getPy() const
{
PyT* py = static_cast<PyT*>(ptr());
T* v = (py->*valuePtr)();
return *v;
return py;
}
private:

View File

@@ -103,11 +103,7 @@ PyTypeObject PyObjectBase::Type = {
/* --- Functions to access object as input/output buffer ---------*/
0, /* tp_as_buffer */
/* --- Flags to define presence of optional/expanded features */
#if PY_MAJOR_VERSION >= 3
Py_TPFLAGS_BASETYPE|Py_TPFLAGS_DEFAULT, /*tp_flags */
#else
Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_CLASS, /*tp_flags */
#endif
"The most base class for Python binding", /*tp_doc */
0, /*tp_traverse */
0, /*tp_clear */
@@ -134,10 +130,8 @@ PyTypeObject PyObjectBase::Type = {
0, /*tp_subclasses */
0, /*tp_weaklist */
0, /*tp_del */
0 /*tp_version_tag */
#if PY_MAJOR_VERSION >= 3
,0 /*tp_finalize */
#endif
0, /*tp_version_tag */
0 /*tp_finalize */
#if PY_VERSION_HEX >= 0x03090000
,0 /*tp_vectorcall */
#elif PY_VERSION_HEX >= 0x03080000
@@ -161,11 +155,7 @@ PyMethodDef PyObjectBase::Methods[] = {
PyObject* PyObjectBase::__getattro(PyObject * obj, PyObject *attro)
{
const char *attr;
#if PY_MAJOR_VERSION >= 3
attr = PyUnicode_AsUTF8(attro);
#else
attr = PyString_AsString(attro);
#endif
// For the __class__ attribute get it directly as with
// ExtensionContainerPy::getCustomAttributes we may get
@@ -204,7 +194,9 @@ PyObject* PyObjectBase::__getattro(PyObject * obj, PyObject *attro)
pyObj->trackAttribute(attr, value);
}
}
else if (value && PyCFunction_Check(value)) {
else
#endif
if (value && PyCFunction_Check(value)) {
// ExtensionContainerPy::initialization() transfers the methods of an
// extension object by creating PyCFunction objects.
// At this point no 'self' object is passed but is handled and determined
@@ -220,18 +212,14 @@ PyObject* PyObjectBase::__getattro(PyObject * obj, PyObject *attro)
PyErr_Format(PyExc_AttributeError, "<no object bound to built-in method %s>", attr);
}
}
#endif
return value;
}
int PyObjectBase::__setattro(PyObject *obj, PyObject *attro, PyObject *value)
{
const char *attr;
#if PY_MAJOR_VERSION >= 3
attr = PyUnicode_AsUTF8(attro);
#else
attr = PyString_AsString(attro);
#endif
//FIXME: In general we don't allow to delete attributes (i.e. value=0). However, if we want to allow
//we must check then in _setattr() of all subclasses whether value is 0.
@@ -294,11 +282,7 @@ PyObject *PyObjectBase::_getattr(const char *attr)
else {
// As fallback solution use Python's default method to get generic attributes
PyObject *w, *res;
#if PY_MAJOR_VERSION >= 3
w = PyUnicode_InternFromString(attr);
#else
w = PyString_InternFromString(attr);
#endif
if (w != NULL) {
res = PyObject_GenericGetAttr(this, w);
Py_XDECREF(w);
@@ -318,11 +302,7 @@ int PyObjectBase::_setattr(const char *attr, PyObject *value)
return -1; // filter out softspace
PyObject *w;
// As fallback solution use Python's default method to get generic attributes
#if PY_MAJOR_VERSION >= 3
w = PyUnicode_InternFromString(attr); // new reference
#else
w = PyString_InternFromString(attr); // new reference
#endif
if (w != NULL) {
// call methods from tp_getset if defined
int res = PyObject_GenericSetAttr(this, w, value);
@@ -354,13 +334,8 @@ void PyObjectBase::resetAttribute()
if (attrDict) {
// This is the attribute name to the parent structure
// which we search for in the dict
#if PY_MAJOR_VERSION < 3
PyObject* key1 = PyString_FromString("__attribute_of_parent__");
PyObject* key2 = PyString_FromString("__instance_of_parent__");
#else
PyObject* key1 = PyBytes_FromString("__attribute_of_parent__");
PyObject* key2 = PyBytes_FromString("__instance_of_parent__");
#endif
PyObject* attr = PyDict_GetItem(attrDict, key1);
PyObject* inst = PyDict_GetItem(attrDict, key2);
if (attr) {
@@ -379,15 +354,9 @@ void PyObjectBase::setAttributeOf(const char* attr, PyObject* par)
if (!attrDict) {
attrDict = PyDict_New();
}
#if PY_MAJOR_VERSION < 3
PyObject* key1 = PyString_FromString("__attribute_of_parent__");
PyObject* key2 = PyString_FromString("__instance_of_parent__");
PyObject* attro = PyString_FromString(attr);
#else
PyObject* key1 = PyBytes_FromString("__attribute_of_parent__");
PyObject* key2 = PyBytes_FromString("__instance_of_parent__");
PyObject* attro = PyUnicode_FromString(attr);
#endif
PyDict_SetItem(attrDict, key1, attro);
PyDict_SetItem(attrDict, key2, par);
Py_DECREF(attro);
@@ -403,13 +372,8 @@ void PyObjectBase::startNotify()
if (attrDict) {
// This is the attribute name to the parent structure
// which we search for in the dict
#if PY_MAJOR_VERSION < 3
PyObject* key1 = PyString_FromString("__attribute_of_parent__");
PyObject* key2 = PyString_FromString("__instance_of_parent__");
#else
PyObject* key1 = PyBytes_FromString("__attribute_of_parent__");
PyObject* key2 = PyBytes_FromString("__instance_of_parent__");
#endif
PyObject* attr = PyDict_GetItem(attrDict, key1);
PyObject* parent = PyDict_GetItem(attrDict, key2);
if (attr && parent) {

View File

@@ -463,12 +463,10 @@ BaseExport extern PyObject* BaseExceptionFreeCADAbort;
#define __PY_CATCH(R) \
catch(Base::AbortException &e) \
{ \
e.ReportException(); \
_Py_ErrorObj(R,Base::BaseExceptionFreeCADAbort,e.getPyObject());\
} \
catch(Base::Exception &e) \
{ \
e.ReportException(); \
auto pye = e.getPyExceptionType(); \
if(!pye) \
pye = Base::BaseExceptionFreeCADError; \

View File

@@ -672,25 +672,31 @@ void QuantityPy::setFormat(Py::Dict arg)
PyObject *QuantityPy::getCustomAttributes(const char* attr) const
{
QuantityPy* py = nullptr;
if (strcmp(attr, "Torr") == 0) {
return new QuantityPy(new Quantity(Quantity::Torr));
py = new QuantityPy(new Quantity(Quantity::Torr));
}
else if (strcmp(attr, "mTorr") == 0) {
return new QuantityPy(new Quantity(Quantity::mTorr));
py = new QuantityPy(new Quantity(Quantity::mTorr));
}
else if (strcmp(attr, "yTorr") == 0) {
return new QuantityPy(new Quantity(Quantity::yTorr));
py = new QuantityPy(new Quantity(Quantity::yTorr));
}
else if (strcmp(attr, "PoundForce") == 0) {
return new QuantityPy(new Quantity(Quantity::PoundForce));
py = new QuantityPy(new Quantity(Quantity::PoundForce));
}
else if (strcmp(attr, "AngularMinute") == 0) {
return new QuantityPy(new Quantity(Quantity::AngMinute));
py = new QuantityPy(new Quantity(Quantity::AngMinute));
}
else if (strcmp(attr, "AngularSecond") == 0) {
return new QuantityPy(new Quantity(Quantity::AngSecond));
py = new QuantityPy(new Quantity(Quantity::AngSecond));
}
return 0;
if (py) {
py->setNotTracking();
}
return py;
}
int QuantityPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -737,11 +737,7 @@ PyObject* Application::sGetLocale(PyObject * /*self*/, PyObject *args)
return NULL;
std::string locale = Translator::instance()->activeLanguage();
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromString(locale.c_str());
#else
return PyString_FromString(locale.c_str());
#endif
}
PyObject* Application::sSetLocale(PyObject * /*self*/, PyObject *args)
@@ -819,11 +815,7 @@ PyObject* Application::sAddPreferencePage(PyObject * /*self*/, PyObject *args)
PyObject* dlg;
// old style classes
#if PY_MAJOR_VERSION >= 3
if (PyArg_ParseTuple(args, "O!s", &PyType_Type, &dlg, &grp)) {
#else
if (PyArg_ParseTuple(args, "O!s", &PyClass_Type, &dlg, &grp)) {
#endif
// add to the preferences dialog
new PrefPagePyProducer(Py::Object(dlg), grp);

View File

@@ -77,11 +77,7 @@ PyObject* CommandPy::listAll(PyObject *args)
PyObject* pyList = PyList_New(cmds.size());
int i=0;
for ( std::vector<Command*>::iterator it = cmds.begin(); it != cmds.end(); ++it ) {
#if PY_MAJOR_VERSION >= 3
PyObject* str = PyUnicode_FromString((*it)->getName());
#else
PyObject* str = PyString_FromString((*it)->getName());
#endif
PyList_SetItem(pyList, i++, str);
}
return pyList;
@@ -123,11 +119,7 @@ PyObject* CommandPy::listByShortcut(PyObject *args)
PyObject* pyList = PyList_New(matches.size());
int i=0;
for (std::string match : matches) {
#if PY_MAJOR_VERSION >= 3
PyObject* str = PyUnicode_FromString(match.c_str());
#else
PyObject* str = PyString_FromString(match.c_str());
#endif
PyList_SetItem(pyList, i++, str);
}
return pyList;
@@ -178,11 +170,7 @@ PyObject* CommandPy::getShortcut(PyObject *args)
Command* cmd = this->getCommandPtr();
if (cmd) {
#if PY_MAJOR_VERSION >= 3
PyObject* str = PyUnicode_FromString(cmd->getAction() ? cmd->getAction()->shortcut().toString().toStdString().c_str() : "");
#else
PyObject* str = PyString_FromString(cmd->getAction() ? cmd->getAction()->shortcut().toString().toStdString().c_str() : "");
#endif
return str;
}
else {
@@ -283,21 +271,12 @@ PyObject* CommandPy::getInfo(PyObject *args)
if (action)
shortcutTxt = action->shortcut().toString().toStdString();
#if PY_MAJOR_VERSION >= 3
PyObject* strMenuTxt = PyUnicode_FromString(menuTxt ? menuTxt : "");
PyObject* strTooltipTxt = PyUnicode_FromString(tooltipTxt ? tooltipTxt : "");
PyObject* strWhatsThisTxt = PyUnicode_FromString(whatsThisTxt ? whatsThisTxt : "");
PyObject* strStatustipTxt = PyUnicode_FromString(statustipTxt ? statustipTxt : "");
PyObject* strPixMapTxt = PyUnicode_FromString(pixMapTxt ? pixMapTxt : "");
PyObject* strShortcutTxt = PyUnicode_FromString(!shortcutTxt.empty() ? shortcutTxt.c_str() : "");
#else
PyObject* strMenuTxt = PyString_FromString(menuTxt ? menuTxt : "");
PyObject* strTooltipTxt = PyString_FromString(tooltipTxt ? tooltipTxt : "");
PyObject* strWhatsThisTxt = PyString_FromString(whatsThisTxt ? whatsThisTxt : "");
PyObject* strStatustipTxt = PyString_FromString(statustipTxt ? statustipTxt : "");
PyObject* strPixMapTxt = PyString_FromString(pixMapTxt ? pixMapTxt : "");
PyObject* strShortcutTxt = PyString_FromString(!shortcutTxt.empty() ? shortcutTxt.c_str() : "");
#endif
PyList_SetItem(pyList, 0, strMenuTxt);
PyList_SetItem(pyList, 1, strTooltipTxt);
PyList_SetItem(pyList, 2, strWhatsThisTxt);

View File

@@ -194,7 +194,8 @@ QString FileDialog::getSaveFileName (QWidget * parent, const QString & caption,
FileDialog dlg(parent);
dlg.setWindowTitle(windowTitle);
dlg.setSidebarUrls(urls);
dlg.setIconProvider(new FileIconProvider());
auto iconprov = std::make_unique<FileIconProvider>();
dlg.setIconProvider(iconprov.get());
dlg.setFileMode(QFileDialog::AnyFile);
dlg.setAcceptMode(QFileDialog::AcceptSave);
dlg.setDirectory(dirName);

View File

@@ -0,0 +1,550 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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"
width="64"
height="64"
id="svg11300"
version="1.1">
<title
id="title933">Std_MarkToRecompute</title>
<defs
id="defs3">
<linearGradient
id="linearGradient951">
<stop
style="stop-color:#4e9a06;stop-opacity:1"
offset="0"
id="stop947" />
<stop
style="stop-color:#8ae234;stop-opacity:1"
offset="1"
id="stop949" />
</linearGradient>
<linearGradient
id="linearGradient3063">
<stop
id="stop3065"
offset="0"
style="stop-color:#729fcf;stop-opacity:1" />
<stop
id="stop3067"
offset="1"
style="stop-color:#204a87;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient2690">
<stop
style="stop-color:#c4d7eb;stop-opacity:1;"
offset="0"
id="stop2692" />
<stop
style="stop-color:#c4d7eb;stop-opacity:0;"
offset="1"
id="stop2694" />
</linearGradient>
<linearGradient
id="linearGradient2682">
<stop
style="stop-color:#3977c3;stop-opacity:1;"
offset="0"
id="stop2684" />
<stop
style="stop-color:#89aedc;stop-opacity:0;"
offset="1"
id="stop2686" />
</linearGradient>
<linearGradient
id="linearGradient2402">
<stop
style="stop-color:#729fcf;stop-opacity:1;"
offset="0"
id="stop2404" />
<stop
style="stop-color:#528ac5;stop-opacity:1;"
offset="1"
id="stop2406" />
</linearGradient>
<linearGradient
id="linearGradient2380">
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="0"
id="stop2382" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop2384" />
</linearGradient>
<linearGradient
id="linearGradient2871">
<stop
style="stop-color:#3465a4;stop-opacity:1;"
offset="0"
id="stop2873" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop2875" />
</linearGradient>
<linearGradient
id="linearGradient2847">
<stop
style="stop-color:#3465a4;stop-opacity:1;"
offset="0"
id="stop2849" />
<stop
style="stop-color:#3465a4;stop-opacity:0;"
offset="1"
id="stop2851" />
</linearGradient>
<linearGradient
id="linearGradient2831">
<stop
style="stop-color:#3465a4;stop-opacity:1;"
offset="0"
id="stop2833" />
<stop
id="stop2855"
offset="0.33333334"
style="stop-color:#5b86be;stop-opacity:1;" />
<stop
style="stop-color:#83a8d8;stop-opacity:0;"
offset="1"
id="stop2835" />
</linearGradient>
<linearGradient
id="linearGradient2797">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2799" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop2801" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient2831"
id="linearGradient1486"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.370336,0,0,1.3589114,0.02150968,-18.214919)"
x1="13.478554"
y1="10.612206"
x2="15.419417"
y2="19.115122" />
<linearGradient
xlink:href="#linearGradient2847"
id="linearGradient1488"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-1.370336,0,0,-1.3589114,64.512944,44.464873)"
x1="37.128052"
y1="29.729605"
x2="37.065414"
y2="26.194071" />
<linearGradient
xlink:href="#linearGradient2797"
id="linearGradient1491"
gradientUnits="userSpaceOnUse"
x1="5.9649177"
y1="26.048164"
x2="52.854095"
y2="26.048164" />
<linearGradient
xlink:href="#linearGradient2797"
id="linearGradient1493"
gradientUnits="userSpaceOnUse"
x1="5.9649177"
y1="26.048164"
x2="52.854095"
y2="26.048164" />
<linearGradient
xlink:href="#linearGradient2871"
id="linearGradient1501"
gradientUnits="userSpaceOnUse"
x1="46.834816"
y1="45.264122"
x2="45.380436"
y2="50.939667" />
<linearGradient
xlink:href="#linearGradient3063"
id="linearGradient2386"
x1="42.703487"
y1="20.547306"
x2="26.605606"
y2="33.634254"
gradientUnits="userSpaceOnUse" />
<linearGradient
xlink:href="#linearGradient2402"
id="linearGradient2408"
x1="18.935766"
y1="23.667896"
x2="53.588623"
y2="26.649363"
gradientUnits="userSpaceOnUse" />
<linearGradient
xlink:href="#linearGradient2682"
id="linearGradient2688"
x1="36.713837"
y1="31.455952"
x2="37.124462"
y2="24.842253"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.370336,0,0,1.3589114,-0.33380651,-16.948724)" />
<linearGradient
xlink:href="#linearGradient2690"
id="linearGradient2696"
x1="32.647972"
y1="30.748846"
x2="37.124462"
y2="24.842253"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.370336,0,0,1.3589114,-0.33380651,-16.948724)" />
<linearGradient
xlink:href="#linearGradient2380"
id="linearGradient3034"
gradientUnits="userSpaceOnUse"
x1="41.791897"
y1="20.134634"
x2="23.705669"
y2="34.083359" />
<linearGradient
xlink:href="#linearGradient2871"
id="linearGradient3036"
gradientUnits="userSpaceOnUse"
x1="46.834816"
y1="45.264122"
x2="45.380436"
y2="50.939667" />
<linearGradient
xlink:href="#linearGradient2402"
id="linearGradient3038"
gradientUnits="userSpaceOnUse"
x1="18.935766"
y1="23.667896"
x2="53.588623"
y2="26.649363" />
<linearGradient
xlink:href="#linearGradient2871"
id="linearGradient3040"
gradientUnits="userSpaceOnUse"
x1="46.834816"
y1="45.264122"
x2="45.380436"
y2="50.939667" />
<linearGradient
xlink:href="#linearGradient2831-7"
id="linearGradient1486-1"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.370336,0,0,1.3589114,0.30396568,-17.325948)"
x1="13.478554"
y1="10.612206"
x2="15.419417"
y2="19.115122" />
<linearGradient
id="linearGradient2831-7">
<stop
style="stop-color:#3465a4;stop-opacity:1;"
offset="0"
id="stop2833-4" />
<stop
id="stop2855-0"
offset="0.33333334"
style="stop-color:#5b86be;stop-opacity:1;" />
<stop
style="stop-color:#83a8d8;stop-opacity:0;"
offset="1"
id="stop2835-9" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient2847-8"
id="linearGradient1488-4"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-1.370336,0,0,-1.3589114,64.7954,45.353844)"
x1="37.128052"
y1="29.729605"
x2="37.065414"
y2="26.194071" />
<linearGradient
id="linearGradient2847-8">
<stop
style="stop-color:#3465a4;stop-opacity:1;"
offset="0"
id="stop2849-8" />
<stop
style="stop-color:#3465a4;stop-opacity:0;"
offset="1"
id="stop2851-2" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient2380-5"
id="linearGradient2386-4"
x1="62.513836"
y1="36.061237"
x2="15.984863"
y2="20.60858"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient2380-5">
<stop
style="stop-color:#b9cfe7;stop-opacity:1"
offset="0"
id="stop2382-5" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop2384-1" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient2380-5"
id="linearGradient3034-7"
gradientUnits="userSpaceOnUse"
x1="62.513836"
y1="36.061237"
x2="15.984863"
y2="20.60858" />
<linearGradient
id="linearGradient3895">
<stop
style="stop-color:#b9cfe7;stop-opacity:1"
offset="0"
id="stop3897" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop3899" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient2797-1"
id="linearGradient3861-1"
gradientUnits="userSpaceOnUse"
x1="5.9649177"
y1="26.048164"
x2="52.854095"
y2="26.048164" />
<linearGradient
id="linearGradient2797-1">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2799-5" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop2801-2" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient3063"
id="linearGradient3858"
gradientUnits="userSpaceOnUse"
x1="42.703487"
y1="20.547306"
x2="26.605606"
y2="33.634254" />
<linearGradient
xlink:href="#linearGradient2831-2"
id="linearGradient1486-5"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.370336,0,0,1.3589114,0.02150968,-18.214919)"
x1="13.478554"
y1="10.612206"
x2="15.419417"
y2="19.115122" />
<linearGradient
id="linearGradient2831-2">
<stop
style="stop-color:#3465a4;stop-opacity:1;"
offset="0"
id="stop2833-3" />
<stop
id="stop2855-1"
offset="0.33333334"
style="stop-color:#5b86be;stop-opacity:1;" />
<stop
style="stop-color:#83a8d8;stop-opacity:0;"
offset="1"
id="stop2835-6" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient2847-82"
id="linearGradient1488-8"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-1.370336,0,0,-1.3589114,64.512944,44.464873)"
x1="37.128052"
y1="29.729605"
x2="37.065414"
y2="26.194071" />
<linearGradient
id="linearGradient2847-82">
<stop
style="stop-color:#3465a4;stop-opacity:1;"
offset="0"
id="stop2849-7" />
<stop
style="stop-color:#3465a4;stop-opacity:0;"
offset="1"
id="stop2851-7" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient3063-2"
id="linearGradient3858-1"
gradientUnits="userSpaceOnUse"
x1="42.703487"
y1="20.547306"
x2="26.605606"
y2="33.634254" />
<linearGradient
id="linearGradient3063-2">
<stop
id="stop3065-6"
offset="0"
style="stop-color:#729fcf;stop-opacity:1" />
<stop
id="stop3067-0"
offset="1"
style="stop-color:#204a87;stop-opacity:1" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient2380-9"
id="linearGradient3034-4"
gradientUnits="userSpaceOnUse"
x1="26.221533"
y1="31.125586"
x2="46.731483"
y2="21.766298" />
<linearGradient
id="linearGradient2380-9">
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="0"
id="stop2382-4" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop2384-6" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient951"
id="linearGradient953"
x1="25.582823"
y1="38.607929"
x2="22.003767"
y2="11.384317"
gradientUnits="userSpaceOnUse" />
</defs>
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:creator>
<cc:Agent>
<dc:title>[bitacovir]</dc:title>
</cc:Agent>
</dc:creator>
<dc:source></dc:source>
<cc:license
rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" />
<dc:title>Std_MarkToRecompute</dc:title>
<dc:subject>
<rdf:Bag />
</dc:subject>
<dc:date>11-04-2021</dc:date>
<dc:rights>
<cc:Agent>
<dc:title>FreeCAD LGPL2+</dc:title>
</cc:Agent>
</dc:rights>
<dc:publisher>
<cc:Agent>
<dc:title>FreeCAD</dc:title>
</cc:Agent>
</dc:publisher>
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/publicdomain/zero/1.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
<g
id="layer1"
transform="translate(0,16)">
<path
style="fill:url(#linearGradient953);fill-opacity:1;stroke:#172a04;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 9.8699279,14.272787 2.9831069,27.33239 25.917989,44.955793 60.955333,-0.043222 47.950681,-12.994796 25.102292,30.951982 Z"
id="path943" />
<path
style="fill:none;stroke:#8ae234;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 5.4899272,26.881932 4.8118488,-9.174825 15.241498,16.641466 22.691101,-43.489198 10.09375,9.25 -32.739699,42.050158 z"
id="path945" />
<g
id="g941"
transform="matrix(0.76079494,0,0,0.76079494,16.86351,-3.1260111)">
<g
id="g3863">
<path
style="color:#000000;display:block;overflow:visible;visibility:visible;fill:url(#linearGradient1486);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient1488);stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
d="m 27,-3.6915582 c 0,0 -12.247378,-0.8493196 -8.478954,13.4192502 H 7.986588 c 0,0 0.685168,-16.137073 19.013412,-13.4192502 z"
id="path2865" />
<g
id="g1878"
transform="matrix(-0.79349441,-0.66481753,-0.67040672,0.78687903,77.66003,0.94046451)"
style="fill:url(#linearGradient3858);fill-opacity:1;stroke:#204a87;stroke-width:0.732809;stroke-opacity:1">
<path
id="path1880"
d="M 44.306783,50.229694 C 62.821497,35.818859 49.664587,13.411704 22.462411,12.49765 L 22.113843,3.1515478 7.6245439,20.496754 22.714328,33.219189 c 0,0 -0.251917,-9.88122 -0.251917,-9.88122 18.82976,0.998977 32.981627,14.071729 21.844372,26.891725 z"
style="color:#000000;display:block;overflow:visible;visibility:visible;fill:url(#linearGradient3034);fill-opacity:1;fill-rule:nonzero;stroke:#204a87;stroke-width:1.9334;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
</g>
<g
style="fill:none;stroke:#729fcf;stroke-width:0.732809;stroke-opacity:1"
transform="matrix(-0.69686517,-0.58385766,-0.58876622,0.69105539,72.350404,1.0127423)"
id="g2805">
<path
style="color:#000000;display:block;overflow:visible;visibility:visible;fill:none;stroke:#729fcf;stroke-width:2.20149;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:21;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
d="M 52.368857,42.344789 C 57.336994,33.465615 49.176003,12.601866 19.05552,12.672851 L 18.677956,5.6633463 7.4378077,19.282655 19.129354,29.167094 18.807724,20.554957 c 18.244937,0.381972 33.804002,9.457851 33.561133,21.789832 z"
id="path2807" />
</g>
</g>
<g
id="g3863-0"
transform="rotate(180,32.993294,14.5)">
<path
style="color:#000000;display:block;overflow:visible;visibility:visible;fill:url(#linearGradient1486-5);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient1488-8);stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
d="m 27,-3.6915582 c 0,0 -12.247378,-0.8493196 -8.478954,13.4192502 H 7.986588 c 0,0 0.685168,-16.137073 19.013412,-13.4192502 z"
id="path2865-3" />
<g
id="g1878-6"
transform="matrix(-0.79349441,-0.66481753,-0.67040672,0.78687903,77.66003,0.94046451)"
style="fill:url(#linearGradient3858-1);fill-opacity:1;stroke:#204a87;stroke-width:0.732809;stroke-opacity:1">
<path
id="path1880-2"
d="M 44.306783,50.229694 C 62.821497,35.818859 49.664587,13.411704 22.462411,12.49765 L 22.113843,3.1515478 7.6245439,20.496754 22.714328,33.219189 c 0,0 -0.251917,-9.88122 -0.251917,-9.88122 18.82976,0.998977 32.981627,14.071729 21.844372,26.891725 z"
style="color:#000000;display:block;overflow:visible;visibility:visible;fill:url(#linearGradient3034-4);fill-opacity:1;fill-rule:nonzero;stroke:#204a87;stroke-width:1.9334;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" />
</g>
<g
style="fill:none;stroke:#729fcf;stroke-width:0.732809;stroke-opacity:1"
transform="matrix(-0.69686517,-0.58385766,-0.58876622,0.69105539,72.350404,1.0127423)"
id="g2805-4">
<path
style="color:#000000;display:block;overflow:visible;visibility:visible;fill:none;stroke:#729fcf;stroke-width:2.20149;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:21;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
d="M 52.368857,42.344789 C 57.864671,33.591679 49.176003,12.601866 19.05552,12.672851 L 18.677956,5.6633463 7.4378077,19.282655 19.129354,29.167094 18.807724,20.554957 c 18.244937,0.381972 33.804002,9.457851 33.561133,21.789832 z"
id="path2807-5" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -162,6 +162,7 @@
<file>Std_HideSelection.svg</file>
<file>Std_Import.svg</file>
<file>Std_MergeProjects.svg</file>
<file>Std_MarkToRecompute.svg</file>
<file>Std_PrintPdf.svg</file>
<file>Std_RandomColor.svg</file>
<file>Std_RecentFiles.svg</file>

View File

@@ -169,11 +169,7 @@ QByteArray PythonOnlineHelp::loadResource(const QString& filename) const
if (result) {
Py_DECREF(result);
result = PyDict_GetItemString(dict, "htmldocument");
#if PY_MAJOR_VERSION >= 3
const char* contents = PyUnicode_AsUTF8(result);
#else
const char* contents = PyString_AsString(result);
#endif
res.append("HTTP/1.0 200 OK\n");
res.append("Content-type: text/html\n");
res.append(contents);
@@ -204,11 +200,7 @@ QByteArray PythonOnlineHelp::loadResource(const QString& filename) const
if (result) {
Py_DECREF(result);
result = PyDict_GetItemString(dict, "page");
#if PY_MAJOR_VERSION >= 3
const char* page = PyUnicode_AsUTF8(result);
#else
const char* page = PyString_AsString(result);
#endif
res.append("HTTP/1.0 200 OK\n");
res.append("Content-type: text/html\n");
res.append(page);

View File

@@ -171,17 +171,9 @@ void InteractiveInterpreter::setPrompt()
Base::PyGILStateLocker lock;
d->sysmodule = PyImport_ImportModule("sys");
if (!PyObject_HasAttrString(d->sysmodule, "ps1"))
#if PY_MAJOR_VERSION >= 3
PyObject_SetAttrString(d->sysmodule, "ps1", PyUnicode_FromString(">>> "));
#else
PyObject_SetAttrString(d->sysmodule, "ps1", PyString_FromString(">>> "));
#endif
if (!PyObject_HasAttrString(d->sysmodule, "ps2"))
#if PY_MAJOR_VERSION >= 3
PyObject_SetAttrString(d->sysmodule, "ps2", PyUnicode_FromString("... "));
#else
PyObject_SetAttrString(d->sysmodule, "ps2", PyString_FromString("... "));
#endif
}
/**
@@ -323,11 +315,7 @@ void InteractiveInterpreter::runCode(PyCodeObject* code) const
throw Base::PyException(); /* not incref'd */
// It seems that the return value is always 'None' or Null
#if PY_MAJOR_VERSION >= 3
presult = PyEval_EvalCode((PyObject*)code, dict, dict); /* run compiled bytecode */
#else
presult = PyEval_EvalCode(code, dict, dict); /* run compiled bytecode */
#endif
Py_XDECREF(code); /* decref the code object */
if (!presult) {
if (PyErr_ExceptionMatches(PyExc_SystemExit)) {
@@ -359,11 +347,7 @@ void InteractiveInterpreter::runCode(PyCodeObject* code) const
}
std::string err = str.str();
#if PY_MAJOR_VERSION >= 3
errdata = PyUnicode_FromString(err.c_str());
#else
errdata = PyString_FromString(err.c_str());
#endif
}
}
PyErr_Restore(errobj, errdata, errtraceback);
@@ -474,13 +458,8 @@ PythonConsole::PythonConsole(QWidget *parent)
d->_stdin = PySys_GetObject("stdin");
PySys_SetObject("stdin", d->_stdinPy);
#if PY_MAJOR_VERSION >= 3
const char* version = PyUnicode_AsUTF8(PySys_GetObject("version"));
const char* platform = PyUnicode_AsUTF8(PySys_GetObject("platform"));
#else
const char* version = PyString_AsString(PySys_GetObject("version"));
const char* platform = PyString_AsString(PySys_GetObject("platform"));
#endif
d->info = QString::fromLatin1("Python %1 on %2\n"
"Type 'help', 'copyright', 'credits' or 'license' for more information.")
.arg(QString::fromLatin1(version), QString::fromLatin1(platform));
@@ -837,12 +816,11 @@ void PythonConsole::runSource(const QString& line)
setFocus(); // if focus was lost
}
catch (const Base::SystemExitException&) {
#if PY_MAJOR_VERSION >= 3
// In Python the exception must be cleared because when the message box below appears
// callable Python objects can be invoked and due to a failing assert the application
// will be aborted.
PyErr_Clear();
#endif
ParameterGrp::handle hPrefGrp = getWindowParameter();
bool check = hPrefGrp->GetBool("CheckSystemExit",true);
int ret = QMessageBox::Yes;

View File

@@ -80,15 +80,9 @@ Py::Object PythonStdout::write(const Py::Tuple& args)
try {
Py::Object output(args[0]);
if (PyUnicode_Check(output.ptr())) {
#if PY_MAJOR_VERSION >= 3
PyObject* unicode = PyUnicode_AsEncodedString(output.ptr(), "utf-8", 0);
if (unicode) {
const char* string = PyBytes_AsString(unicode);
#else
PyObject* unicode = PyUnicode_AsEncodedObject(output.ptr(), "utf-8", "strict");
if (unicode) {
const char* string = PyString_AsString(unicode);
#endif
int maxlen = qstrlen(string) > 10000 ? 10000 : -1;
pyConsole->insertPythonOutput(QString::fromUtf8(string, maxlen));
Py_DECREF(unicode);
@@ -163,15 +157,9 @@ Py::Object PythonStderr::write(const Py::Tuple& args)
try {
Py::Object output(args[0]);
if (PyUnicode_Check(output.ptr())) {
#if PY_MAJOR_VERSION >= 3
PyObject* unicode = PyUnicode_AsEncodedString(output.ptr(), "utf-8", 0);
if (unicode) {
const char* string = PyBytes_AsString(unicode);
#else
PyObject* unicode = PyUnicode_AsEncodedObject(output.ptr(), "utf-8", "strict");
if (unicode) {
const char* string = PyString_AsString(unicode);
#endif
int maxlen = qstrlen(string) > 10000 ? 10000 : -1;
pyConsole->insertPythonError(QString::fromUtf8(string, maxlen));
Py_DECREF(unicode);
@@ -245,15 +233,9 @@ Py::Object OutputStdout::write(const Py::Tuple& args)
try {
Py::Object output(args[0]);
if (PyUnicode_Check(output.ptr())) {
#if PY_MAJOR_VERSION >= 3
PyObject* unicode = PyUnicode_AsEncodedString(output.ptr(), "utf-8", 0);
if (unicode) {
const char* string = PyBytes_AsString(unicode);
#else
PyObject* unicode = PyUnicode_AsEncodedObject(output.ptr(), "utf-8", "strict");
if (unicode) {
const char* string = PyString_AsString(unicode);
#endif
Base::Console().Message("%s",string);
Py_DECREF(unicode);
}
@@ -326,15 +308,9 @@ Py::Object OutputStderr::write(const Py::Tuple& args)
try {
Py::Object output(args[0]);
if (PyUnicode_Check(output.ptr())) {
#if PY_MAJOR_VERSION >= 3
PyObject* unicode = PyUnicode_AsEncodedString(output.ptr(), "utf-8", 0);
if (unicode) {
const char* string = PyBytes_AsString(unicode);
#else
PyObject* unicode = PyUnicode_AsEncodedObject(output.ptr(), "utf-8", "strict");
if (unicode) {
const char* string = PyString_AsString(unicode);
#endif
Base::Console().Error("%s",string);
Py_DECREF(unicode);
}

View File

@@ -437,11 +437,7 @@ void PythonDebugger::runFile(const QString& fn)
dict = PyModule_GetDict(module);
dict = PyDict_Copy(dict);
if (PyDict_GetItemString(dict, "__file__") == NULL) {
#if PY_MAJOR_VERSION >= 3
PyObject *f = PyUnicode_FromString((const char*)pxFileName);
#else
PyObject *f = PyString_FromString((const char*)pxFileName);
#endif
if (f == NULL) {
fclose(fp);
return;
@@ -580,11 +576,7 @@ int PythonDebugger::tracer_callback(PyObject *obj, PyFrameObject *frame, int wha
//no = frame->f_tstate->recursion_depth;
//std::string funcname = PyString_AsString(frame->f_code->co_name);
#if PY_MAJOR_VERSION >= 3
QString file = QString::fromUtf8(PyUnicode_AsUTF8(frame->f_code->co_filename));
#else
QString file = QString::fromUtf8(PyString_AsString(frame->f_code->co_filename));
#endif
switch (what) {
case PyTrace_CALL:
self->depth++;

View File

@@ -2067,11 +2067,7 @@ PyObject *SelectionSingleton::sCountObjectsOfType(PyObject * /*self*/, PyObject
return NULL;
unsigned int count = Selection().countObjectsOfType(objecttype, document, resolve);
#if PY_MAJOR_VERSION < 3
return PyInt_FromLong(count);
#else
return PyLong_FromLong(count);
#endif
}
PyObject *SelectionSingleton::sGetSelection(PyObject * /*self*/, PyObject *args)
@@ -2340,15 +2336,9 @@ PyObject *SelectionSingleton::sSetVisible(PyObject * /*self*/, PyObject *args)
if(visible == Py_None) {
vis = -1;
}
#if PY_MAJOR_VERSION < 3
else if(PyInt_Check(visible)) {
vis = PyInt_AsLong(visible);
}
#else
else if(PyLong_Check(visible)) {
vis = PyLong_AsLong(visible);
}
#endif
else {
vis = PyObject_IsTrue(visible)?1:0;
}

View File

@@ -1552,6 +1552,18 @@ QPushButton:checked {
border-color: #65A2E5;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons

View File

@@ -1519,6 +1519,18 @@ QPushButton:checked {
border-color: #3874f2;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons

View File

@@ -1519,6 +1519,18 @@ QPushButton:checked {
border-color: #2053c0;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons

View File

@@ -1519,6 +1519,17 @@ QPushButton:checked {
border-color: #819c0c;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons

View File

@@ -1519,6 +1519,18 @@ QPushButton:checked {
border-color: #d0970c;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons

View File

@@ -1519,6 +1519,18 @@ QPushButton:checked {
border-color: #2053c0;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons

View File

@@ -1519,6 +1519,18 @@ QPushButton:checked {
border-color: #74831d;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons

View File

@@ -1519,6 +1519,18 @@ QPushButton:checked {
border-color: #b28416;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons

View File

@@ -1516,6 +1516,18 @@ QPushButton:checked {
border-color: #3874f2;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons

View File

@@ -1516,6 +1516,18 @@ QPushButton:checked {
border-color: #819c0c;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons

View File

@@ -1516,6 +1516,18 @@ QPushButton:checked {
border-color: #d0970c;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons

View File

@@ -1709,6 +1709,25 @@ Gui--PropertyEditor--PropertyEditor > QWidget > QWidget > QWidget > QWidget > QF
padding: 2px 6px;
}
/*==================================================================================================
Tool button Icon fix in save dialogs
==================================================================================================*/
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
QFileDialog#QFileDialog QToolButton {
background-color: transparent;
padding: 1px;
border: 1px;
margin: 0px;
}
QFileDialog#QFileDialog QToolButton:hover,
QFileDialog#QFileDialog QToolButton:focus {
color: #ffffff;
background-color: #557bb6;
border: 1px solid #f5f5f5;
}
/*==================================================================================================
Tool button inside QDialogs that works as QPushButtons
==================================================================================================*/
@@ -1753,8 +1772,8 @@ Tool button inside Task Panel content that works as QPushButtons
QSint--ActionGroup QFrame[class="content"] QToolButton {
color: #e0e0e0;
text-align: center;
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #2a2a2a, stop:1 #1e1e1e);
border: 1px solid #1e1e1e;
background-color: #2a2a2a;
border: 1px solid #494949;
border-bottom-color: black; /* simulates shadow under the button */
padding: 2px 6px; /* different than regular QPushButton */
margin: 2px; /* different than regular QPushButton */
@@ -1765,14 +1784,14 @@ QSint--ActionGroup QFrame[class="content"] QToolButton {
QSint--ActionGroup QFrame[class="content"] QToolButton:hover,
QSint--ActionGroup QFrame[class="content"] QToolButton:focus {
color: white;
border-color: #557BB6;
border-color: solid #f5f5f5;
background-color: #557BB6;
}
QSint--ActionGroup QFrame[class="content"] QToolButton:disabled,
QSint--ActionGroup QFrame[class="content"] QToolButton:disabled:checked {
color: #f5f5f5;
border-color: #424242;
border-color: #494949;
background-color: #424242;
}

View File

@@ -2681,6 +2681,7 @@ void TreeWidget::setupText()
this->markRecomputeAction->setText(tr("Mark to recompute"));
this->markRecomputeAction->setStatusTip(tr("Mark this object to be recomputed"));
this->markRecomputeAction->setIcon(BitmapFactory().iconFromTheme("Std_MarkToRecompute"));
this->recomputeObjectAction->setText(tr("Recompute object"));
this->recomputeObjectAction->setStatusTip(tr("Recompute the selected object"));

View File

@@ -324,25 +324,14 @@ bool PythonWrapper::toCString(const Py::Object& pyobject, std::string& str)
{
if (PyUnicode_Check(pyobject.ptr())) {
PyObject* unicode = PyUnicode_AsUTF8String(pyobject.ptr());
#if PY_MAJOR_VERSION >= 3
str = PyBytes_AsString(unicode);
#else
str = PyString_AsString(unicode);
#endif
Py_DECREF(unicode);
return true;
}
#if PY_MAJOR_VERSION >= 3
else if (PyBytes_Check(pyobject.ptr())) {
str = PyBytes_AsString(pyobject.ptr());
return true;
}
#else
else if (PyString_Check(pyobject.ptr())) {
str = PyString_AsString(pyobject.ptr());
return true;
}
#endif
#if defined (HAVE_SHIBOKEN) && defined(HAVE_PYSIDE)
if (Shiboken::String::check(pyobject.ptr())) {
const char* s = Shiboken::String::toCString(pyobject.ptr());
@@ -1002,16 +991,7 @@ Py::Object UiLoaderPy::createWidget(const Py::Tuple& args)
// 1st argument
Py::String str(args[0]);
std::string className;
#if PY_MAJOR_VERSION >= 3
className = str.as_std_string("utf-8");
#else
if (str.isUnicode()) {
className = str.as_std_string("utf-8");
}
else {
className = (std::string)str;
}
#endif
// 2nd argument
QWidget* parent = 0;
if (wrap.loadCoreModule() && args.size() > 1) {
@@ -1024,16 +1004,7 @@ Py::Object UiLoaderPy::createWidget(const Py::Tuple& args)
std::string objectName;
if (args.size() > 2) {
Py::String str(args[2]);
#if PY_MAJOR_VERSION >= 3
objectName = str.as_std_string("utf-8");
#else
if (str.isUnicode()) {
objectName = str.as_std_string("utf-8");
}
else {
objectName = (std::string)str;
}
#endif
}
QWidget* widget = loader.createWidget(QString::fromLatin1(className.c_str()), parent,
@@ -1484,24 +1455,9 @@ Py::Object PyResource::setValue(const Py::Tuple& args)
QVariant v;
if (PyUnicode_Check(psValue)) {
#if PY_MAJOR_VERSION >= 3
v = QString::fromUtf8(PyUnicode_AsUTF8(psValue));
#else
PyObject* unicode = PyUnicode_AsUTF8String(psValue);
v = QString::fromUtf8(PyString_AsString(unicode));
Py_DECREF(unicode);
}
else if (PyString_Check(psValue)) {
v = QString::fromLatin1(PyString_AsString(psValue));
#endif
}
#if PY_MAJOR_VERSION < 3
else if (PyInt_Check(psValue)) {
int val = PyInt_AsLong(psValue);
v = val;
}
#endif
else if (PyLong_Check(psValue)) {
unsigned int val = PyLong_AsLong(psValue);
v = val;
@@ -1514,17 +1470,9 @@ Py::Object PyResource::setValue(const Py::Tuple& args)
int nSize = PyList_Size(psValue);
for (int i=0; i<nSize;++i) {
PyObject* item = PyList_GetItem(psValue, i);
#if PY_MAJOR_VERSION >= 3
if (!PyUnicode_Check(item))
#else
if (!PyString_Check(item))
#endif
continue;
#if PY_MAJOR_VERSION >= 3
const char* pItem = PyUnicode_AsUTF8(item);
#else
char* pItem = PyString_AsString(item);
#endif
str.append(QString::fromUtf8(pItem));
}

View File

@@ -377,7 +377,6 @@ PyMOD_INIT_FUNC(FreeCADGui)
// is started in command mode
if (Base::Type::fromName("Gui::BaseView").isBad())
Gui::Application::initApplication();
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef FreeCADGuiModuleDef = {
PyModuleDef_HEAD_INIT,
"FreeCADGui", "FreeCAD GUI module\n", -1,
@@ -386,9 +385,6 @@ PyMOD_INIT_FUNC(FreeCADGui)
};
PyObject* module = PyModule_Create(&FreeCADGuiModuleDef);
return module;
#else
Py_InitModule3("FreeCADGui", FreeCADGui_methods, "FreeCAD GUI module\n");
#endif
}
catch (const Base::Exception& e) {
PyErr_Format(PyExc_ImportError, "%s\n", e.what());
@@ -396,8 +392,6 @@ PyMOD_INIT_FUNC(FreeCADGui)
catch (...) {
PyErr_SetString(PyExc_ImportError, "Unknown runtime error occurred");
}
#if PY_MAJOR_VERSION >= 3
return 0;
#endif
}

View File

@@ -109,19 +109,11 @@ PyMOD_INIT_FUNC(FreeCAD)
putenv("LC_ALL=C");
// get whole path of the library
Dl_info info;
#if PY_MAJOR_VERSION >= 3
int ret = dladdr((void*)PyInit_FreeCAD, &info);
#else
int ret = dladdr((void*)initFreeCAD, &info);
#endif
if ((ret == 0) || (!info.dli_fname)) {
free(argv);
PyErr_SetString(PyExc_ImportError, "Cannot get path of the FreeCAD module!");
#if PY_MAJOR_VERSION >= 3
return 0;
#else
return;
#endif
}
argv[0] = (char*)malloc(PATH_MAX);
@@ -145,31 +137,14 @@ PyMOD_INIT_FUNC(FreeCAD)
// backwards since the FreeCAD path was likely appended just before
// we were imported.
for (i = PyList_Size(pySysPath) - 1; i >= 0 ; --i) {
#if PY_MAJOR_VERSION >= 3
const char *basePath;
#else
char *basePath;
#endif
PyObject *pyPath = PyList_GetItem(pySysPath, i);
long sz = 0;
#if PY_MAJOR_VERSION >= 3
if ( PyUnicode_Check(pyPath) ) {
// Python 3 string
basePath = PyUnicode_AsUTF8AndSize(pyPath, &sz);
}
#else
if ( PyString_Check(pyPath) ) {
// Python 2 string type
PyString_AsStringAndSize(pyPath, &basePath, &sz);
}
else if ( PyUnicode_Check(pyPath) ) {
// Python 2 unicode type - explicitly use UTF-8 codec
PyObject *fromUnicode = PyUnicode_AsUTF8String(pyPath);
PyString_AsStringAndSize(fromUnicode, &basePath, &sz);
Py_XDECREF(fromUnicode);
}
#endif // #if/else PY_MAJOR_VERSION >= 3
else {
continue;
}
@@ -201,11 +176,7 @@ PyMOD_INIT_FUNC(FreeCAD)
if (buf == NULL) {
PyErr_SetString(PyExc_ImportError, "Cannot get path of the FreeCAD module!");
#if PY_MAJOR_VERSION >= 3
return 0;
#else
return;
#endif
}
argv[0] = buf;
@@ -239,7 +210,6 @@ PyMOD_INIT_FUNC(FreeCAD)
std::clog.rdbuf(&stdclog);
std::cerr.rdbuf(&stdcerr);
#if PY_MAJOR_VERSION >= 3
//PyObject* module = _PyImport_FindBuiltin("FreeCAD");
PyObject* modules = PyImport_GetModuleDict();
PyObject* module = PyDict_GetItemString(modules, "FreeCAD");
@@ -247,6 +217,5 @@ PyMOD_INIT_FUNC(FreeCAD)
PyErr_SetString(PyExc_ImportError, "Failed to load FreeCAD module!");
}
return module;
#endif
}

View File

@@ -125,6 +125,19 @@ class GmshTools():
else:
self.algorithm3D = "1"
# RecombinationAlgorithm
algoRecombo = self.mesh_obj.RecombinationAlgorithm
if algoRecombo == "Simple":
self.RecombinationAlgorithm = "0"
elif algoRecombo == "Blossom":
self.RecombinationAlgorithm = "1"
elif algoRecombo == "Simple full-quad":
self.RecombinationAlgorithm = "2"
elif algoRecombo == "Blossom full-quad":
self.RecombinationAlgorithm = "3"
else:
self.algoRecombo = "0"
# HighOrderOptimize
optimizers = self.mesh_obj.HighOrderOptimize
if optimizers == "None":
@@ -766,8 +779,15 @@ class GmshTools():
)
geo.write("\n")
if hasattr(self.mesh_obj, "RecombineAll") and self.mesh_obj.RecombineAll is True:
geo.write("// other mesh options\n")
geo.write("// recombination for surfaces\n")
geo.write("Mesh.RecombineAll = 1;\n")
if hasattr(self.mesh_obj, "Recombine3DAll") and self.mesh_obj.Recombine3DAll is True:
geo.write("// recombination for volumes\n")
geo.write("Mesh.Recombine3DAll = 1;\n")
if ( (hasattr(self.mesh_obj, "RecombineAll") and self.mesh_obj.RecombineAll is True)
or (hasattr(self.mesh_obj, "Recombine3DAll") and self.mesh_obj.Recombine3DAll is True)):
geo.write("// recombination algorithm\n")
geo.write("Mesh.RecombinationAlgorithm = " + self.RecombinationAlgorithm + ";\n")
geo.write("\n")
geo.write("// optimize the mesh\n")

View File

@@ -60,6 +60,12 @@ class MeshGmsh(base_fempythonobject.BaseFemPythonObject):
"R-tree",
"HXT"
]
known_mesh_RecombinationAlgorithms = [
"Simple",
"Blossom",
"Simple full-quad",
"Blossom full-quad"
]
known_mesh_HighOrderOptimizers = [
"None",
"Optimization",
@@ -169,7 +175,7 @@ class MeshGmsh(base_fempythonobject.BaseFemPythonObject):
"App::PropertyBool",
"OptimizeStd",
"FEM Gmsh Mesh Params",
"Optimize tetra elements"
"Optimize tetrahedral elements"
)
obj.OptimizeStd = True
@@ -201,6 +207,25 @@ class MeshGmsh(base_fempythonobject.BaseFemPythonObject):
)
obj.RecombineAll = False
if not hasattr(obj, "Recombine3DAll"):
obj.addProperty(
"App::PropertyBool",
"Recombine3DAll",
"FEM Gmsh Mesh Params",
"Apply recombination algorithm to all volumes"
)
obj.Recombine3DAll = False
if not hasattr(obj, "RecombinationAlgorithm"):
obj.addProperty(
"App::PropertyEnumeration",
"RecombinationAlgorithm",
"FEM Gmsh Mesh Params",
"Recombination algorithm"
)
obj.RecombinationAlgorithm = MeshGmsh.known_mesh_RecombinationAlgorithms
obj.RecombinationAlgorithm = "Simple"
if not hasattr(obj, "CoherenceMesh"):
obj.addProperty(
"App::PropertyBool",

View File

@@ -693,7 +693,8 @@ private:
TColStd_IndexedDataMapOfStringString aMetadata;
RWGltf_CafWriter aWriter (name8bit.c_str(), file.hasExtension("glb"));
aWriter.SetTransformationFormat (RWGltf_WriterTrsfFormat_Compact);
//aWriter.ChangeCoordinateSystemConverter().SetInputLengthUnit (0.001);
// https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#coordinate-system-and-units
aWriter.ChangeCoordinateSystemConverter().SetInputLengthUnit (0.001);
aWriter.ChangeCoordinateSystemConverter().SetInputCoordinateSystem (RWMesh_CoordinateSystem_Zup);
Standard_Boolean ret = aWriter.Perform (hDoc, aMetadata, Message_ProgressRange());
if (!ret) {

View File

@@ -80,7 +80,6 @@ PartExport extern PyObject* PartExceptionOCCDimensionError;
str += " "; \
if (msg) {str += msg;} \
else {str += "No OCCT Exception Message";} \
Base::Console().Error(str.c_str()); \
_Py_Error(R,Part::PartExceptionOCCError,str.c_str()); \
} \
_PY_CATCH(R)

View File

@@ -592,6 +592,7 @@ PyObject * TopoShape::getPyObject()
}
}
prop->setNotTracking();
return prop;
}

View File

@@ -461,7 +461,7 @@ TopoDS_Shape Transformed::getRemainingSolids(const TopoDS_Shape& shape)
builder.Add(compShape, xp.Current());
}
return compShape;
return TopoDS_Shape(std::move(compShape));
}
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -1199,7 +1199,7 @@ void CmdTechDrawCosmeticEraser::activated(int iMsg)
cl2Delete.push_back(tag);
} else {
Base::Console().Message(
"CMD::CosmeticEraserP - edge: %d is confused - source: %d\n",idx,source);
"CMD::CosmeticEraser - edge: %d is confused - source: %d\n",idx,source);
}
}
} else if (geomType == "Vertex") {

View File

@@ -99,7 +99,7 @@ bool ViewProviderRichAnno::setEdit(int ModNum)
{
// Base::Console().Message("VPRA::setEdit(%d)\n",ModNum);
if (ModNum == ViewProvider::Default ) {
if (Gui::Control().activeDialog()) { //TaskPanel already open!
if (Gui::Control().activeDialog()) { //TaskPanel already open!
return false;
}
Gui::Selection().clearSelection();

View File

@@ -615,13 +615,11 @@ PyObject * @self.export.Name@::staticCallback_@i.Name@ (PyObject *self, PyObject
} // Please sync the following catch implementation with PY_CATCH
catch(Base::AbortException &e)
{
e.ReportException();
PyErr_SetObject(Base::BaseExceptionFreeCADAbort,e.getPyObject());
return NULL;
}
catch(Base::Exception &e)
{
e.ReportException();
auto pye = e.getPyExceptionType();
if(!pye)
pye = Base::BaseExceptionFreeCADError;
@@ -790,13 +788,11 @@ PyObject *@self.export.Name@::_getattr(const char *attr) // __getattr__ functi
} // Please sync the following catch implementation with PY_CATCH
catch(Base::AbortException &e)
{
e.ReportException();
PyErr_SetObject(Base::BaseExceptionFreeCADAbort,e.getPyObject());
return NULL;
}
catch(Base::Exception &e)
{
e.ReportException();
auto pye = e.getPyExceptionType();
if(!pye)
pye = Base::BaseExceptionFreeCADError;
@@ -852,13 +848,11 @@ int @self.export.Name@::_setattr(const char *attr, PyObject *value) // __setattr
} // Please sync the following catch implementation with PY_CATCH
catch(Base::AbortException &e)
{
e.ReportException();
PyErr_SetObject(Base::BaseExceptionFreeCADAbort,e.getPyObject());
return -1;
}
catch(Base::Exception &e)
{
e.ReportException();
auto pye = e.getPyExceptionType();
if(!pye)
pye = Base::BaseExceptionFreeCADError;

View File

@@ -1,14 +0,0 @@
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -yqq software-properties-common
RUN add-apt-repository ppa:freecad-maintainers/freecad-daily
RUN apt-get update
RUN apt-get install -yqq build-essential python python2.7-dev subversion cmake libtool autotools-dev automake bison flex gfortran git
RUN apt-get install -yqq libCoin80-dev libCoin80-doc libsoqt4-dev libqt4-dev qt4-dev-tools libsoqt4-dev python-qt4 libqtwebkit-dev
RUN apt-get install -yqq liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev oce-draw
RUN apt-get install -yqq libode-dev libeigen2-dev libeigen3-dev libsimage-dev libxerces-c2-dev
RUN apt-get install -yqq libpyside-dev pyside-tools libshiboken-dev doxygen python-pivy
RUN apt-get install -yqq libboost1.55-all-dev
RUN apt-get install -yqq libmedc-dev libvtk6-dev libproj-dev
RUN apt-get install -yqq libxerces-c-dev
RUN ln -s /usr/lib/x86_64-linux-gnu/libxerces-c.so /usr/lib/libxerces-c.so

View File

@@ -1,11 +0,0 @@
{
"maintainer": "Timothy <timothyhobbs@seznam.cz>",
"stateful-home": true,
"executable": "/bin/bash",
"allow-network-access": true,
"basic-common-permissions": true,
"description": "A development environment for building and running freecad.",
"access-working-directory": true,
"graphics-card": true,
"gui": {"clipboard":true}
}

View File

@@ -101,5 +101,5 @@ echo "
apps:
FreeCAD:
command: bin/launcher
plugs: [ locale-control,x11,opengl,network-bind,home,unity7 ]
plugs: [ locale-control,x11,opengl,network-bind,home,unity7,removable-media ]
" >> snapcraft.yaml

View File

@@ -117,5 +117,5 @@ echo "
apps:
FreeCAD:
command: bin/launcher
plugs: [ locale-control,x11,opengl,network-bind,home,unity7 ]
plugs: [ locale-control,x11,opengl,network-bind,home,unity7,removable-media ]
" >> snapcraft.yaml