Commit Graph

364 Commits

Author SHA1 Message Date
wmayer
2ee8ad1854 Coverity: Division or modulo by float zero 2020-07-20 17:34:26 +02:00
wmayer
2b97a10323 PVS: V1046 Unsafe usage of the 'bool' and 'int' types together in the operation '&='. 2020-07-18 10:59:28 +02:00
wmayer
cbb5f99ade PVS: V730 Not all members of a class are initialized inside the constructor 2020-07-18 10:59:27 +02:00
Abdullah Tahiri
ac167aa850 Sketcher: ViewProviderSketch inhibit update if internal transaction is ongoing
==============================================================================

Inhibit ViewProviderSketch updateData with invalid data (internal transaction).

Trigger update internally for internal transactions in SketchObject via touched()
so as to trigger updateData.

This leads to a reduction of updateData calls.
2020-07-01 14:04:25 +02:00
wmayer
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
76f818d017 Sketcher: [skip ci] add security checks before accessing pointer 2020-06-14 16:23:16 +02:00
Abdullah Tahiri
7ae2fc7b05 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
wmayer
1ee3d79d7c Qt5: 'int QFontMetrics::width' is deprecated since Qt 5.11: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
4ec45b545e 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
Abdullah Tahiri
f086580013 Sketcher: Make setposition text unpickable
==========================================

fixes #4272

The setposition text string was being picked interfering with preselection of autoconstraints.

Merit for the solution goes to Werner:
https://forum.freecadweb.org/viewtopic.php?f=10&t=47092&p=404519#p404519
2020-06-01 19:56:01 +02:00
Abdullah Tahiri
c457ce613e Sketcher: ViewProvider Grid control
===================================

Encapsulation of grid internals in ViewProviderObject2D, while allowing control via property changes and protected functions.
2020-05-27 19:25:47 +02:00
0penBrain
da33ffc062 [Sketcher] Grid is displayed in 3D view only if sketch is visible 2020-05-27 19:25:47 +02:00
0penBrain
811a44643c [Sketcher] Local settings are correctly restored ; fixes #3952,#4058 2020-05-27 19:25:47 +02:00
0penBrain
9d9aaf680f [Sketcher] Grid snapping is enabled only if grid is shown 2020-05-27 19:25:47 +02:00
0penBrain
286a692ca9 [Sketcher] Move general settings widget enable/disable logic in TaskSketcherGeneral so ...
... all options are freely accessible in the preferences editor ...
 ... eg. no need to check 'Show Grid' to customize grid size or snap
 Also remove the sparse automatical saving to preferences from sketcher Task pane ...
 ... (some settings were saved, some not)
2020-05-27 19:25:47 +02:00
Abdullah Tahiri
4de7acff64 Sketcher: Root point selected when endpoint in external geometry point
======================================================================

fixes #3831

Solver Interface getPointId method is only intended for normal geometry, and returns -1 if geoid is out of range, which was misinterpreted as root point selection.
2020-05-26 14:14:00 +02:00
wmayer
06f479622c Sketcher: modify PR 3201 a bit
+ remove unneeded class members from EditData class
+ do not include ui-header from within header files
+ fix possible memory leak in EditDatumDialog
+ when canceling dialog make sure sketch will be updated
2020-03-19 13:45:52 +01:00
0penBrain
2d9c2c6440 [Sketcher] Constraint driving/driven status integration in dimension edition dialog
This integrates the ability to manage dimensional constraint driving/driven status
 in the constraint edition dialog box.
 It adds a checkbox in the dialog to show/select whether a constraint is driving or
 driven. When the constraint value is modified, it is automatically set as driving.
 Main focus is to allow to edit name (alias) of reference (driven) constraints
 directly in the constraint edition box.

 Resolves #3793, #3978
2020-03-19 13:45:52 +01:00
Zheng, Lei
39959f9500 App: add new convenient class SubObjectT
Derived from App::DocumentObjectT to add support of sub object

Also some minor changes to App::DocumentObjectT

Changed Gui::SelectionChanges to make use of SubObjectT
2020-02-11 15:40:27 -05:00
wmayer
c01c1f7fde Sketcher: add option to disable leaving sketch with Esc button 2020-02-09 13:52:09 +01:00
wmayer
e0f1079f1f Sketcher: [skip ci] explicit command to stop current operation
Fore more details: https://forum.freecadweb.org/viewtopic.php?f=3&t=42207
2020-02-06 15:55:00 +01:00
triplus
37c896d41a Sketcher - improve text readability on dark themes
https://forum.freecadweb.org/viewtopic.php?f=34&t=40493
2020-01-27 10:08:07 +01:00
wmayer
5442dfbbcc Sketcher: [skip ci] force redraw after using rubberband selection 2019-12-27 21:18:27 +01:00
wmayer
4bcb43ebd2 Base: [skip ci] make UnitSystem an enum class 2019-12-21 10:10:19 +01:00
asapelkin
e951094af9 use emplace_back instead of push_back where justified 2019-11-21 14:48:09 +01:00
wmayer
c0d58b8f3e [skip ci] fix more -Wgnu-zero-variadic-macro-arguments 2019-11-17 19:11:08 +01:00
luz.paz
c80ecc4a70 Source typo fix (includes file rename) 2019-10-05 13:19:32 -04:00
luz.paz
7b7797f4f3 Fix various (doxy) typos and whitespace issues
Found via `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,currenty,dof,doubleclick,dum,eiter,elemente,feld,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`
2019-10-03 07:57:13 +02:00
wmayer
19ac3ecfc7 fix crash when switching to fullscreen, back to normal and closing the sketcher 2019-09-30 23:55:11 +02:00
wmayer
d0d92b0801 force strict ISO C++ (-Wpedantic)
for Fem, Import, PartDesign, Robot, Sketcher, TechDraw
2019-09-18 14:18:07 +02:00
DeepSOIC
2eb6300d5f fix Show-related imports 2019-09-14 12:17:01 +02:00
DeepSOIC
a073eb6749 Sketcher: try fix crash when returning to PartDesign 2019-09-09 12:34:55 +02:00
wmayer
9f7075bb8f extend convertTo function to also support SbRotation/Base::Rotation 2019-09-06 21:29:51 +02:00
DeepSOIC
3a48cad651 Sketcher: fix unnecessary filtering objects for TempoVis
TempoVis now should take care of it.

This was originally done to stop Drawing and TechDraw views pop up when closing a sketch the drawing depends on.
Now, TempoVis show_xxx and hide_xxx methods should auto filter out objects that are not in 3d view.
2019-09-04 11:37:48 -03:00
DeepSOIC
f8688d4277 Gui: add tags for TempoVis
Tags can be used to identify TV instances in the stack.  This is mostly for add-ons, for Part-o-magic in particular, who may want to insert some visibility automation in specific places in the stack.
2019-09-04 11:37:48 -03:00
DeepSOIC
1686931e38 Sketcher: add property to allow another workbench for sketch editing
+ use TempoVis for changing the workbench
2019-09-04 11:37:48 -03:00
luz.paz
f22ae848ea Fix misc. typos, whitespace, and http:// to https:// issues 2019-09-03 11:11:43 -03:00
Zheng, Lei
66a719773f Sketcher: fix lost of constraint in undo/redo 2019-08-30 14:57:41 +02:00
Zheng, Lei
00bcef0619 Gui: support in-place editing
The link support means that an object can now appear in more than one
places, and even inside a document different from its own. This patch
adds support for in-place editing, meaning that the object can be edited
at correct place regardless where it is.

See [here](https://git.io/fjPIk) for more info about the relavent APIs.

This patch includes two example of modifications to support in-place
editing. One is the ViewProviderDragger, which simply adds the dragger
node to editing root node by calling
View3DInventorViewer::setupEditingRoot(dragger). The other much more
complex one is ViewProviderSketch which calls setupEditingRoot(0) to
transfer all its children node into editing root. ViewProviderSketch
also includes various modifications to command invocation, because we
can no longer assume the active document is the owner of the editing
object.

This patch also includes necessary modification of the 'Show' module to
support in-place editing.
2019-08-17 15:08:32 +02:00
Zheng, Lei
c8891be856 Gui: add coinRemoveAllChildren to work around Coin3D bug
See bug description:
https://bitbucket.org/Coin3D/coin/pull-requests/119/fix-sochildlist-auditing/diff

Because of path based rendering (SoFCPathAnnotation) in mouse over
highlight, this bug causes crash more frequently here comparing to
upstream.

All C++ calling of SoGroup::removeAllChildren() is replaced by
Gui::coinRemoveAllChildren(), and python code is fixed by monkey
patching SoGroup.removeAllChildren() in FreeCADGuiInit.py.
2019-08-17 14:52:11 +02:00
Abdullah Tahiri
2822381d44 Sketcher: ViewProvider representation of deactivated constraints 2019-06-22 08:26:31 +02:00
SmallSharky
41c828a3b5 [Sketcher] Fix initial autoconstraints behavior 2019-05-18 11:54:37 +02:00
wmayer
4c63bd49e3 fix Sketcher build failure 2019-05-16 12:46:02 +02:00
Abdullah Tahiri
dc32a0685b Sketcher: GUI PCH 2019-05-02 07:12:51 +02:00
luz.paz
0238906d38 Misc. typo and whitespace fixes
Found via `codespell`
2019-04-30 10:15:59 -03:00
Abdullah Tahiri
a1c83e7150 Sketcher: Comment out very specific debug code 2019-04-24 17:56:37 +02:00
triplus
6bc555c9be Fix for build failure on Ubuntu 16.04 2019-03-31 11:32:06 +02:00
Abdullah Tahiri
0a8b67cefc Sketcher: Fix bug in curvature graph
====================================

https://forum.freecadweb.org/viewtopic.php?f=3&t=34979&p=295324#p295324
2019-03-31 11:12:05 +02:00
wmayer
2f2d505359 fixes 0003130: FreeCAD 0.17 Qt5 bugs with external display 2019-03-14 19:28:11 +01:00
wmayer
51811e4bf4 PVS: V688 A local variable possesses the same name as one of the class members, which can result in a confusion 2019-03-13 11:58:43 +01:00