* Draft: Implement hints for creation tools
Fixes: #22886
Related: #22298
This PR implements hints for the tools in the Draft Creation toolbar.
* Fix confusing indentation
* Fix typo in comment
* Draft: Introduce 1-axis mode for ortho array
As the title says - the 1 axis mode allows to switch between all of the
axises mode and allows to modify only 1 axis at the time that user can
select with the checkbox.
* Draft: Rename to Linear Mode and remove redundant comments
* Draft: Display only one interval for the selected axis
* Draft: Cache selected variables in user.cfg - axis mode, intervals, etc...
* Draft: Make sure the checkboxes in OrthoArray are exclusively selected
* Draft: Apply review comments
Changed a couple of things according to review:
* linear mode is now being used as default during first startup (it
wasn't before)
* applied Roy's comments about coding style, etc.
* grouped everything into separate QGroupBox which is dedicated for
Linear Mode and has it's own labels, although spinboxes are shared so
during mode switch we reparent them now
* removed Orthogonal Array's icon
* in the QGroup applied naming suggested in the review, X Intervals ->
interval, etc.
* changed to radio buttons since we want exclusivity in selection
* Draft: store 3 ShapeString parameters and remove font from prefs
With this PR 3 ShapeString parameters are stored:
* ShapeStringFontFile: this replaces the old FontFile parameter.
* ShapeStringHeight
* ShapeStringText
The ShapeStringFontFile is just the last selected font file and not exposed in the Preferences editor.
Additionally:
* Changed the label of the text input box from "String" to "Text".
* Changed the label of the point reset button to sentence case.
* Remove faulty docstring
This PR adds the Global mode option to the ShapeString task panel.
Additionally:
* Rounding of coordinates caused by reading values from the task panel is avoided.
* Improved task panel layout: Height input above String input.
* Some code reformatting.
Related: #17952.
This PR introduces a document observer to close task panels on doc close.
For now it is for the Draft Workbench only. The BIM Workbench will be dealt with in a future PR.
The basic code is simple, but to make things works some additional things were addressed:
* gui_base.py: the GuiCommandBase class was enhanced to handle App.activeDraftCommand, self.doc, self.view and self.planetracker. Strictly speaking only the first 2 are required for this PR.
* gui_base.py: self.command_name was changed to self.featureName for compatibility with gui_base_original.py. Not required for this PR.
* gui_arcs.py, gui_circulararray.py, gui_polararray.py and gui_orthoarray.py: updated in relation to the GuiCommandBase class.
* gui_arcs.py Arc_3Points: The command now has a ui property and shows a plane tracker. Only the first is required for this PR.
* gui_shapestrings.py: This command had two ui attributes: self.ui and self.task. This was problematic. To fix this the base class of the command was changed from gui_base_original.Creator to gui_base.GuiCommandBase. As a result the getStrings method is no longer available meaning that the useSupport parameter is ignored when creating a ShapeString. But since that mechanism does not work properly anyway, I feel that this is acceptable. Should many user complain the functionality can of course be reintroduced.
Fixes#13324.
The Edit option is available from the Tree view context menu, but you can also double-click the clone in the Tree view.
The task panel is based on that of the Draft Scale command. The "Uniform scaling" checkbox is (un)checked depending on the current scaling of the clone.
* Draft: make move, rotate and scale commands link-aware
Fixes#12836.
Fixes#15681.
These changes are presented as a single ('big') PR because the mentioned commands have several similarities. Working on them seperately would have made less sense.
The commands have been made 'link-aware' meaning they can now handle Links and objects in linked containers.
This required several changes in the following main files. For each command all options are handled by a single function now (the `move`, `rotate` and `scale` functions). This was the only reasonable solution to correctly handle nested placements. As a result there is no longer a need to build very complex 'cmd' strings in the gui_*.py files (which is a good thing IMO).
Main files:
* move.py
* rotate.py
* scale.py
* gui_move.py
* gui_rotate.py
* gui_scale.py
* gui_trackers.py
The following files have also been updated:
* Draft.py: Imports updated.
* DraftGui.py: If `CopyMode` is changed the ghosts have to be updated. The move and rotate commands now also show previews of movable children. But since those are not copied they should be removed from the ghosts if `CopyMode` is changed to `True`.
* utils.py: Some helper functions have been added. An existing helper function (only used internally) has been renamed.
* gui_utils.py: The `select` function has been updated to accept a list of tuples to allow the reselection of nested objects.
* clone.py: A new property `ForceCompound`, necessary for non-uniform scaling, has been added.
* join.py: The `join_wires` function now returns the resultant wire objects.
* task_scale.py: Updated to allow negative scale factors. Support for `SubelementMode` preference added.
* dimension.py: `transform` methods added.
* layer.py: `get_layer` function added.
* svg.py: Updated to use `get_layer`.
* view_text.py: Instead of two added `coin.SoTransform()` nodes the main transform node is used instead. This was done so that ghosts of Draft Texts can be handled properly without requiring dedicated code in gui_trackers.py.
Notes:
* Support for "App::Annotation" is limited. Only their `Position` is handled (by the move and rotate commands).
* Support for "Image::ImagePlane" has been removed from the scale command. The object has its own calibrate feature (see https://wiki.freecad.org/Std_Import).
* Copies and clones are always created in the global space.
* Fix several unit test issues.
* Reset value that was changed while testing
* Rebase and update test_modification.py
* Reintroduce scaling of image planes
* Fixes spelling of "Allow to" to "Allow one to"
and those variants:
Allows to -> Allows one to
allow to -> allow one to
allows to -> allows one to
* Fix "Let's -> Lets"
(and lower case variant.)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update src/3rdParty/salomesmesh/inc/MED_Wrapper.hxx
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
* Update src/Base/PyObjectBase.cpp
Update src/App/ExtensionContainer.h
Update src/App/PropertyContainer.h
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
* Use gerund in user-facing texts.
* Use gerund for two more user-facing strings.
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
---------
Co-authored-by: Tobias Frost <tobi@debian.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
These messages were perhaps originally intended as a debuggin aid but now add clutter to the output panes. Remaining messges are mostly the result of methods to display attributes of an object (which one could call from the Python console) or actually provide some information which would not be obvious from the circumstances
When entering a scale factor, if uniform scaling is on, the current code
keeps appending zeroes as you type, forcing you to delete them before
entering your next digit. This commit fixes that by ensuring that the
widget that you are currently editing is not updated continuously.
Fixes#0004601
This includes `task_circulararray`, `task_orthoarray`,
`task_polararray`, `task_scale`, `task_selectplane`,
`task_shapestring`.
These are added to the `drafttaskpanels` Doxygen group
so that the functions and classes contained in each module
are listed appropriately in the automatically generated
documentation.
Avoid `Draft.py` in the `make_circular_array` function because
it creates a circular dependency.
Use function to find the object in `make_circular_array`.
Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays interactively from the Python console.
Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
Avoid `Draft.py` in the `make_polar_array` function because
it creates a circular dependency.
Use function to find the object in `make_polar_rarray`.
Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays interactively from the Python console.
Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
Avoid `Draft.py` in the `make_ortho_array` function because
it creates a circular dependency.
Use internal functions to abstract the orthogonal arrays.
The `_make_ortho_array` is a simple wrapper over the general
`make_array` function.
The result is four variants:
- `make_ortho_array`
- `make_ortho_array2d`, without the Z component
- `make_rect_array`, strictly rectangular components
- `make_rect_array2d`, strictly rectangular without the Z component
Also use functions to perform checking of the inputs,
whether these are vectors, numbers (integer and floats)
or integers.
Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays quickly from the Python console.
Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
Previously they were in `draftobjects`, but since they
don't define new objects, just create objects,
they are moved to `draftmake`.
Also ajust the `CMakeLists.txt` and the corresponding Gui Commands
which use these make functions.
These functions internally use the `Draft.makeArray` function.
We will put comments as reminders so that when this function
is moved to its own module, we can update the derived functions.