Commit Graph

2112 Commits

Author SHA1 Message Date
wmayer
e743c30f3b Add Global.h headers to modules 2021-12-18 14:06:40 +01:00
Abdullah Tahiri
49d4ef2471 Sketcher: Fix Debug mode GeoUndef 2021-12-17 16:48:50 +01:00
Abdullah Tahiri
fbda0498fd Sketcher: Fix recompute issue
=============================

Bug:
https://forum.freecadweb.org/viewtopic.php?f=3&t=64548

Apparently a find/replace gone wrong when moving code in:
f29a6a0518
2021-12-17 15:05:51 +01:00
luz paz
ab66d7b34f Sketcher: Fix various typos 2021-12-16 03:31:23 +01:00
Abdullah Tahiri
17836f5d39 Sketcher: GeoList remove _PreComp 2021-12-11 21:48:21 +01:00
Abdullah Tahiri
e20039cbbb Sketcher: GeoList Improvements
==============================

- Improve GeoList to support GeoElementId input
- Support VertexId to GeoElementId conversion
- GeoListModel gets separate getGeometry and getGeometryFacade naked pointers
- Sketcher: GeoList - make index mappings mutable
- Improve documentation
2021-12-11 17:02:00 +01:00
Abdullah Tahiri
3c43b50608 Sketcher: Improve documentation of GeoEnum, PointPos and GeoElementId 2021-12-11 17:01:39 +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
luz paz
b6f9f39ffc Fix various typos and grammatical refinements 2021-12-09 08:57:52 -06:00
Abdullah Tahiri
62c8125097 Sketcher: Addition of layerId field to SketcherGeometryExtension, GeometryFacade and ExternalGeometryFacade, and their Python wrappers 2021-12-07 16:30:55 +01:00
Abdullah Tahiri
f29a6a0518 Sketcher: move GUI common utility functions to a new file Utils.h
=================================================================

Common utility functions used by almost all Command classes were previous in Constraint.h.

Aside from providing a very bad intent, it created unnecessary header dependencies.

This commit separates these common functions into a new header, utils.h, which is then
used in all command classes where it is necessary.
2021-12-07 16:30:55 +01:00
Abdullah Tahiri
5f0d3e22fc Sketcher: CommandSketcherTools add missing include that was indirectly satisfied 2021-12-07 16:30:53 +01:00
Abdullah Tahiri
6857f105f7 Sketcher: ConstraintType enum indicate underlying type
======================================================

This enables forward declaration
2021-12-07 16:30:53 +01:00
Abdullah Tahiri
e472aef28a Sketcher: SketchObject - method to getCompleteGeometry as GeometryFacade
========================================================================

As GeometryFacade is provided with more sketcher specific functionality, the demand
for to get GeometryFacades instead of Part::Geometry object increases too. This
addition reflects this increase of demand.
2021-12-07 16:30:53 +01:00
Abdullah Tahiri
db1bcc5f13 Sketcher: Move GeoEnum struct to separate file
==============================================

Separate struct into own file to avoid having to include all the dependencies of SketchObject in other code that relies on GeoEnum.
2021-12-07 16:30:53 +01:00
Abdullah Tahiri
b88dad5ef2 Sketcher: Create GeoList class
==============================

Class for managing internal and external geometry as a single object. This is a light-weight alternative to
passing the whole SketchObject.

It reflects the format used in getCompleteGeometry of SketchObject and Sketch solver facade class, while providing
several convenient conversion functions to map indices.

Internal and external geometries are present in a single geometry vector one after the other.

The index of the geomlist (all layers) and the GeoId can be converted from each other at needed
using the member fuctions (and sometimes the static member functions).

Internal implementation is as a template GeoListModel<T>.

The following types are instantiated. Specialisation is provided where necessary.

GeoList = GeoListModel<Part::Geometry *>;
GeoListFacade = GeoListModel<std::unique_ptr<const Sketcher::GeometryFacade>>;

This enables to use the lighter GeoList were sufficient, while enabling off-the-shelf replacement
when switching to a GeoListFacade is necessary.
2021-12-07 16:30:53 +01:00
Abdullah Tahiri
1e66792cf9 Sketcher: GeometryFacade Improvements
===============================================

1. Correct GeometryFacade getGeometry for const objects.
2. Modifications to avoid exceptions on the constructors.
3. Add default move constructor and move assignment operator.
4. Delete default copy constructor and copy assigment operator.
2021-12-07 16:30:53 +01:00
Abdullah Tahiri
fa1a571cc9 Sketcher: Constraint.h - add underlying type to PointPos enum
==============================================================

This enables forward declarations.
2021-12-07 16:30:53 +01:00
wmayer
ca5c799ce2 Gui: rename methods of SelectionObserver to clarify intention in client code 2021-12-07 14:17:07 +01:00
luz paz
0042f58e4c Make source code comments use gender neutral pronouns
The changes also include some grammatical fixes as well.
2021-12-02 16:18:04 -05:00
0penBrain
be88e838c1 [Sketcher][Bugfix] Slot: fix segfault accessing empty vector 2021-12-01 18:48:05 +01:00
0penBrain
834ae29ad0 [Sketcher] Allow to autoconstraint slot horizontal/vertical 2021-11-29 14:38:53 +01:00
0penBrain
abe4babd13 [Sketcher] Introduce hack to be able to vertically/horizontally auto-constrain primitives
Adds a new type "VERTEX_FOR_PRIMITIVE" that will analyze the direction for vertical/horizontal but not for tangent

 If defined, makes use of GeoId item of AutoConstraint struct (instead of last geometry) to apply the horizontal/vertical
 constraint. This allow this constraint to be applied on an arbitrary geometry.
2021-11-29 14:38:53 +01:00
0penBrain
7c0c6bf671 [Sketcher] Ability to snap slot horizontal/vertical
Triggered by pressing Ctrl key when creating the slot
 Extra constraint is added in case snapping is enabled
2021-11-29 14:38:53 +01:00
0penBrain
0ead26f5c2 [Sketcher] Floating point computation immunity for carbon copy parallel/aligned checks 2021-11-27 08:58:25 +01:00
0penBrain
0ccdf8b717 [Sketcher] Improve a bit XZ plane mapping by using quaternions directly 2021-11-27 08:58:25 +01:00
0penBrain
ad408a0989 [Sketcher] Change diameter symbol used in presentation string, fixes #4779
Standard symbol \u2300 currently used generates text misalignment/cutout on some environments
 Replaced with \uD8 (capital O with stroke) that solves the issue -- and looks better
2021-11-24 14:29:20 +01:00
0penBrain
e5ea670633 [Sketcher][Bugfix] Fix crash when applying 'Constrain internal alignment' on contraints, fixes #4790 2021-11-22 20:08:07 +01:00
Yorik van Havre
a26fb4db1a Merged crowdin translations 2021-11-16 17:30:39 +01:00
Uwe
51cc91da84 Update src/Mod/Sketcher/Gui/TaskSketcherValidation.ui
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2021-11-12 00:45:46 +01:00
luz paz
bad413b0f7 Sketcher: fix typo in Gui/TaskSketcherValidation.ui 2021-11-12 00:45:46 +01:00
wmayer
4f56ee263d Sketcher: fix some memory leaks 2021-11-06 17:48:35 +01:00
0penBrain
7cd3930dd8 [Sketcher] Removed lines that was introduced to workaround grid visibility management issues 2021-11-05 03:18:08 +01:00
0penBrain
b22f2c6562 [Sketcher] Add tooltips in Validate Sketch task UI 2021-11-04 18:40:26 +01:00
0penBrain
eac21354fa [Sketcher] Refactor Validate Sketch task UI to decrease confusion 2021-11-04 18:40:26 +01:00
wmayer
09e2e7acfa Sketcher: [skip ci] handle coincident points when trying to create arc/circle 2021-10-28 17:03:11 +02:00
luz paz
044929342a Sketcher: fix typos in Constraint Widget
- Follow-up to 2f789e6ce7

- Sketcher: fix relevant typos

- Re-Add mistakenly deleted files

- fix build
2021-10-23 18:37:33 +02:00
wmayer
796efc4c6b Sketcher: fix segmentation fault when using sketch validation dialog after document has been closed
Therefore replace the raw pointer of SketchObject with the template class WeakPtrT. This class will be notified as soon as its handled object will be deleted.
2021-10-21 16:22:11 +02:00
luz paz
42e8287699 Fix various typos
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,bottome,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,inout,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,ontop,orgin,orginx,orginy,ot,pard,parms,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,./build/doc/SourceDocu`
2021-10-20 18:18:33 -04:00
Chris Hennes
890c40fcb6 Merge pull request #5115 from Syres916/patch-33
[Sketcher] Angle Constraint Name displayed...
2021-10-20 08:39:46 -05:00
Chris Hennes
4e0b8c535f [Sketcher] Workaround for Elements theme issue
After merging the change to the Constraint status label in f2a073ca5,
the TaskSketcherElements would sometimes be reduced in size to just a
line or two, if multiple task views were expanded and a stylesheet was
enabled. This commit introduces a minimum size to the TSE to prevent
that from occurring.
2021-10-20 08:06:05 -05:00
Syres916
7ebf53e94d [Sketcher] Minor bugfix to display angle...
...constraint names as per recommendation, see discussion https://forum.freecadweb.org/viewtopic.php?f=3&t=62953
2021-10-16 12:20:55 +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
Abdullah Tahiri
0d16160f4e Sketcher: Code improvements for Constraint Widget
=================================================

This PR does not have added functionality. It contains only code improvements requiring at least c++17.

- It uses for the filters scoped enums (enum classes) instead of unscoped enums to avoid implicit conversion (c++11).
- It includes tools to deal with the necessary explicit conversions including type_t traits (c++14).
- It uses a couple of generic lambdas (c++17)
- It uses folding expressions to expand parameter packs (c++17)
- Refactoring of code
2021-10-13 15:28:30 +02:00
abdullahtahiriyo
4579b842fd Merge branch 'master' into sketcherMoveColorsToPrefs 2021-10-13 10:01:30 +02:00
Abdullah Tahiri
6e4a09f569 Sketcher: Copy and Array tool Snap at 5 degrees using CTRL 2021-10-12 09:41:58 +02:00
Chris Hennes
6bcda71712 Merge branch 'master' into sketcherMoveColorsToPrefs 2021-10-11 12:31:08 -05:00
Abdullah Tahiri
9b2de68000 Sketcher: Constraint widget associated constraints filter
=========================================================

A new special filter, that filters the constraint list so as to show the constraints associated with the
currently selected geometries.
2021-10-11 16:40:48 +02:00
Abdullah Tahiri
08542055c4 Sketcher: Redesign of Constraint settings
=========================================

=> The old controltab is substituted by: direct controls (buttons on the constraint widget) and a settings dialog that is independently fired via a button with a settings icon

This makes more space for the list of constraints and generates a lower amount of confussion regarding the old tab names and functions.

Direct control ensures that the most used operations are at hand, while other less changed settings are moved to the settings dialog.

=> Direct controls

One time visibility to match the list selection can be triggered from a new button "Visibility"

This button has drop selections for visibility selections, which are checkable items (currently only one option, but more are envisaged).
The one option currently is the "visibility tracking" functionality. This is a "shortcut" to the option in the settings panel to save unnecessary clicks
in typical operations.

=> Settings dialog

This dialog is live, in that changes to settings are immediatedly propagated to the list control and visibility.
2021-10-11 16:40:48 +02:00