Merge branch 'master' into master

This commit is contained in:
Ryan White
2020-12-10 00:54:32 -08:00
committed by GitHub
8 changed files with 297 additions and 259 deletions

View File

@@ -37,6 +37,10 @@ else(OCE_FOUND) #look for OpenCASCADE
# we first try to find opencascade directly:
if(NOT OCCT_CMAKE_FALLBACK)
find_package(OpenCASCADE CONFIG QUIET)
get_property(flags DIRECTORY PROPERTY COMPILE_DEFINITIONS)
# OCCT 7.5 adds this define that causes hundreds of compiler warnings with Qt5.x, so remove it again
list(FILTER flags EXCLUDE REGEX [[GL_GLEXT_LEGACY]])
set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS ${flags})
endif(NOT OCCT_CMAKE_FALLBACK)
if(OpenCASCADE_FOUND)
set(OCC_FOUND ${OpenCASCADE_FOUND})

View File

@@ -170,6 +170,17 @@ typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#endif
/* avoid to redefine the HAVE_* in Coin's inttypes.h file */
#define COIN_CONFIGURE_BUILD
/* The <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* The <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* The <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* The <stddef.h> header file. */
#define HAVE_STDDEF_H 1
#endif

View File

@@ -1307,7 +1307,7 @@ StdCmdRefresh::StdCmdRefresh()
// undoing the last transaction the manual recompute will clear the redo stack.
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Document");
bool create = hGrp->GetBool("TransactionOnRecompute", true);
bool create = hGrp->GetBool("TransactionOnRecompute", false);
if (!create)
eType = eType | NoTransaction;
}

View File

@@ -774,6 +774,7 @@ void ColorButton::onChooseColor()
}
cd.setCurrentColor(currentColor);
cd.adjustSize();
if (cd.exec() == QDialog::Accepted) {
QColor c = cd.selectedColor();
if (c.isValid()) {

View File

@@ -38,6 +38,7 @@
#include <map>
#include <vector>
#include <algorithm>
#include <stdexcept>
#include <cstdio>
#include <QApplication>
@@ -309,6 +310,10 @@ int main( int argc, char ** argv )
e.ReportException();
exit(1);
}
catch (const std::exception& e) {
Base::Console().Error("Application unexpectedly terminated: %s\n", e.what());
exit(1);
}
catch (...) {
Base::Console().Error("Application unexpectedly terminated\n");
exit(1);

View File

@@ -26,7 +26,7 @@ from draftutils.translate import translate
WindowPresets = ["Fixed", "Open 1-pane", "Open 2-pane", "Sash 2-pane",
"Sliding 2-pane", "Simple door", "Glass door", "Sliding 4-pane", "Awming"]
"Sliding 2-pane", "Simple door", "Glass door", "Sliding 4-pane", "Awning"]
def makeWindowPreset(windowtype,width,height,h1,h2,h3,w1,w2,o1,o2,placement=None):
@@ -436,7 +436,7 @@ def makeWindowPreset(windowtype,width,height,h1,h2,h3,w1,w2,o1,o2,placement=None
wp.extend(["RightMostFrame","Frame","Wire8,Wire9",fw,str(o2)+"+V"])
wp.extend(["RightMostGlass","Glass panel","Wire9",str(w2/gla),str(o2+w2/2)+"+V"])
elif windowtype == "Awming":
elif windowtype == "Awning":
wp = outerFrame(s,width,height,h1,w1,o1)
simpleFrame(s,width,height,h1,h2,tol)

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>251</width>
<height>461</height>
<width>245</width>
<height>531</height>
</rect>
</property>
<property name="windowTitle">
@@ -15,279 +15,296 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="8" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Text color</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Shape color</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Line width</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="Gui::ColorButton" name="ShapeColor">
<property name="toolTip">
<string>The color of faces</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QComboBox" name="ArrowStyle">
<property name="toolTip">
<string>The type of dimension arrows</string>
</property>
<item>
<property name="text">
<string>Dot</string>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Lines and faces</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0" columnminimumwidth="0,120">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item row="4" column="1">
<widget class="Gui::ColorButton" name="ShapeColor">
<property name="toolTip">
<string>The color of faces</string>
</property>
</item>
<item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Circle</string>
<string>Draw style</string>
</property>
</item>
<item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Arrow</string>
<string>Line color</string>
</property>
</item>
<item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Tick</string>
<string>Line width</string>
</property>
</item>
<item>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::ColorButton" name="LineColor">
<property name="toolTip">
<string>The color of lines</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="DrawStyle">
<property name="toolTip">
<string>The line style</string>
</property>
<item>
<property name="text">
<string>Solid</string>
</property>
</item>
<item>
<property name="text">
<string>Dashed</string>
</property>
</item>
<item>
<property name="text">
<string>Dotted</string>
</property>
</item>
<item>
<property name="text">
<string>DashDot</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="LineWidth">
<property name="suffix">
<string> px</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Tick-2</string>
<string>Display mode</string>
</property>
</item>
</widget>
</item>
<item row="8" column="2">
<widget class="Gui::ColorButton" name="TextColor">
<property name="toolTip">
<string>The color of texts and dimension texts</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="Gui::InputField" name="TextSize">
<property name="toolTip">
<string>The size of texts and dimension texts</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Show unit</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="Gui::InputField" name="ArrowSize">
<property name="toolTip">
<string>The size of dimension arrows</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QFontComboBox" name="TextFont">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>The font to use for texts and dimensions</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="DrawStyle">
<property name="toolTip">
<string>The line style</string>
</property>
<item>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="DisplayMode">
<property name="toolTip">
<string>The display mode for faces</string>
</property>
<item>
<property name="text">
<string>Flat Lines</string>
</property>
</item>
<item>
<property name="text">
<string>Wireframe</string>
</property>
</item>
<item>
<property name="text">
<string>Shaded</string>
</property>
</item>
<item>
<property name="text">
<string>Points</string>
</property>
</item>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Solid</string>
<string>Shape color</string>
</property>
</item>
<item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Dashed</string>
<string>Transparency</string>
</property>
</item>
<item>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="Transparency">
<property name="toolTip">
<string>The transparency of faces</string>
</property>
<property name="suffix">
<string> %</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Annotations</string>
</property>
<layout class="QGridLayout" name="gridLayout_3" columnstretch="1,0" columnminimumwidth="0,120">
<item row="3" column="1">
<widget class="QComboBox" name="ArrowStyle">
<property name="toolTip">
<string>The type of dimension arrows</string>
</property>
<item>
<property name="text">
<string>Dot</string>
</property>
</item>
<item>
<property name="text">
<string>Circle</string>
</property>
</item>
<item>
<property name="text">
<string>Arrow</string>
</property>
</item>
<item>
<property name="text">
<string>Tick</string>
</property>
</item>
<item>
<property name="text">
<string>Tick-2</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Dotted</string>
<string>Text font</string>
</property>
</item>
<item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>DashDot</string>
<string>Text color</string>
</property>
</item>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Text size</string>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Unit override</string>
</property>
</widget>
</item>
<item row="11" column="2">
<widget class="QCheckBox" name="ShowUnit">
<property name="toolTip">
<string>If the unit siffix is shown on dimension texts or not</string>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="12" column="2">
<widget class="QLineEdit" name="UnitOverride">
<property name="toolTip">
<string>The unit to use for dimensions. Leave blank to use current FreeCAD unit</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QSpinBox" name="Transparency">
<property name="toolTip">
<string>The transparency of faces</string>
</property>
<property name="suffix">
<string> %</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Transparency</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Display mode</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Text font</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Arrow size</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QComboBox" name="DisplayMode">
<property name="toolTip">
<string>The display mode for faces</string>
</property>
<item>
</widget>
</item>
<item row="0" column="1">
<widget class="QFontComboBox" name="TextFont">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>The font to use for texts and dimensions</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Flat Lines</string>
<string>Text size</string>
</property>
</item>
<item>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::ColorButton" name="TextColor">
<property name="toolTip">
<string>The color of texts and dimension texts</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::InputField" name="TextSize">
<property name="toolTip">
<string>The size of texts and dimension texts</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Wireframe</string>
<string>Arrow style</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="ShowUnit">
<property name="toolTip">
<string>If the unit siffix is shown on dimension texts or not</string>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
</item>
<item>
<property name="text">
<string>Shaded</string>
<string/>
</property>
</item>
<item>
</widget>
</item>
<item row="4" column="1">
<widget class="Gui::InputField" name="ArrowSize">
<property name="toolTip">
<string>The size of dimension arrows</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Points</string>
<string>Show unit</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Draw style</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::ColorButton" name="LineColor">
<property name="toolTip">
<string>The color of lines</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Arrow style</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="LineWidth">
<property name="suffix">
<string> px</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Arrow size</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Unit override</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="UnitOverride">
<property name="toolTip">
<string>The unit to use for dimensions. Leave blank to use current FreeCAD unit</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QPushButton" name="applyButton">

View File

@@ -53,12 +53,12 @@ class Shaft:
wstrings = (("", "", "", "", ""),
("Translation [y]", "x", "mm", "w_y", "mm"),
("Translation [z]", "x", "mm", "w_z", "mm"))
sigmaNstrings = (("Normal stress [x]", "x", "mm", "\sigma_x", u"N/mm²"),
("Shear stress [y]", "x", "mm", "\sigma_y", u"N/mm²"),
("Shear stress [z]", "x", "mm", "\sigma_z", u"N/mm²"))
sigmaBstrings = (("Torque stress [x]", "x", "mm", "\tau_t", u"N/mm²"),
("Bending stress [z]", "x", "mm", "\sigma_{b,z}", u"N/mm²"),
("Bending stress [y]", "x", "mm", "\sigma_{b,y}", u"N/mm²"))
sigmaNstrings = (("Normal stress [x]", "x", "mm", "\\sigma_x", u"N/mm²"),
("Shear stress [y]", "x", "mm", "\\sigma_y", u"N/mm²"),
("Shear stress [z]", "x", "mm", "\\sigma_z", u"N/mm²"))
sigmaBstrings = (("Torque stress [x]", "x", "mm", "\\tau_t", u"N/mm²"),
("Bending stress [z]", "x", "mm", "\\sigma_{b,z}", u"N/mm²"),
("Bending stress [y]", "x", "mm", "\\sigma_{b,y}", u"N/mm²"))
def __init__(self, parent):
self.parent = parent