Merge branch 'master' into feature/tool-bit-poc

This commit is contained in:
mlampert
2019-12-05 19:35:13 -08:00
committed by GitHub
13 changed files with 128 additions and 38 deletions

View File

@@ -64,7 +64,10 @@
<string>Property</string>
</property>
<property name="toolTip">
<string>The property to retrieve from each object. Can be &quot;count&quot; to count the objects, or property names like &quot;Length&quot; or &quot;Shape.Volume&quot; to retrieve a certain property.</string>
<string>The property to retrieve from each object.
Can be &quot;count&quot; to count the objects, or property names
like &quot;Length&quot; or &quot;Shape.Volume&quot; to retrieve
a certain property.</string>
</property>
</column>
<column>

View File

@@ -582,7 +582,8 @@
<item>
<widget class="Gui::PrefLineEdit" name="lineEdit">
<property name="toolTip">
<string>This is the SVG stroke-dasharray property to apply to projections of hidden objects.</string>
<string>This is the SVG stroke-dasharray property to apply
to projections of hidden objects.</string>
</property>
<property name="text">
<string>30, 10</string>
@@ -641,7 +642,8 @@
<item>
<widget class="Gui::PrefDoubleSpinBox" name="doubleSpinBox">
<property name="toolTip">
<string>Scaling factor for patterns used by object that have a Footprint display mode</string>
<string>Scaling factor for patterns used by object that have
a Footprint display mode</string>
</property>
<property name="decimals">
<number>4</number>
@@ -683,7 +685,7 @@
<item>
<widget class="Gui::PrefLineEdit" name="lineEdit_2">
<property name="toolTip">
<string>The URL of a bim server instance (www.bimserver.org) to connect to.</string>
<string>The URL of a bim server instance (www.bimserver.org) to connect to.</string>
</property>
<property name="text">
<string>http://localhost:8082</string>
@@ -703,7 +705,9 @@
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_3">
<property name="toolTip">
<string>If this is checked, the &quot;Open BimServer in browser&quot; button will open the Bim Server interface in an external browser instead of the FreeCAD web workbench</string>
<string>If this is selected, the &quot;Open BimServer in browser&quot;
button will open the Bim Server interface in an external browser
instead of the FreeCAD web workbench</string>
</property>
<property name="text">
<string>Open in external browser</string>

View File

@@ -17,7 +17,8 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Select a face or working plane proxy or 3 vertices, or choose one of the options below</string>
<string>Select a face or working plane proxy or 3 vertices.
Or choose one of the options below</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -67,7 +68,8 @@
<item>
<widget class="QPushButton" name="buttonAuto">
<property name="toolTip">
<string>The working plane will align to the current view each time a command is started</string>
<string>The working plane will align to the current
view each time a command is started</string>
</property>
<property name="statusTip">
<string/>
@@ -82,7 +84,9 @@
<item row="0" column="1">
<widget class="Gui::InputField" name="fieldOffset">
<property name="toolTip">
<string>an optional offset to give to the working plane above its base position. Use this together with one of the buttons above</string>
<string>An optional offset to give to the working plane
above its base position. Use this together with one
of the buttons above</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
@@ -99,7 +103,9 @@
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="toolTip">
<string>if this is checked, the working plane will be centered on the current view when pressing one of the buttons above</string>
<string>If this is selected, the working plane will be
centered on the current view when pressing one
of the buttons above</string>
</property>
<property name="text">
<string>Center plane on view</string>
@@ -109,7 +115,9 @@
<item row="1" column="1">
<widget class="QCheckBox" name="checkCenter">
<property name="toolTip">
<string>if this is checked, the working plane will be centered on the current view when pressing one of the buttons above</string>
<string>If this is selected, the working plane will be
centered on the current view when pressing one
of the buttons above</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
@@ -124,7 +132,9 @@
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Or select a single vertex to move the current working plane without changing its orientation. Then, press the button below</string>
<string>Or select a single vertex to move the current
working plane without changing its orientation.
Then, press the button below</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -134,7 +144,9 @@
<item>
<widget class="QPushButton" name="buttonMove">
<property name="toolTip">
<string>Moves the working plane without changing its orientation. If no point is selected, the plane will be moved to the center of the view</string>
<string>Moves the working plane without changing its
orientation. If no point is selected, the plane
will be moved to the center of the view</string>
</property>
<property name="text">
<string>Move working plane</string>
@@ -166,7 +178,7 @@
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="toolTip">
<string>the number of squares between each main line of the grid</string>
<string>The number of squares between each main line of the grid</string>
</property>
<property name="text">
<string>Main line every</string>
@@ -176,21 +188,25 @@
<item row="2" column="1">
<widget class="QSpinBox" name="fieldGridMainLine">
<property name="toolTip">
<string>the number of squares between each main line of the grid</string>
<string>The number of squares between each main line of the grid</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="fieldSnapRadius">
<property name="toolTip">
<string>The distance at which a point can be snapped to when approaching the mouse. You can alsochange this value by using the [ and ] keys while drawing</string>
<string>The distance at which a point can be snapped to
when approaching the mouse. You can also change this
value by using the [ and ] keys while drawing</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="toolTip">
<string>The distance at which a point can be snapped to when approaching the mouse. You can alsochange this value by using the [ and ] keys while drawing</string>
<string>The distance at which a point can be snapped to
when approaching the mouse. You can also change this
value by using the [ and ] keys while drawing</string>
</property>
<property name="text">
<string>Snapping radius</string>

View File

@@ -39,8 +39,8 @@
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_4">
<property name="toolTip">
<string>Python importer is used, otherwise the newer C++ one.
The C++ importer is faster, but has not as many features yet.</string>
<string>Python importer is used, otherwise the newer C++ is used.
Note: C++ importer is faster, but is not as featureful yet</string>
</property>
<property name="text">
<string>Use legacy python importer</string>
@@ -58,6 +58,9 @@ The C++ importer is faster, but has not as many features yet.</string>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_7">
<property name="toolTip">
<string>Python exporter is used, otherwise the newer C++ is used.
Note: C++ importer is faster, but is not as featureful yet</string>
<property name="text">
<string>Use legacy python exporter</string>
</property>
@@ -81,9 +84,8 @@ The C++ importer is faster, but has not as many features yet.</string>
<widget class="Gui::PrefCheckBox" name="checkBox_3">
<property name="toolTip">
<string>Allow FreeCAD to download the Python converter for DXF import and export.
You can also do that manually, by visiting
https://github.com/yorikvanhavre/Draft-dxf-importer
</string>
You can also do this manually by installing the "dxf_library" workbench
from the Addon Manager.</string>
</property>
<property name="text">
<string>Allow FreeCAD to automatically download and update the DXF libraries</string>

View File

@@ -90,7 +90,8 @@
<item>
<widget class="Gui::PrefCheckBox" name="ConstraintSeparationCheckBox">
<property name="toolTip">
<string>If selected, each element in the array is constrained with respect to the others using construction lines</string>
<string>If selected, each element in the array is constrained
with respect to the others using construction lines</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
@@ -112,7 +113,9 @@
<item>
<widget class="Gui::PrefCheckBox" name="CloneCheckBox">
<property name="toolTip">
<string>If checked it substitutes dimensional constraints by geometric constraints in the copies, so that a change in the original element is directly reflected on copies</string>
<string>If selected, it substitutes dimensional constraints by geometric constraints
in the copies, so that a change in the original element is directly
reflected on copies</string>
</property>
<property name="text">
<string>Clone</string>

View File

@@ -548,6 +548,9 @@
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="toolTip">
<string>If this is selected, the 'New File' icon shows a gradient icon instead of the normal icon</string>
</property>
<property name="text">
<string/>
</property>
@@ -569,12 +572,16 @@
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QComboBox" name="AutoloadModuleCombo"/>
<widget class="QComboBox" name="AutoloadModuleCombo">
<property name="toolTip">
<string>Choose which workbench to switch to after the program launches</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefCheckBox" name="checkBox_2">
<property name="toolTip">
<string>Should the start page be closed after loading?</string>
<string>If checked, will automatically close the Start page when FreeCAD launches</string>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>

View File

@@ -515,13 +515,36 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void)
return DrawView::execute();
}
bool DrawViewDimension::isMultiValueSchema(void) const
{
bool result = false;
bool angularMeasure = false;
if ( (Type.isValue("Angle")) ||
(Type.isValue("Angle3Pt")) ) {
angularMeasure = true;
}
Base::UnitSystem uniSys = Base::UnitsApi::getSchema();
if (((uniSys == Base::UnitSystem::Imperial1) ||
(uniSys == Base::UnitSystem::ImperialBuilding) ) &&
!angularMeasure) {
result = true;
} else if ((uniSys == Base::UnitSystem::ImperialCivil) &&
angularMeasure) {
result = true;
}
return result;
}
std::string DrawViewDimension::getFormatedValue(int partial)
{
// Base::Console().Message("DVD::getFormatedValue()\n");
// Base::Console().Message("DVD::getFormatedValue(%d)\n", partial);
std::string result;
if (Arbitrary.getValue()) {
return FormatSpec.getStrValue();
}
bool multiValueSchema = false;
QString specStr = QString::fromUtf8(FormatSpec.getStrValue().data(),FormatSpec.getStrValue().size());
QString specStrCopy = specStr;
@@ -554,24 +577,32 @@ std::string DrawViewDimension::getFormatedValue(int partial)
//handle multi value schemes
std::string pre = getPrefix();
QString qMultiValueStr;
QString qPre = QString::fromUtf8(pre.data(),pre.size());
if (((uniSys == Base::UnitSystem::Imperial1) ||
(uniSys == Base::UnitSystem::ImperialBuilding) ) &&
!angularMeasure) {
multiValueSchema = true;
qMultiValueStr = userStr;
specStr = userStr;
if (!pre.empty()) {
qMultiValueStr = qPre + userStr;
specStr = qPre + userStr;
}
} else if ((uniSys == Base::UnitSystem::ImperialCivil) &&
angularMeasure) {
multiValueSchema = true;
QString dispMinute = QString::fromUtf8("\'");
QString dispSecond = QString::fromUtf8("\"");
QString schemeMinute = QString::fromUtf8("M");
QString schemeSecond = QString::fromUtf8("S");
specStr = userStr.replace(schemeMinute,dispMinute);
specStr = specStr.replace(schemeSecond,dispSecond);
multiValueSchema = true;
qMultiValueStr = specStr;
if (!pre.empty()) {
specStr = qPre + userStr;
qMultiValueStr = qPre + specStr;
specStr = qPre + specStr;
}
} else {
//handle single value schemes
@@ -646,6 +677,11 @@ std::string DrawViewDimension::getFormatedValue(int partial)
std::string ssPrefix = Base::Tools::toStdString(formatPrefix);
std::string ssSuffix = Base::Tools::toStdString(formatSuffix);
result = specStr.toUtf8().constData();
if (multiValueSchema) {
result = ssPrefix +
Base::Tools::toStdString(qMultiValueStr) +
ssSuffix;
}
if (partial == 1) { //just the number (+prefix & suffix)
// result = Base::Tools::toStdString(specVal);
result = ssPrefix +

View File

@@ -142,6 +142,8 @@ public:
bool leaderIntersectsArc(Base::Vector3d s, Base::Vector3d pointOnCircle);
bool references(std::string geomName) const;
bool isMultiValueSchema(void) const;
protected:
virtual void onChanged(const App::Property* prop);
virtual void onDocumentRestored();

View File

@@ -546,8 +546,12 @@ void QGIViewDimension::updateDim()
if (dim->Arbitrary.getValue()) {
labelText = QString::fromUtf8(dim->getFormatedValue(1).c_str()); //just the number pref/spec/suf
} else {
labelText = QString::fromUtf8(dim->getFormatedValue(1).c_str()); //just the number pref/spec/suf
unitText = QString::fromUtf8(dim->getFormatedValue(2).c_str()); //just the unit
if (dim->isMultiValueSchema()) {
labelText = QString::fromUtf8(dim->getFormatedValue(0).c_str()); //don't format multis
} else {
labelText = QString::fromUtf8(dim->getFormatedValue(1).c_str()); //just the number pref/spec/suf
unitText = QString::fromUtf8(dim->getFormatedValue(2).c_str()); //just the unit
}
}
QFont font = datumLabel->getFont();