the PR fixes the following things: - change the way centerlines between 2 lines are calculated. The current implementation leads to many bugs and even crashes (e.g. when the 2 selected lines are parallel ones of a square). There are different forum threads from the last 1.5 years. The new endpoint line sorting is the one described here: https://forum.freecadweb.org/viewtopic.php?f=35&start=20&t=44255&sid=989a668890f954c13ef81e4a04ee6912#p501179 - as consequence the erroneous and misleading line end flipping can go and is removed (only used internally) - when creating a new centerline, you see it immediately - when creating a new or editing an existing centerline and press Cancel, the creation/editing is aborted - fix crash when the 2 selected lines are bot horizontal and one tries to create a vertical centerline - fix crash when changing the orientation of an existing centerline and the result would be invalid - cleanup the code a bit
400 lines
11 KiB
XML
400 lines
11 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<ui version="4.0">
|
|
<class>TechDrawGui::TaskCenterLine</class>
|
|
<widget class="QWidget" name="TechDrawGui::TaskCenterLine">
|
|
<property name="enabled">
|
|
<bool>true</bool>
|
|
</property>
|
|
<property name="geometry">
|
|
<rect>
|
|
<x>0</x>
|
|
<y>0</y>
|
|
<width>250</width>
|
|
<height>352</height>
|
|
</rect>
|
|
</property>
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Fixed" vsizetype="MinimumExpanding">
|
|
<horstretch>0</horstretch>
|
|
<verstretch>0</verstretch>
|
|
</sizepolicy>
|
|
</property>
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>250</width>
|
|
<height>0</height>
|
|
</size>
|
|
</property>
|
|
<property name="windowTitle">
|
|
<string>Center Line</string>
|
|
</property>
|
|
<property name="windowIcon">
|
|
<iconset resource="Resources/TechDraw.qrc">
|
|
<normaloff>:/icons/actions/TechDraw_FaceCenterLine.svg</normaloff>:/icons/actions/TechDraw_FaceCenterLine.svg</iconset>
|
|
</property>
|
|
<layout class="QVBoxLayout" name="verticalLayout">
|
|
<item>
|
|
<layout class="QGridLayout" name="gridLayout">
|
|
<item row="0" column="0">
|
|
<widget class="QLabel" name="label_4">
|
|
<property name="text">
|
|
<string>Base View</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="0" column="1">
|
|
<widget class="QLineEdit" name="leBaseView">
|
|
<property name="enabled">
|
|
<bool>false</bool>
|
|
</property>
|
|
<property name="mouseTracking">
|
|
<bool>false</bool>
|
|
</property>
|
|
<property name="focusPolicy">
|
|
<enum>Qt::NoFocus</enum>
|
|
</property>
|
|
<property name="acceptDrops">
|
|
<bool>false</bool>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="1" column="0">
|
|
<widget class="QLabel" name="label_2">
|
|
<property name="text">
|
|
<string>Elements</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="1" column="1">
|
|
<widget class="QListWidget" name="lstSubList">
|
|
<property name="enabled">
|
|
<bool>false</bool>
|
|
</property>
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
|
<horstretch>0</horstretch>
|
|
<verstretch>0</verstretch>
|
|
</sizepolicy>
|
|
</property>
|
|
<property name="maximumSize">
|
|
<size>
|
|
<width>16777215</width>
|
|
<height>50</height>
|
|
</size>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
<item>
|
|
<widget class="QGroupBox" name="gbOrientation">
|
|
<property name="toolTip">
|
|
<string/>
|
|
</property>
|
|
<property name="title">
|
|
<string>Orientation</string>
|
|
</property>
|
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
<item>
|
|
<widget class="QRadioButton" name="rbVertical">
|
|
<property name="toolTip">
|
|
<string>Top to Bottom line</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>Vertical</string>
|
|
</property>
|
|
<property name="checked">
|
|
<bool>true</bool>
|
|
</property>
|
|
<attribute name="buttonGroup">
|
|
<string notr="true">bgOrientation</string>
|
|
</attribute>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QRadioButton" name="rbHorizontal">
|
|
<property name="enabled">
|
|
<bool>true</bool>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Left to Right line</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>Horizontal</string>
|
|
</property>
|
|
<attribute name="buttonGroup">
|
|
<string notr="true">bgOrientation</string>
|
|
</attribute>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QRadioButton" name="rbAligned">
|
|
<property name="enabled">
|
|
<bool>true</bool>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>centerline between
|
|
- lines: in equal distance to the lines and with
|
|
half of the angle the lines have to each other
|
|
- points: in equal distance to the points</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>Aligned</string>
|
|
</property>
|
|
<attribute name="buttonGroup">
|
|
<string notr="true">bgOrientation</string>
|
|
</attribute>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<layout class="QGridLayout" name="gridLayout_2">
|
|
<item row="0" column="0">
|
|
<widget class="QLabel" name="label_7">
|
|
<property name="text">
|
|
<string>Shift Horizontal</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="0" column="1">
|
|
<widget class="Gui::QuantitySpinBox" name="qsbHorizShift">
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>0</width>
|
|
<height>20</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Move line -Left or +Right</string>
|
|
</property>
|
|
<property name="alignment">
|
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
</property>
|
|
<property name="unit" stdset="0">
|
|
<string notr="true"/>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="1" column="0">
|
|
<widget class="QLabel" name="label_8">
|
|
<property name="text">
|
|
<string>Shift Vertical</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="1" column="1">
|
|
<widget class="Gui::QuantitySpinBox" name="qsbVertShift">
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>0</width>
|
|
<height>20</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Move line +Up or -Down</string>
|
|
</property>
|
|
<property name="alignment">
|
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
</property>
|
|
<property name="unit" stdset="0">
|
|
<string notr="true"/>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="2" column="0">
|
|
<widget class="QLabel" name="label_9">
|
|
<property name="text">
|
|
<string>Rotate</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="2" column="1">
|
|
<widget class="Gui::QuantitySpinBox" name="qsbRotate">
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>0</width>
|
|
<height>20</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Rotate line +CCW or -CW</string>
|
|
</property>
|
|
<property name="alignment">
|
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
</property>
|
|
<property name="minimum">
|
|
<double>-360.000000000000000</double>
|
|
</property>
|
|
<property name="maximum">
|
|
<double>360.000000000000000</double>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
<item>
|
|
<widget class="Line" name="line">
|
|
<property name="orientation">
|
|
<enum>Qt::Horizontal</enum>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<layout class="QGridLayout" name="gridLayout_3">
|
|
<item row="0" column="0">
|
|
<widget class="QLabel" name="label_3">
|
|
<property name="text">
|
|
<string>Extend By</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="0" column="1">
|
|
<widget class="Gui::QuantitySpinBox" name="qsbExtend">
|
|
<property name="minimumSize">
|
|
<size>
|
|
<width>0</width>
|
|
<height>20</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Make the line a little longer.</string>
|
|
</property>
|
|
<property name="alignment">
|
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
</property>
|
|
<property name="unit" stdset="0">
|
|
<string>mm</string>
|
|
</property>
|
|
<property name="value">
|
|
<double>3.000000000000000</double>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="1" column="0">
|
|
<widget class="QLabel" name="label">
|
|
<property name="text">
|
|
<string>Color</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="1" column="1">
|
|
<widget class="Gui::ColorButton" name="cpLineColor">
|
|
<property name="color">
|
|
<color>
|
|
<red>0</red>
|
|
<green>0</green>
|
|
<blue>0</blue>
|
|
</color>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="2" column="0">
|
|
<widget class="QLabel" name="label_5">
|
|
<property name="text">
|
|
<string>Weight</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="2" column="1">
|
|
<widget class="Gui::QuantitySpinBox" name="dsbWeight">
|
|
<property name="alignment">
|
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
</property>
|
|
<property name="singleStep">
|
|
<double>0.100000000000000</double>
|
|
</property>
|
|
<property name="value">
|
|
<double>0.500000000000000</double>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="3" column="0">
|
|
<widget class="QLabel" name="label_6">
|
|
<property name="text">
|
|
<string>Style</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="3" column="1">
|
|
<widget class="QComboBox" name="cboxStyle">
|
|
<property name="currentIndex">
|
|
<number>1</number>
|
|
</property>
|
|
<item>
|
|
<property name="text">
|
|
<string>Continuous</string>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset resource="Resources/TechDraw.qrc">
|
|
<normaloff>:/icons/continuous-line.svg</normaloff>:/icons/continuous-line.svg</iconset>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>Dash</string>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset resource="Resources/TechDraw.qrc">
|
|
<normaloff>:/icons/dash-line.svg</normaloff>:/icons/dash-line.svg</iconset>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>Dot</string>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset resource="Resources/TechDraw.qrc">
|
|
<normaloff>:/icons/dot-line.svg</normaloff>:/icons/dot-line.svg</iconset>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>DashDot</string>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset resource="Resources/TechDraw.qrc">
|
|
<normaloff>:/icons/dashDot-line.svg</normaloff>:/icons/dashDot-line.svg</iconset>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>DashDotDot</string>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset resource="Resources/TechDraw.qrc">
|
|
<normaloff>:/icons/dashDotDot-line.svg</normaloff>:/icons/dashDotDot-line.svg</iconset>
|
|
</property>
|
|
</item>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
<customwidgets>
|
|
<customwidget>
|
|
<class>Gui::QuantitySpinBox</class>
|
|
<extends>QWidget</extends>
|
|
<header>Gui/QuantitySpinBox.h</header>
|
|
</customwidget>
|
|
<customwidget>
|
|
<class>Gui::ColorButton</class>
|
|
<extends>QPushButton</extends>
|
|
<header>Gui/Widgets.h</header>
|
|
</customwidget>
|
|
</customwidgets>
|
|
<resources>
|
|
<include location="Resources/TechDraw.qrc"/>
|
|
</resources>
|
|
<connections/>
|
|
<buttongroups>
|
|
<buttongroup name="bgOrientation">
|
|
<property name="exclusive">
|
|
<bool>true</bool>
|
|
</property>
|
|
</buttongroup>
|
|
</buttongroups>
|
|
</ui>
|