Commit Graph

21637 Commits

Author SHA1 Message Date
Bernd Hahnebach
a9aac02fdc FEM: constraint fluid boundary, add comment 2020-06-15 11:44:07 +02:00
carlopav
136f2615e9 Draft: fixes #4100 Problems with Points command callbacks
The point callback was not properly removed on continue mode.
2020-06-15 10:12:18 +02:00
luz.paz
29cba68da9 Fix typos [skip ci]
Found via codespell v1.18.0.dev0  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-06-15 10:11:22 +02:00
donovaly
bd7bcf3c76 [Draft] add more patterns
This commit just syncs with the pattern of TechDraw:
- add further patterns
- save all patterns as plain SVG (strictly following thee SVG specifications) using Inkscape 1.0
2020-06-15 10:10:12 +02:00
Harald Geyer
5958b3976b Arch: importIFCHelper: Fix spurious message 2020-06-15 10:05:30 +02:00
vocx-fc
9567b22fc3 Draft: separate target into object and subelements in make_label
Before, the `make_label` function had a `target` parameter
that had to be a `LinkSub`, `[Part::Feature, "Edge1"]`.
However, it is easier to pass the individual components
separately using two parameters, `target_object` and `subelements`,
which can then be assembled into `[target_object, subelements]`.

The second element is optional, so it can be set to `None`,
and then the second element will be converted to an empty list,
`[target_object, []]`, as required by the Label's underlying `Target`
property.
2020-06-15 10:01:04 +02:00
vocx-fc
48fe9d4088 Draft: hide properties not used in the Label object
When `LabelType` is `'Custom'`, the `Target` property
is hidden and `CustomText` is shown.

For other values of `LabelType`, `Target` is shown,
and in turn `CustomText` is hidden.

This avoids showing unused information in the property editor.
2020-06-15 10:01:04 +02:00
vocx-fc
6b14fa35dc Draft: combine two types of labels using functions
We use smaller functions to return a list of strings corresponding
to each basic value of `LabelType`. Then the final `Text` value
can be defined as a simple value, or as the concatenation
of two smaller lists, depending on the value of `LabelType`.

Since we have 8 basic values, we could return up to 8^2
combinations, but at the moment we only return 8 basic
values and 5 simple combinations, which are the ones
that make the most sense.

In the future we could define new properties, say, `LabelType2`
and `LabelType3`, to be able to combine two or three types
of strings in an arbitrary fashion. At the moment, the possible
combinations are hard coded in `LabelType`.
2020-06-15 10:01:04 +02:00
vocx-fc
8c3ee6e4b3 Draft: organize the execute code of the Label in a function
Instead of placing the entire code in the `execute` method,
a `return_info` function is used to return the specific string
that we wish to display depending on the `Target` object,
 the `LabelType`, and subelement in `Target`, if any.

We also make the code more readable by using smaller variables,
and avoiding notations with lists of lists (`variable[0][1][6:]`).
2020-06-15 10:01:04 +02:00
vocx-fc
d23b664a2e Draft: set the properties of the Label class through functions
There are three general types of properties, target, leader,
and label; so we set the 9 properties using three functions,
and provide better documentation in the tooltips
for each property.
2020-06-15 10:01:04 +02:00
vocx-fc
fa092ae3df Draft: move make_label function to its own module
Also perform several improvements such as PEP8 cleanup,
writing complete docstrings, type checking the input arguments,
and deprecating the older call.

Update `Draft.py`, the Gui Command, the unit test, and test script
as well.
2020-06-15 10:01:04 +02:00
vocx-fc
f7e53eaab3 Draft: adjust the text size for Labels with format_object
This function, `draftutils.gui_utils.format_object`,
takes the value defined in the `DrafToolBar`, and uses it
to specify the `FontSize` for `Text` objects.

Now it specifies the `TextSize` for `Label` elements as well.
2020-06-15 09:59:57 +02:00
vocx-fc
f4b2d6cb8b Draft: reset the list of strings in the Label viewprovider
When the value of the `Text` is changed, in the Coin node
only the first element in the list of strings is updated,
the other elements remain the same, resulting in an incorrect
label.

So we empty the value of the Coin string with `setValue("")`,
and then we can assign the new string list, producing the correct
expected result.
2020-06-15 09:59:57 +02:00
Harald Geyer
b5b0dc4355 Arch: Fix placement of Space objects imported from ArchiCAD
Any space objects imported from ArchiCAD (via IFC) are rotated
by 90° around the global z-Axis. When turning the same base
shape into an other Arch object like Wall or Slab, no such error
happens.

Turns out the shape creation in Space objects is handled
differently then in other Arch objects and just copying the usual
method fixes this. I have no idea why this makes a difference.

To document why this change is necessary, a test cases is added.
Upon editing TestArch.py a number of trailing spaces have been
removed accidentally.
2020-06-15 09:58:49 +02:00
wmayer
1f7818f977 Gui: [skip ci] show program version a file was created with in project information dialog 2020-06-14 17:52:02 +02:00
wmayer
17507f63cd Sketcher: [skip ci] fix -Winconsistent-missing-override 2020-06-14 16:36:46 +02:00
wmayer
03af87337a [skip ci] code cleanup 2020-06-14 16:24:14 +02:00
wmayer
b9e79be0a7 Sketcher: [skip ci] add security checks before accessing pointer 2020-06-14 16:23:16 +02:00
Abdullah Tahiri
a0dcc8caf0 TaskDlgEditSketch: Remove unnecessary recompute
===============================================

On Undo/Redo there should not be an unconditional recompute.

The need for this recompute is probably related to the fact that PropertyConstraintList
has invalid geometry keys.
2020-06-14 14:44:28 +02:00
Abdullah Tahiri
ee9eb741b4 Sketcher: ViewProviderSketch delay updateData on undo/redo transactions
=======================================================================

On App:Document::undo, applchn is called on every transactional object (e.g. properties) affected, which
calls Paste on the property.

Each of the properties of SketchObject cause a call to SketchObject::OnChanged, and App::DocumentObject::OnChanged, the latter
calling onChangeProperty, which signals the viewprovider from Gui::Document::slotChangedObject via ViewProviderSketch::updateData.

This causes that the ViewProvider is updated when Constraints and Geometry indexes are not matching.

The solution proposed has three parts:
1. First, at ViewProvider::updateData update is prevented while undo/redo transaction is performed by checking isPerformingTransaction()
2. Second, the onUndoRedoFinished() mechanism of SketchObject causes the call of updateData when it solves the sketch (and sets the solved geometry)
3. Third, Gui::Document::signalUndoDocument and Gui::Document::signalRedoDocument (via the slots in ViewProviderSketch) are
used to perform the recompute of the ViewProvider when the undo/redo transaction is finished if needed.
2020-06-14 14:44:28 +02:00
Abdullah Tahiri
b08aa0d0e9 Sketcher: onUndoRedoFinished implementation and request
=======================================================

The sketchobject is now left in a known status after undo/redo transaction
2020-06-14 14:44:28 +02:00
Abdullah Tahiri
94fda2ec89 Document/DocumentObject: onUndoRedoFinished()
=============================================

New mechanism for on-demand signaling of undo/redo transaction finalisation.

The mechanism consists of:
1) A status bit that is set, when an object should receive this signaling (e.g. because changes during transaction have been inhibited)
2) The new function to be called by the Document undo/redo actions when the transaction is over (for those objects having the status bit set).

Note 1: The undo/redo signals are now outside the undoing FlagToggler, this means that:
1) a call to isPerformingTransaction will return false.
2) a recompute the slot of such a signal will not be inhibited.

Note 2: The undo/redo signals are called once the documentobjects that requested to be notified after the trasaction is over have been notified.
The consequence is that the viewprovider can rely on the documentobject having a correct status.

I think that the behaviour of Note and Note 2 is the wanted behaviour of this signals, I cannot rule out that other parts of FC rely on the old
implementation.
2020-06-14 14:44:28 +02:00
donovaly
1fa5d3759c [TD] use KeyboardTracking for section view dialog
use the keyboardTracking feature as we now also do for the detail view dialog
2020-06-14 06:47:37 -04:00
donovaly
e55d522970 [TD] remove hatch property DirProjection
as discussed in https://forum.freecadweb.org/viewtopic.php?f=35&t=47536&p=408075#p407904
the property DirProjection can go.
2020-06-13 20:45:31 -04:00
donovaly
ade9a9b34d DlgPrefsTechDrawGeneral.ui: get rid of explicit font family
this is unnecessary since Qt will automatically use the available font. It only raises questions since one see in the commit diffs that depending on who modified the dialog, his system default font will appear. (like in the initial commit of this PR)
2020-06-13 20:44:57 -04:00
donovaly
99d5adbc5e [TD] some wording fixes
- I had a look at Crowdin and saw that the translators don't know what to do with the uppercase letter words. And in fact we can use "normal" terms
- I also fixed a typo (missing 'd') to be consistent
2020-06-13 20:44:57 -04:00
donovaly
b3a6b22308 code simplification 2020-06-13 09:46:20 -04:00
donovaly
da4be69493 [TD] fix hatch color issue
as discussed: https://forum.freecadweb.org/viewtopic.php?f=35&t=47536&p=407916#p407916
there are 2 types of SVG declarations possible
2020-06-13 09:46:20 -04:00
wmayer
dc05aeef4a Gui: [skip ci] add missing include to precompiled header 2020-06-13 12:22:47 +02:00
wmayer
2799f553a1 Py2: fix Python 2 build failure 2020-06-12 17:51:33 +02:00
wmayer
47b862bbd9 boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
wmayer
2571b8591c cast between incompatible function types from 'PyObject* (*)(PyObject*, PyObject*, PyObject*)' {aka '_object* (*)(_object*, _object*, _object*)'} to 'PyCFunction' {aka '_object* (*)(_object*, _object*)'} [-Wcast-function-type] 2020-06-12 17:51:33 +02:00
wmayer
29fb43110b replace use of deprecated function ftime with gettimeofday 2020-06-12 17:51:33 +02:00
wmayer
8b5e05d1dc Fix -Wdeprecated-copy 2020-06-12 17:51:33 +02:00
wmayer
a455927d4a Qt5: Replace deprecated functions of QString:
'QString& QString::vsprintf(const char*, __va_list_tag*)' is deprecated: Use vasprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
'QString& QString::sprintf(const char*, ...)' is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
2020-06-12 17:51:33 +02:00
wmayer
aefd5e2358 Qt5: 'void Q[Plain]TextEdit::setTabStopWidth(int)' is deprecated [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
98b1116424 Qt5: QDialog extension/orientation is deprecated [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
e00ff1d78d Qt5: 'void QFileDialog::setNameFilterDetailsVisible(bool)' is deprecated: Use setOption(HideNameFilterDetails, not enabled) instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
2641746808 Qt5: 'void QFileDialog::setConfirmOverwrite(bool)' is deprecated: Use setOption(DontConfirmOverwrite, not enabled) instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
d456b1021e Qt5: 'QVariant qVariantFromValue(const T&)' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
cff0638672 Qt5: QDesktopWidget is deprecated use QScreen [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
ed8a5f2ba7 Qt5: 'QModelIndex QModelIndex::child(int, int) const' is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
c8dae9eb85 Qt5: 'void QTime::start()' / 'int QTime::elapsed() const' / 'int QTime::restart()' are deprecated: Use QElapsedTimer instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
8dbe26a95f Qt5: 'int QFontMetrics::width' is deprecated since Qt 5.11: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
0f60598964 boost: remove broken define that causes a warning: ISO C++11 requires whitespace after the macro name 2020-06-12 17:51:33 +02:00
wmayer
730154a684 boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
wmayer
88fd77b31d Porting Py3.8/Py3.9:
Since Py3.3: 'Py_ssize_t PyUnicode_GetSize(PyObject*)' is deprecated [-Wdeprecated-declarations]
Since Py3.9: 'PyObject* PyEval_CallObjectWithKeywords(PyObject*, PyObject*, PyObject*)' is deprecated [-Wdeprecated-declarations]
Since Py3.9: 'void PyEval_InitThreads()' is deprecated [-Wdeprecated-declarations]
2020-06-12 17:51:33 +02:00
wmayer
867adbe1b5 Py3.8: [skip ci] missing initializer for member '_typeobject::tp_vectorcall' [-Wmissing-field-initializers] 2020-06-12 17:51:33 +02:00
wmayer
c319cf169d Py3.8: [skip ci] missing initializer for member '_typeobject::tp_vectorcall' [-Wmissing-field-initializers] 2020-06-12 17:51:33 +02:00
wmayer
40dc3ccedd Qt5: 'QString QFileInfo::readLink() const' is deprecated: Use QFileInfo::symLinkTarget() instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00