Commit Graph

83 Commits

Author SHA1 Message Date
Abdullah Tahiri
5a0e7d4ee3 Sketcher: Rewrite grid command
==============================

Fix unresolved issues:
https://github.com/FreeCAD/FreeCAD/pull/7754/files#r1025493443
https://github.com/FreeCAD/FreeCAD/pull/7754/files#r1019077589
https://github.com/FreeCAD/FreeCAD/pull/7754/files#r1025502204

Summary:
- EventFilter unnecessary in light of new implemented signal aboutToshow. The data of the drop-down action is updated only when necessary (when it is going to be shown).
- Structure of individual commands under drop-down simplified to a single action, rendering the need for groupcommands obsolete, while keeping all the grid related controls and
the logic for controlling the grid in a single action class.
- Reduce the complexity and overload of isActive to the bare minimum (determining if it is active and updating the icon to the right icon if so).

Refactor:
- Better name for utils functions, as when a DSH is active, the edit mode VPSketch is a data member of DSH, sketchgui (so this function is not really necessary when the DSH is active).
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
816fa3fe3e Sketcher: Refactor miscelaneous command isActive() 2023-02-25 23:13:55 +01:00
Paddle
2cba01586a Sketcher: Grid rework. Include:
- Adding 'auto spacing' option.
    - Drawing grid dynamically on viewer area only.
    - Moving code to coinManager.
    - Adding a 'grid tool' to sketcher-edit-mode toolbar.
2023-02-25 23:13:55 +01:00
Uwe
08932bd92d [Sketch] Gui: A - D: remove unused headers
- also some sorting
2022-12-11 23:47:03 +01:00
wmayer
e2a552a9c6 Sketcher: [skip ci] remove unused includes 2022-09-25 11:09:29 +02:00
0penBrain
968fb5be34 Sketcher/BackEdit: makes clip plane switch side according to view side 2022-09-09 16:09:42 +02:00
berniev
6953310116 Mod: Single arg ctors must be explicit 2022-08-24 16:55:20 +02:00
berniev
ddafb98813 Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
b796a0d376 Mod: use empty 2022-08-06 19:30:13 +02:00
Uwe
16c86a6d08 [Sketch] remove superfluous nullptr checks 2022-07-18 02:51:49 +02:00
Zheng, Lei
3ef438eaf0 Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
1ee046788d Sketcher: PR6497 move return statement to new line 2022-03-29 13:25:06 -05:00
wmayer
ead5154b18 Sketcher: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
wmayer
1ca7429705 Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
mwganson
32e0e427c0 [sketcher_mapsketch] prevent circular dependency by disallowing mapping a sketch to an object in the sketch's outlistrecursive, make the command active only when there is a selection, recompute after doing attachment 2021-12-25 08:09:54 +01:00
Abdullah Tahiri
97c82a6703 Sketcher: Convert PointPos into an enum CLASS 2021-12-11 16:17:21 +01:00
Abdullah Tahiri
bb76be1371 Sketcher: GeoId, GeoElementId and GeoUndef refactor
===================================================

This commit is an independent refactor of the identifications used at Sketcher level.

It introduces a new type "GeoElementId" as a combination of GeoId and PointPos.

It moves the Undefined GeoId, previous Constraint::GeoUndef to GeoEnum, together with all
other fixed values of GeoIds.
2021-12-11 16:17:21 +01:00
Abdullah Tahiri
0926a4148b Sketcher: Default Shortcuts
===========================

Following:
https://forum.freecadweb.org/viewtopic.php?p=539914#p539914

Following requests from OpenBrain and ChrisB:
https://forum.freecadweb.org/viewtopic.php?p=540015#p540015

Following request from M4X:

Recomendation to use "L" and "I" for vertical and horizontal distance constraints and "R" for radius.

https://forum.freecadweb.org/viewtopic.php?p=540049#p540049

https://forum.freecadweb.org/viewtopic.php?p=540011#p540011
2021-10-16 09:23:22 +02:00
wmayer
6f6272f12b Sketcher: [skip ci] remove superfluous QT_TRANSLATE_NOOP from Sketcher commands 2021-09-29 15:46:06 +02:00
FreeCAD-Tools
65df3b46e2 Update Command.cpp 2021-09-27 15:38:41 +03:00
Chris Hennes
adc6db8f32 Eliminate Windows debug-mode warning 2020-12-20 15:46:28 +01:00
Chris Hennes
ea3ecf4054 Silence Qt/Windows setGeometry Warning
Add the optional Qt::MSWindowsFixedSizeDialogHint parameter to all uses of the QInputDialog::getX static functions to silence a Qt/Windows debug mode warning about QWindowsWindow::setGeometry: Unable to set geometry. Increase the size of the unit calculator to eliminate the same warning. Finally, call adjustSize() on the "Unsaved Changes" dialog to silence the warning.
2020-12-11 09:58:09 +01:00
luz paz
5effcc1983 Sketcher: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the Sketcher Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
wmayer
a2a1f04f23 Sketcher: [skip ci] remove superfluous transaction when start/finish editing a sketch 2020-10-22 19:35:20 +02:00
wmayer
cd4901bf51 Sketcher: [skip ci] do not create dialog on heap if not needed to improve exception-safety and reduce possible memory leaks 2020-10-22 16:01:22 +02:00
wmayer
ee79991c46 Sketcher: fix regression in CmdSketcherValidateSketch
Do not enable the command if another task dialog is still active
2020-10-22 14:53:52 +02:00
vocx-fc
9bd31637d7 Sketcher: clean up general commands tooltips
* `MapOnSketch` is active only when there is a sketch available
  in the document.
* `ReorientSketch` and `ValidateSketch` are active only when one,
  and only one, sketch is selected.
* `MergeSketch` is active only when there is at least two sketches
  selected.
* `MirrorSketch` is active only when there is at least one sketch selected.

Clean up the lines so they are not extremely long.
2020-10-22 14:53:52 +02:00
vocx-fc
4620b9fd9d Sketcher: add two icons reorient and validate 2020-10-01 09:59:26 +02:00
luz.paz
76a77e4f88 [skip ci] Fix typos
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,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-03-24 11:14:24 +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
Rajendra Pardeshi
28d67eba2e Issue ID 0004230 : Fixing a crash in chamfer command. Putting a null check for the function return value
[skip ci]
2019-12-30 15:49:51 +01:00
luz.paz
b2ffebf1c0 Sketcher: [skip ci] fix header uniformity
This PR fixes header uniformity across all Sketcher WB files
2019-12-22 01:00:29 +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
wmayer
d0d92b0801 force strict ISO C++ (-Wpedantic)
for Fem, Import, PartDesign, Robot, Sketcher, TechDraw
2019-09-18 14:18:07 +02:00
DeepSOIC
0c5eb5519f Sketcher: don't change camera zoom when creating a sketch 2019-09-04 11:37:48 -03: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
Abdullah Tahiri
504a687ad6 V1016 CWE-681 2019-04-08 14:35:47 +02:00
wmayer
568faf67a0 0003897: 'View Sketch' button doesn't account for container transform 2019-03-11 12:54:26 +01:00
wmayer
56db19824e Replace Base::Exception with appropriate subclass 2018-11-14 19:27:52 +01:00
Abdullah Tahiri
ab478f947c Sketcher: Section Command enabling the clipping planes 2018-05-25 17:24:57 -03:00
Abdullah Tahiri
c54c08cca4 Sketcher: Wrong mapping of constraints to axes
==============================================

Expressions for remapping of geometry where simply wrong.

Surprisingly no bug reports were filed for this one.
2017-12-12 23:08:44 +01:00
Abdullah Tahiri
588f1bd795 Sketcher: Merge, copy expressions
===================================

Support for copying expressions instead of hard values.

fixes #2936
2017-12-12 23:08:44 +01:00
wmayer
f5b6694c83 fixes #0002434: merge sketches produces sketch on XY plane when original sketches were on XZ 2017-10-18 21:17:15 +02:00
asiersarasua
43704f31ee Fix typos 2017-04-23 18:48:21 -03:00
wmayer
5e3381be25 fixes #0002781: Build error message 2016-11-19 13:47:37 +01:00
wmayer
222e9b6b46 replace hard coded numbers with static constants 2016-10-23 13:44:26 +02:00
wmayer
15d7ae5e2c fix -Wextra in Sketcher 2016-09-22 18:34:35 +02:00
wmayer
d39bd4906b fix Coverity issues 2016-08-20 19:45:36 +02:00