Commit Graph

26818 Commits

Author SHA1 Message Date
Chris Hennes
20a74ce423 Addon Manager: Clean up report window output 2021-12-30 20:06:22 -06:00
Benjamin Alterauge
e81ee6f540 Use std::map without const 2021-12-30 17:40:45 +01:00
Benjamin Alterauge
3f85853e09 Spreadsheet: Fix trouble with clang and MacOS
Since the Spreadsheet: support cell binding commit, I got trouble by building freecad. I didn't find similar reports in install/compile forum. So I will only use the old version of typedef for macos. Better solutions are welcome.

See [trouble details](0c54f3236e (commitcomment-62364932))
2021-12-30 17:40:45 +01:00
wmayer
edd1d3e8e5 Gui: move options to use native or Qt dialogs to class DialogOptions 2021-12-30 17:31:00 +01:00
mwganson
9976b4cf84 [core] Add new parameter to BaseApp/Preferences/Dialog called DontUseNativeColorDialog, default to true 2021-12-30 17:07:25 +01:00
Adrian
7f0bc597a5 Mouse navigation: change unnecesary warnings to messages
sent when trying to set rotation center without an object under the cursor and can be annoying if report view is set to show with warnings.
2021-12-30 15:46:38 +01:00
mdkus
5e6fec53ea Tools: small bug fix for showing the correct test icon 2021-12-30 15:39:07 +01:00
wmayer
dfa202c234 Sketcher: fix build failures with MinGW 2021-12-30 15:12:56 +01:00
wmayer
e01ab89317 Sketcher: fix build failures with MSVC 2021-12-30 14:54:37 +01:00
Yorik van Havre
3a74e1c8b4 Fem: Fixing translation context 2021-12-30 13:06:05 +01:00
Chris Hennes
7874b0dd6c Addon Manager: Do not change image size
The new UI has much more space available to display README files: remove
the code that scaled the images to (sometimes unreadable) 300x300 size.
2021-12-29 23:51:21 -06:00
Chris Hennes
607ebd278a Addon Manager: Add filter on installation status 2021-12-29 23:32:20 -06:00
Chris Hennes
5bcf697008 Addon Manager: Add Check for updates button 2021-12-29 22:50:23 -06:00
Chris Hennes
42e0cf0c8a [Spreadsheet] Use stylesheet for alias color
When setting the text color for an invalid alias, use the Qt stylesheeet
mechanism rather than QPalette, so that it works correctly with
an applied QSS stylesheeet. Also attempt to detect a darkmode stylesheet
and use lighter shade of red so that the alias is more legible. Finally,
instead of explicitly setting the text color to black when it's valid,
reset to the original stylesheet (usually an empty string). This ensures
that in a dark stylesheet the text color is legible.

Fixes #0004803.
2021-12-29 21:49:00 -06:00
luz paz
546a243ad9 App: fix doxygen typo 2021-12-30 01:09:10 +01:00
luz paz
01c5475eae Path: fix source comment typo 2021-12-30 01:08:16 +01:00
wmayer
88c015e007 Gui: encoding/decoding of system specific error message 2021-12-30 00:48:57 +01:00
Yorik van Havre
91bfb0fbb6 Merged crowdin translations 2021-12-29 12:20:12 +01:00
Yorik van Havre
372f1f7beb Updated ts files 2021-12-29 12:09:06 +01:00
Syres916
ad6c607f5c [Gui] MainWindow New Doc camera position bugfix
See https://forum.freecadweb.org/viewtopic.php?p=556465#p556465
2021-12-28 20:49:58 +01:00
wmayer
bb69d9b663 Base: fix issue found by lgtm: Inconsistent definition of copy constructor and assignment ('Rule of Two') 2021-12-28 17:47:20 +01:00
wmayer
09fb4bc2d2 Part: fix issue found by lgtm: Expression has no effect 2021-12-28 17:38:20 +01:00
luz paz
df55155c27 Sketcher: fix source comment 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,childrens,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,parm,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-12-28 10:26:37 -06:00
wmayer
d538872eb2 0004809: Security vulnerability in DWG import when using ODA file converter 2021-12-28 16:15:42 +01:00
Yorik van Havre
260a40f133 Arch: Added 'flip direction' context menu option to walls 2021-12-28 13:17:47 +01:00
Chris Hennes
f47435fa40 Addon Manager: Correct wording 2021-12-27 19:54:52 -06:00
Abdullah Tahiri
22c31aeac6 Sketcher: Adapt Typed Facade to new behaviour of automatic taking ownership of emplaced pointer 2021-12-27 21:03:51 +01:00
Abdullah Tahiri
69c31dce82 Sketcher: GeoList improvements
==============================

- Constructor from const vector reference is not allowed to take ownership (as it should not delete the const pointer). The ownership parameter is removed.

- Factory method for const objects cannot either. So the ownership parameter is also removed.
2021-12-27 21:03:51 +01:00
Abdullah Tahiri
bbf9c34c2f Sketcher: GeometryFacade improvements
=====================================

- GeometryFacade will throw when instantiated with a const Part::Geometry * that does not have a SketchGeometryExtension. It
cannot create it because it is not supposed to modify a pointer to a const object.

- Static functions will check the passed Part::Geometry * parameters and will throw if nullptr.

- GeometryTypedFacade constructor and factory methods to take owner parameter (defaulted to false) for consistency with GeometryFacade.

- The emplace style factory method will make the GeometryFacade take ownership of the emplaced Part::Geometry *. This should avoid memory leaks. The
user shall setOwner(false) if it needs to release() the underlying Part::Geometry * (to transfer ownership).

- Code comments made into doxygen documentation.
2021-12-27 21:03:51 +01:00
Abdullah Tahiri
31832e6c8e EditCoinManager: Ensure rootpoint is higher than constraints
============================================================

Following new behaviour of highlighting root point on full constrained:
https://forum.freecadweb.org/viewtopic.php?p=555663#p555663

the rootpoint was lowered in virtual height with respect to the rest of points, so that
the color of any other overlapping point takes precedence.

However, this made it the same height as constraints, causing it to be unpickable in presence of
a colocated constraint:
https://forum.freecadweb.org/viewtopic.php?p=556114#p556114

Solution: Raise all points by one
2021-12-27 21:03:51 +01:00
Abdullah Tahiri
84898bd9a8 Part: Geometry and Sketcher: GeometryFacade and ExternalGeometryFacade
======================================================================

Change pass-by-value to const reference.

Thanks Kunda!

https://lgtm.com/projects/g/FreeCAD/FreeCAD/alerts/?mode=tree&ruleFocus=2163210742
https://forum.freecadweb.org/viewtopic.php?p=555658#p555658
2021-12-27 21:03:51 +01:00
Abdullah Tahiri
0df17613b1 EditCoinManager: root point full constrained only when there is another point on top 2021-12-27 21:03:51 +01:00
Abdullah Tahiri
053cc36541 EditCoinManager: Additional refactoring 2021-12-27 21:03:51 +01:00
Abdullah Tahiri
e91dcf39c1 Sketcher: Sketch - extraction of geometry as GeoList with owned memory allocation
=================================================================================

Apart from simplifying code, the allocated memory is not managed by the lifetime of the unique pointer owned by the GeometryFacade, preventing memory leaks.
2021-12-27 21:03:51 +01:00
Abdullah Tahiri
bc6e4c1355 Sketcher: GeometryFacade - Add ownership parameter to factory method 2021-12-27 21:03:51 +01:00
Abdullah Tahiri
501ebfe921 Sketcher: GeoList - Fix bug in index conversion 2021-12-27 21:03:51 +01:00
Abdullah Tahiri
0f64eaeb40 Sketcher: Fix root point not fully constrained when sketch is empty 2021-12-27 21:03:51 +01:00
Abdullah Tahiri
7cf12a58d6 Sketcher: Use Part::Geom2dCircle::getCircleCenter
=================================================

In 3eaabbe, GetCircleCenter was moved up to Part for code reuse.
2021-12-27 21:03:51 +01:00
Abdullah Tahiri
71c9dc3e0e Sketcher: EditModeCoinManager/DrawSkechHandler refactoring
======================================================

Creation of EditModeCoinManager class and helpers.

In a nutshell:
- EditModeCoinManager gets most of the content of struct EditData
- Drawing is partly outsourced to EditModeCoinManager
- EditModeCoinManager gets a nested Observer class to deal with parameters
- A struct DrawingParameters is created to store all parameters used for drawing
- EditModeCoinManager assume responsibility for determining the drawing size of the Axes
- Preselection detection responsibility is moved to EditModeCoinManager.
- Generation of constraint nodes and constraint drawing is moved to EditModeCoinManager.
- Constraint generation parameters are refactored into ConstraintParameters.
- Text rendering functions are moved to EditModeCoinManager.
- Move HDPI resolution responsibility from VPSketch to EditModeCoinManager
- Move responsibility to create the scenograph for edit mode to EditModeCoinManager
- Move full updateColor responsibility to EditModeCoinManager
- Allows for mapping N logical layers (LayerId of GeometryFacade) to M coin Layers (M<N). This
is convenient as, unless the representation must be different, there is no point in creating coin
layers (overhead).

Refactoring of geometry drawing:
- Determination of the curve values to draw are outsourced to OCC (SRP and remove code duplications).
- Refactor specific drawing of each geometry type into a single template method, based on classes of geometry.
- Drawing of geometry and constraints made agnostic of scale factors of BSpline weights so that a uniform treatment can be provided.

Refactoring of Overlay Layer:
- A new class EditModeInformationOverlayConverter is a full rewrite of the previous overlay routines.

ViewProviderSketch:
- Major cleanup due to migration of functionalities to EditModeCoinManager
- Reduce public api of ViewProviderSketch due to refactor of DrawSketchHandler
- Major addition of documentation
- ShortcutListener implementation using new ViewProvider Attorney
- Gets a parameter handling nested class to handle all parameters (observer)
- Move rubberband to smart pointer
- Refactor selection and preselection into nested classes
- Removal of SEL_PARAMS macro. This macro was making the code unreadable as it "captured" a local stringstream that appeared unused. Substituted by local private member functions.
- Remove EditData
- Improve documentation
- Refactor Preselection struct to remove magical numbers
- Refactor Selection mechanism to remove hacks

ViewProviderSketchDrawSketchHandlerAttorney:
- new Attorney to limit access to ViewProviderSketch and reduce its public interface
- In order to enforce a certain degree of encapsulation and promote a not too tight coupling, while still allowing well
defined collaboration, DrawSketchHandler accesses ViewProviderSketch via this Attorney class.
-DrawSketchHandler has the responsibility of drawing edit temporal curves and markers necessary to enable visual feedback
to the user, as well as the UI interaction during such edits. This is its exclusive responsibility under the Single
Responsibility Principle.
- A plethora of speciliased handlers derive from DrawSketchHandler for each specialised editing (see for example all the
handlers for creation of new geometry). These derived classes do * not * have direct access to the
ViewProviderSketchDrawSketchHandlerAttorney. This is intentional to keep coupling under control. However, generic
functionality requiring access to the Attorney can be implemented in DrawSketchHandler and used from its derived classes
by virtue of the inheritance. This promotes a concentrating the coupling in a single point (and code reuse).

EditModeCoinManager:
- Refactor of updateConstraintColor
- Multifield - new struct to identify a single element in a multifield field per layer
- Move geometry management to delegate class EditModeCoinGeometryManager
- Remove refactored code that was never used in the original ViewProviderSketch.

CommandSketcherBSpline:
- EditModeCoinManager automatically tracks parameter change and triggers the necessary redraw, rendering an explicit redraw obsolete and unnecessary.

Rebase on top of master:
- Commits added to master to ViewProviderSketch applied to EditModeCoinManager.
- Memory leaks - wmayer
- Constraint Diameter Symbol - OpenBrain
- Minor bugfix to display angle constraints - syres

Architecture Description
=======================

* Encapsulation and collaboration - restricting friendship - reducing public interface

Summary:
- DrawSketchHandler to ViewProviderSketch friendship regulated via attorney.
- ShortcutListener to ViewProviderSketch friendship regulated via attorney.
- EditModeCoinManager (new class) to ViewProviderSketch friendship regulated via attorney.
- ViewProviderSketch public interface is heavily reduced.

In further detail:
While access from ViewProviderSketch to other classes is regulated via their public interface, DrawSketchHandler, ShortcutListener and EditCoinManager (new class) access
to ViewProviderSketch non-public interface via attorneys. Previously, it was an unrestricted access (friend classes). Now this interface is restricted and regulated via attorneys.
This increases the encapsulation of ViewProviderSketch, reduces the coupling between classes and promotes an ordered growth. This I call the "collaboration interface".

At the same time, ViewProviderSketch substantially reduces its public interface. Access from Command draw handlers (deriving from DrawSketchHandler) is intended to be restricted to
the functionality exposed by DrawSketchHandler to its derived classes. However, this is still only partly enforced to keep the refactoring within limits. A further refactoring of
DrawSketchHandler and derivatives is for future discussion.

* Complexity and delegation

Summary:
- Complexity of coin node management is dealt with by delegation to helper classes and specialised objects.

In further detail:

ViewProviderSketch is halved in terms of code size. Higher level ViewProviderSketch functions remain

* Automatic update of parameters - Parameter observer nested classes

Summary:
- ViewProviderSketch and CoinManager get their own observer nested classes to monitor the parameters relevant to them and automatically update on change.

The split enables that each class deals only with parameters within their own responsibilities, effectively isolating the specifics and decoupling the implementations. It is
more convenient as there is no need to leave edit mode to update parameters. It is more compact as it leverages core code.

More information:
https://forum.freecadweb.org/viewtopic.php?p=553257#p553257
2021-12-27 21:03:51 +01:00
Abdullah Tahiri
2f77d3bc95 Sketcher: GeoEnum and GeoListId constant reference outside the translation unit
================================================================================

GeoEnum static members are used in constexpr in GeoListId.

Previous code worked because the static members where inside the same translation unit.

This code:
1. Declares the static members to use them as constant expressions with the value
2. Definition of the static members (odr-used) shall not contain an initializer.
2021-12-27 21:03:51 +01:00
wmayer
c7d419623c Gui: reduce code duplication in ReportOutputObserver and ReportOutput 2021-12-27 17:50:48 +01:00
wmayer
d883850f90 + code refactoring of View3DInventorPy::viewDefaultOrientation 2021-12-27 16:32:31 +01:00
Yorik van Havre
9292aaaedf Arch: Fixed units display of building parts 2021-12-27 15:09:39 +01:00
luz paz
0517894ab1 Cam: fix previously mistranslated source comment
Fix mistranslation introduced in 57c03413e52
2021-12-26 23:56:05 +01:00
luz paz
5c737973cf Link: Fix doxygen typo 2021-12-25 20:44:55 +01:00
luzpaz
c0f42cea0e Points: translate doxygen from DE to EN + fix superfluous whitespace (#5287)
* Points: translate doxygen from DE to EN + fix superfluous whitespace

For the purpose of making the source documentation uniform, source comments in this file were translated to english.

* Points: remove superfluous whitespace

* Fix left over DE to EN translations (from Cam and Mesh code)
2021-12-25 20:41:12 +01:00
Uwe
3d9b6eefac [GUI] don't show report view on warnings by default
I introduced FreeCAD to several people and see that especially newbies are confused with all the warnings they get but cannot understand.
The solution was to change that the report view panel is not automatically shown on every warning.
This PR does this.

More experienced users can anytime enable the option. Thus this PR has not much impact but obviously makes life easier for beginners.
2021-12-25 20:40:24 +01:00
Uwe
da1831e9d7 [Mesh] rename gmsh -> Gmsh
I was informed that Gmsh names itself with a capital G. I had a look and in FEM it is already named Gmsh, but not in the Mesh WB. Therefore this PR.

(The other changes than the pure renaming was automatically done by Qt's designer.)
2021-12-25 20:39:47 +01:00
Abdullah Tahiri
9978c0f867 Sketcher: white-space only commit - remove unnecessary indentation 2021-12-25 16:32:43 +01:00
Ajinkya Dahale
f801acfe8c [Sketcher] Constrain new B-spline pole weight only if equal to first
When new control points are created in a b-spline in a sketch, do not constrain
their weights to be equal to the first, unless they are already equal. This way
if we have unequal weights to begin with and OCC has computed the appropriate
weights so that the new spline is closer to the original, the weights are not
disturbed.
2021-12-25 08:42:18 +01:00