Merge branch 'master' into BBLPatch_ArchComponentDiffuseColor

This commit is contained in:
danreb25
2021-01-05 20:01:16 +01:00
committed by GitHub
17 changed files with 2782 additions and 18 deletions

View File

@@ -320,7 +320,7 @@ def getSVG(source,
lineColor=(0.0, 0.0, 0.0),
fontsize=1,
showFill=False,
fillColor=(0.8, 0.8, 0.8),
fillColor=(1.0, 1.0, 1.0),
techdraw=False,
fillSpaces=False,
cutlinewidth=0,
@@ -400,10 +400,10 @@ def getSVG(source,
svgSymbolLineWidth = str(linewidth * yt)
hiddenPattern = archUserParameters.GetString("archHiddenPattern","30,10")
svgHiddenPattern = hiddenPattern.replace(" ","")
fillpattern = '<pattern id="sectionfill" patternUnits="userSpaceOnUse" patternTransform="matrix(5,0,0,5,0,0)"'
fillpattern += ' x="0" y="0" width="10" height="10">'
fillpattern += '<g>'
fillpattern += '<rect width="10" height="10" style="stroke:none; fill:#ffffff" /><path style="stroke:#000000; stroke-width:1" d="M0,0 l10,10" /></g></pattern>'
#fillpattern = '<pattern id="sectionfill" patternUnits="userSpaceOnUse" patternTransform="matrix(5,0,0,5,0,0)"'
#fillpattern += ' x="0" y="0" width="10" height="10">'
#fillpattern += '<g>'
#fillpattern += '<rect width="10" height="10" style="stroke:none; fill:#ffffff" /><path style="stroke:#000000; stroke-width:1" d="M0,0 l10,10" /></g></pattern>'
svgLineColor = Draft.getrgb(lineColor)
svg = ''
# reading cached version
@@ -444,11 +444,16 @@ def getSVG(source,
render.cut(cutplane,showHidden)
else:
render.cut(cutplane)
svgcache += '<g transform="scale(1,-1)">\n'
g = '<g transform="scale(1,-1)">\n'
if hasattr(source.ViewObject,"RotateSolidRender"):
if (source.ViewObject.RotateSolidRender.Value != 0):
g = '<g transform="scale(1,-1) rotate('
g += str(source.ViewObject.RotateSolidRender.Value)
g += ')">\n'
svgcache += g
svgcache += render.getViewSVG(linewidth="SVGLINEWIDTH")
svgcache += fillpattern
svgcache += render.getSectionSVG(linewidth="SVGCUTLINEWIDTH",
fillpattern="sectionfill")
#svgcache += fillpattern
svgcache += render.getSectionSVG(linewidth="SVGCUTLINEWIDTH",fillpattern="#ffffff")
if showHidden:
svgcache += render.getHiddenSVG(linewidth="SVGLINEWIDTH")
svgcache += '</g>\n'

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>453</width>
<height>424</height>
<width>416</width>
<height>542</height>
</rect>
</property>
<property name="windowTitle">
@@ -22,6 +22,18 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="comboBoxStyles">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>The name of your style. Existing style names can be edited.</string>
</property>
@@ -46,11 +58,17 @@
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
@@ -71,11 +89,17 @@
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
@@ -90,6 +114,26 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonImport">
<property name="toolTip">
<string>Import styles from json file</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonExport">
<property name="toolTip">
<string>Export styles to json file</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -108,8 +152,8 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-290</y>
<width>420</width>
<y>0</y>
<width>383</width>
<height>589</height>
</rect>
</property>
@@ -152,6 +196,18 @@
</item>
<item row="0" column="1">
<widget class="QFontComboBox" name="FontName">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>The font to use for texts and dimensions</string>
</property>
@@ -400,6 +456,18 @@
</item>
<item row="4" column="1">
<widget class="QComboBox" name="ArrowType">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>The type of arrows or markers to use at the end of dimension lines</string>
</property>

View File

@@ -111,6 +111,8 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest):
self.form.pushButtonRename.setIcon(QtGui.QIcon(":/icons/accessories-text-editor.svg"))
self.form.pushButtonDelete.resize(self.form.pushButtonDelete.sizeHint())
self.form.pushButtonRename.resize(self.form.pushButtonRename.sizeHint())
self.form.pushButtonImport.setIcon(QtGui.QIcon(":/icons/Std_Import.svg"))
self.form.pushButtonExport.setIcon(QtGui.QIcon(":/icons/Std_Export.svg"))
# fill the styles combo
self.styles = self.read_meta()
@@ -121,6 +123,8 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest):
self.form.comboBoxStyles.currentIndexChanged.connect(self.on_style_changed)
self.form.pushButtonDelete.clicked.connect(self.on_delete)
self.form.pushButtonRename.clicked.connect(self.on_rename)
self.form.pushButtonImport.clicked.connect(self.on_import)
self.form.pushButtonExport.clicked.connect(self.on_export)
for attr in DEFAULT.keys():
control = getattr(self.form, attr)
for signal in ("clicked", "textChanged",
@@ -280,6 +284,42 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest):
self.styles[newname] = value
self.renamed[style] = newname
def on_import(self):
"""imports styles from a json file"""
filename = QtGui.QFileDialog.getOpenFileName(
QtGui.QApplication.activeWindow(),
_tr("Open styles file"),
None,
_tr("JSON file (*.json)"))
if filename and filename[0]:
with open(filename[0]) as f:
nstyles = json.load(f)
if nstyles:
self.styles.update(nstyles)
l1 = self.form.comboBoxStyles.itemText(0)
l2 = self.form.comboBoxStyles.itemText(1)
self.form.comboBoxStyles.clear()
self.form.comboBoxStyles.addItem(l1)
self.form.comboBoxStyles.addItem(l2)
for style in self.styles.keys():
self.form.comboBoxStyles.addItem(style)
print("Styles updated from "+filename[0])
def on_export(self):
"""exports styles to a json file"""
filename = QtGui.QFileDialog.getSaveFileName(
QtGui.QApplication.activeWindow(),
_tr("Save styles file"),
None,
_tr("JSON file (*.json)"))
if filename and filename[0]:
with open(filename[0],"w") as f:
json.dump(self.styles,f,indent=4)
print("Styles saved to "+filename[0])
def fill_editor(self, style):
"""Fill the editor fields with the contents of a style."""
if style is None:

View File

@@ -141,6 +141,12 @@ SOURCE_GROUP("Module" FILES ${Mod_SRCS})
add_library(Path SHARED ${Path_SRCS})
target_link_libraries(Path ${Path_LIBS})
# Boost >= 1.75.0
if(NOT ${Boost_VERSION} LESS 107500)
set_target_properties(Path PROPERTIES CXX_STANDARD_REQUIRED ON)
set_target_properties(Path PROPERTIES CXX_STANDARD 14)
endif()
if(FREECAD_USE_PCH)
add_definitions(-D_PreComp_)
GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" Path_CPP_SRCS ${Path_SRCS})

View File

@@ -11,7 +11,7 @@
<div class="title">
<div class="version">
VERSIONSTRING
<a href="OpenSettings.py">
<a title="T_VTOOLTIP" href="OpenSettings.py">
<img class="settingsicon" src="IMAGE_SRC_SETTINGS">
</a>
</div>

View File

@@ -79,3 +79,4 @@ T_EXTERNALLINKS = translate("StartPage", "To open any of the links above in your
T_CREATIONDATE = translate("StartPage", "Creation date")
T_LASTMODIFIED = translate("StartPage", "Last modification")
T_NOTES = translate("StartPage", "Notes")
T_VTOOLTIP = translate("StartPage", "Open start page preferences")