Commit Graph

85 Commits

Author SHA1 Message Date
Abdullah Tahiri
0f6ac5e40a Sketcher: command - review code improvements 2023-02-25 23:13:55 +01:00
Abdullah Tahiri
279b684e56 Sketcher: Grid Command - Correct dependencies 2023-02-25 23:13:55 +01:00
Abdullah Tahiri
18046c1277 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
fe405fcefb Sketcher: Refactor miscelaneous command isActive() 2023-02-25 23:13:55 +01:00
Paddle
40271a29ea 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
e24daabf1f [Sketch] Gui: A - D: remove unused headers
- also some sorting
2022-12-11 23:47:03 +01:00
wmayer
cbac99a8ed Sketcher: [skip ci] remove unused includes 2022-09-25 11:09:29 +02:00
0penBrain
c910ff6509 Sketcher/BackEdit: makes clip plane switch side according to view side 2022-09-09 16:09:42 +02:00
berniev
180edfa3cc Mod: Single arg ctors must be explicit 2022-08-24 16:55:20 +02:00
berniev
71dc5ead2f Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
53ba98d636 Mod: use empty 2022-08-06 19:30:13 +02:00
Uwe
0399b3f087 [Sketch] remove superfluous nullptr checks 2022-07-18 02:51:49 +02:00
Zheng, Lei
8bec44934b Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
589369a2cc Sketcher: PR6497 move return statement to new line 2022-03-29 13:25:06 -05:00
wmayer
51186c018e Sketcher: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
wmayer
8f786ea6ef Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
mwganson
705b3221af [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
44567167ff Sketcher: Convert PointPos into an enum CLASS 2021-12-11 16:17:21 +01:00
Abdullah Tahiri
182596ba08 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
9f15372d86 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
3edea9891f Sketcher: [skip ci] remove superfluous QT_TRANSLATE_NOOP from Sketcher commands 2021-09-29 15:46:06 +02:00
FreeCAD-Tools
e22335ec2e Update Command.cpp 2021-09-27 15:38:41 +03:00
Chris Hennes
ac05ce6245 Eliminate Windows debug-mode warning 2020-12-20 15:46:28 +01:00
Chris Hennes
533814dd0f 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
7bf395bda6 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
da46b9de3d Sketcher: [skip ci] remove superfluous transaction when start/finish editing a sketch 2020-10-22 19:35:20 +02:00
wmayer
731f89ccbf 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
5d37581019 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
b47a0a0a58 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
817f2f15aa Sketcher: add two icons reorient and validate 2020-10-01 09:59:26 +02:00
luz.paz
65f6347953 [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
7064ebc581 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
c16b0e4e61 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
7008cf92de 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
d488218701 [skip ci] fix more -Wgnu-zero-variadic-macro-arguments 2019-11-17 19:11:08 +01:00
luz.paz
044213d6ad Source typo fix (includes file rename) 2019-10-05 13:19:32 -04:00
wmayer
b1dd1e61a7 force strict ISO C++ (-Wpedantic)
for Fem, Import, PartDesign, Robot, Sketcher, TechDraw
2019-09-18 14:18:07 +02:00
DeepSOIC
c9575447c0 Sketcher: don't change camera zoom when creating a sketch 2019-09-04 11:37:48 -03:00
Zheng, Lei
d4ac072306 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
5c6ab3d8c8 V1016 CWE-681 2019-04-08 14:35:47 +02:00
wmayer
a57504afb9 0003897: 'View Sketch' button doesn't account for container transform 2019-03-11 12:54:26 +01:00
wmayer
21d01fe6fc Replace Base::Exception with appropriate subclass 2018-11-14 19:27:52 +01:00
Abdullah Tahiri
dbfb81dc47 Sketcher: Section Command enabling the clipping planes 2018-05-25 17:24:57 -03:00
Abdullah Tahiri
89071f74b7 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
d64575a111 Sketcher: Merge, copy expressions
===================================

Support for copying expressions instead of hard values.

fixes #2936
2017-12-12 23:08:44 +01:00
wmayer
1ed21e0c05 fixes #0002434: merge sketches produces sketch on XY plane when original sketches were on XZ 2017-10-18 21:17:15 +02:00
asiersarasua
289f901c29 Fix typos 2017-04-23 18:48:21 -03:00
wmayer
7472b05b16 fixes #0002781: Build error message 2016-11-19 13:47:37 +01:00
wmayer
b1904dfd28 replace hard coded numbers with static constants 2016-10-23 13:44:26 +02:00