Commit Graph

30625 Commits

Author SHA1 Message Date
Abdullah Tahiri
f486ee74a4 Sketcher: Grid - correction of design decisions
===============================================

Removal of ViewProviderGridExtension properties:
-GridStyle
-GridSnap

Improvement of ViewProviderGridExtension API:
- color via App::Color

Toolbar grid command:
- Conversion of Snapping to edit parameter
- Snap gets a class enum to support future Snapping functionalities as edit parameter

Sketcher Settings:
- Removal of snap preference

Behaviour:
- ShowGrid, GridAuto, GridSize preferences do not change any existing VP. They apply to any newly created sketch.
- Do not limit grid to hardcoded values

Snap to grid:
- Code updated to use closestpoint functionality provided by the extension,

Several other fixes
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
1d9298590f Sketcher/Part: Grid - Architecture
==================================

- Move all grid specific code out of ViewProviderSketch and EditModeCoinManager.
- The code in made into a new extension in Part - ViewProviderGridExtension
- ViewProviderSketch starts deriving from this new extension
- ViewProviderSketch configures the extension according to its Grid preferences
- Grid code refactored to remove hardcoded sketcher preference parameters.
- ViewProviderGridExtension handles property name/type changes within its competence.
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
b073d9ab43 Sketcher: Add QtAll to PCH 2023-02-25 23:13:55 +01:00
Abdullah Tahiri
772a06b5d6 App: Extension/ExtensionContainer - handle property change
==========================================================

Currently changes of name or type of properties in a property container are handled by:
void PropertyContainer::handleChangedPropertyName(Base::XMLReader &reader, const char * TypeName, const char *PropName)
void PropertyContainer::changedPropertyType(Base::XMLReader &reader, const char * TypeName, Property * prop)

There is no mechanism for handling property changes by extensions. Sometimes the solution is to explicitly call the extension
from the container. However, this is a breach of the SRP, as the container should not be in a position to decide whether the
extension needs or not handle property changes. The handling code of the container changes for two different reasons, for
adapting the container to a property change of its own, and for adapting that of a property of the extension.

Illustrating it with an example, following inheritance, it goes like this:
PropertyContainer => ExtensionContainer => TransactionalObject => ViewProvider
App::Extension => ViewProviderExtension

The extension is currently not notified by the ExtensionContainer that a property needs handling. So a change in a property of
a ViewProviderExtension needs code at the ViewProvider it was added to.

This commit provides a mechanism in ExtensionContainer to call the extensions so that they can handle property changes. This
functions:

  virtual bool extensionHandleChangedPropertyName(Base::XMLReader &reader, const char * TypeName, const char *PropName);
  virtual bool extensionHandleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, Property * prop);

Containers should always call the base class for any unhandled property change. If a sub-class container of ExtensionContainer
handles property changes itself, but not the ones of the extensions, this call to the base class ultimately ensures that if the
property was not handled by the container hierarchy, any extension is given an opportunity to handle it.

Some examples:

* A container handles the extension property change or its own:

void ContainerSubClass::handleChangedPropertyType(...)
{
    if (prop == &PropertyOfExt) {

    }
    else if (prop == &PropertyOfCont) {

    }
    else {
        ContainerBaseClass::handleChangedPropertyType(...);
    }
}

* A container and the extension handle their own:

void ContainerSubClass::handleChangedPropertyType(...)
{
    if (prop == &PropertyOfCont) {

    }
    else {
        // This will call ExtensionContainer::handleChangedPropertyType
        ContainerBaseClass::handleChangedPropertyType(...);
    }
}

bool ExtensionSubClass::extensionHandleChangedPropertyType(...)
{
    if (prop == &PropertyOfCont) {

        return true;
    }
    return false;
}
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
127bc9f57b Sketcher: Grid settings - disable spacing when auto mode selected and vice versa 2023-02-25 23:13:55 +01:00
Abdullah Tahiri
42a08a5cf5 Sketcher: Resources - remove unnecessary resources 2023-02-25 23:13:55 +01:00
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
93f646ff25 Gui: ActionGroup - aboutToShow and aboutToHide
==============================================

ActionGroup may integrate a drop down menu (internally a QMenu).

QMenu has signals aboutToShow and aboutToHide, which are called just before showing/hiding the menu.

This commit extends ActionGroup by providing corresponding signals.

An ActionGroup can be added to more than one toolbar and thus creates more than one menu. So, it can theoretically
happen that you have opened a menu and click on another menu. For this reason, the menu is passed as argument:

void aboutToHideMenu(QMenu*);
void aboutToShowMenu(QMenu*);
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
fbbadde9fe Sketcher: Grid coin manager: fix includes 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
Paddle
a1d0d1dd76 Sketcher: Remove grid settings from Edit Control widget. 2023-02-25 23:13:55 +01:00
Paddle
e0b1117701 Core: View3DInventorViewer, add 3 functions:
- getDimensions
- getMaxDimension()
- getCenterPointOnFocalPlane()
2023-02-25 23:13:55 +01:00
Uwe
edd65a9d3f [Gui] fixes for NaviCube parameters
- add missing routines to save default values

- also fix color read in (transparency was read in wrong order)
2023-02-25 18:56:27 +01:00
Uwe
304e0da9d7 [Gui] add UI to change the NaviCube button size
- it was frequently requested and people now even published videos since I documented this hidden feature in the Wiki.
However, for a user it is a nightmare without a UI and users who like a bright background need to change the button color to keep the buttons visible.
2023-02-25 15:28:51 +01:00
luzpaz
9df1f9f8f5 [Material] fix grammar 2023-02-25 09:59:24 +01:00
luzpaz
fcac4def8e [Fem] fix grammar 2023-02-25 09:59:24 +01:00
Chris Hennes
c7620a88e3 Addon Manager: Linter cleanup of utilities 2023-02-24 21:58:55 -06:00
Chris Hennes
ff6d9ccc76 OpenSCAD: Linter cleanup 2023-02-24 21:58:39 -06:00
Uwe
26d80c5f22 [Gui] remove unused help button from preferences dialog
- is by default in the title bar of Qt dialogs, has to be removed explicitly when unused

- also fix too long code lines
2023-02-25 04:35:57 +01:00
Jolbas
554a40f91c Fix create Rotation from scaled matrix
Support for creation of Rotation from matrices which is a combination of non uniform scale and a rotation
Fixes according to review
Scale -1 is Uniform, Not NoScaling
Fix hasScale() when negative scale
2023-02-24 20:33:40 -06:00
Roy-043
f713036c24 [Arch] fix Arch_Stairs stringer code (#8639) 2023-02-25 00:43:46 +01:00
Adrian Insaurralde Avalos
0079352b66 Fix NaviCube default font incorrect display in pref. page 2023-02-25 00:00:56 +01:00
luzpaz
f373a1ddd3 OpenSCAD: lint OpenSCADUtils.py 2023-02-24 16:15:13 -06:00
Chris Hennes
f9344fd2de OpenSCAD: Remove old workaround code
Fixes #8621
2023-02-24 16:13:54 -06:00
0penBrain
6f278d7673 [BugFix] Expression: always add space char before unit when converting to string, fixes #8562 2023-02-24 19:44:44 +01:00
Uwe
b2ea19fd08 [Gui] attempt to fix getting NaviCube font name
- as discussed here: https://forum.freecad.org/viewtopic.php?t=76233 maybe the conversion to ".toLatin1()" is unsafe on some systems for non-ASCII characters on the font names
2023-02-24 16:58:38 +01:00
Uwe
8e4745658c [FEM] fixes for flow and electrodynamics examples
- define materials so that they are recognized by material handling as existing card
- use "electrodynamics" as equation because this is the common name for the physics of these examples
- fix typos
2023-02-24 16:50:42 +01:00
Uwe
aa1725ff2c [Material] add heat parameters to aluminum alloys 2023-02-24 16:46:40 +01:00
Uwe
d4eb6ed0a2 [FEM] fix for electrostatics examples
- define Air so that it is recognized by material handling as existing card
2023-02-24 16:44:49 +01:00
wmayer
45ec24b1cb PD: refactor the constructor of TaskDialogPython 2023-02-24 16:35:51 +01:00
Uwe
5853b065c7 [FEM] add example for magnetostatics 2023-02-24 16:32:11 +01:00
Roy-043
92125dc850 [Draft] increase number spinboxes max in array task panels to 1 million (#8628)
The default max for spinboxes is 99. This PR increases it to 1 million for the number spin boxes of the array task panels.
2023-02-24 16:16:46 +01:00
Roy-043
42ab4750e7 [Arch] Arch_Stairs TreadDepth was based on unprojected edge (#8613) 2023-02-24 11:01:45 +01:00
0penBrain
982c1b4421 [BugFix] Part: fix XSkew+YSkew editing not took into account for cylinders 2023-02-24 10:06:36 +01:00
0penBrain
753e9481cb [BugFix] Sketcher: correctly handles angle strings displayed at cursor for all locales, fixes #8611 2023-02-24 10:05:57 +01:00
Chris Hennes
52fd0cfefb OpenSCAD: Modify wording of task dialog buttons
Fixes #8619
2023-02-23 22:59:13 -06:00
Chris Hennes
93aa8fa0d7 OpenSCAD: Translate file dialogs
Fixes #8618
2023-02-23 22:08:22 -06:00
Chris Hennes
9f4d839609 OpenSCAD: Support CSG loads from Load button
Fixes #8617.
2023-02-23 21:59:40 -06:00
Uwe
f15c55f242 [Part] fix encoding bug
- fixes the regression by #7255 -> the degree sign cannot be decoded as Latin1
2023-02-24 04:07:21 +01:00
Uwe
688e42df89 [Material] remove unused Help button in editor dialog 2023-02-24 03:47:19 +01:00
Uwe
65b1952cad [FEM] improve pvtu file filtering
- catch case of only 2D objects
- use vtkDataSet as input for all filters
2023-02-24 03:46:47 +01:00
sliptonic
5504311b3a Merge pull request #8563 from dresco/AdaptiveOutline
[Path] Adaptive - improve 'use outline' logic
2023-02-23 12:33:50 -06:00
sliptonic
dcd053696f Fixes #8517
Avoid error in test log
2023-02-23 18:42:52 +01:00
Bernd Hahnebach
d4c45adf8e Arch: building part object, use IFC standard typ as initial IfcType 2023-02-23 16:55:28 +01:00
Bernd Hahnebach
8f021bcb74 Arch: IFC export, fix export break if undefined building part and IFC4 is used 2023-02-23 16:49:17 +01:00
wmayer
678ecf64db Gui: handle language change events in task dialogs 2023-02-23 16:38:45 +01:00
wmayer
fe968bc4db Gui: enable language change by default 2023-02-23 16:38:45 +01:00