Commit Graph

425 Commits

Author SHA1 Message Date
vocx-fc
aa894ddc07 Draft: move Arc GuiCommand to gui_arcs module
Also move the `ArcGroup` that containst the two arc tools.
2020-04-22 12:07:25 +02:00
vocx-fc
42932b19a3 Draft: move Rectangle GuiCommand to gui_rectangles module 2020-04-22 12:07:25 +02:00
vocx-fc
5fbf6f8055 Draft: move CubicBezCurve GuiCommand to gui_beziers module
Also move the `BezierGroup` that contains the two Bezier tools.
2020-04-22 12:07:25 +02:00
vocx-fc
e2e9a17dd0 Draft: move BezCurve GuiCommand to gui_beziers module 2020-04-22 12:07:25 +02:00
vocx-fc
cd72ba253b Draft: move BSpline GuiCommand to gui_splines module 2020-04-22 12:07:25 +02:00
vocx-fc
3df6dab640 Draft: move Wire GuiCommand to gui_lines module 2020-04-22 12:07:25 +02:00
vocx-fc
96795ddadc Draft: move Line GuiCommand to gui_lines module 2020-04-22 12:07:25 +02:00
vocx-fc
f5bfb56e82 Draft: move Modifier class to gui_base_original module 2020-04-21 12:53:30 +02:00
vocx-fc
8b3bac1d73 Draft: move Creator class to gui_base_original module 2020-04-21 12:53:30 +02:00
vocx-fc
cb545c7fa8 Draft: import Part module where necessary for the tools
Also import `DraftGeomUtils` where necessary.

These modules were previously imported globaly when the base
`DraftTool` class was first called by the individual tools
through the `Creator` and `Modifier` classes.

However, since `DraftTool` was moved to a separate module,
these `Part` and `DraftGeomUtils` modules are no longer
in the `DraftTools` namespace, and therefore they
cannot be imported globally anymore.

Now the `Part` and `DraftGeomUtils` modules are imported
in the specific functions where they are actually needed.
2020-04-21 12:53:30 +02:00
vocx-fc
180544edbb Draft: move the base DraftTool class to its own module
This is the base class of most Draft Gui Commands,
particularly those which were developed a long time ago.
It is inherited by `Creator` and `Modifier`
to set some specific options for some tools.

Newer Gui Commands do not use these classes and thus
are independent of `DraftTool`.

Nevertheless, in the future we expect to organize further
the commands so that they all derive from a few classes,
so that they all share some common properties and behaviors.
2020-04-21 12:53:30 +02:00
vocx-fc
23e324280f Draft: move DraftTools utilities to another module
These small functions and utilities are placed in another
module, so they can be imported and called
by the individual Gui Command classes as necessary.

When these Gui Command classes are moved to their respective
modules, they will be able to import this auxiliary module as well.
2020-04-21 12:53:30 +02:00
vocx-fc
5b677151e6 Draft: move array commands to DraftTools
Previously they were imported directly in `InitGui.py`,
now they are collected in `DraftTools.py`, so that they
are imported at the same time as other modules.

Also provide an icon so this icon appears in the menu.
2020-04-16 11:40:58 +02:00
vocx-fc
b5aa88fdbc Draft: move Draft_Arc_3Points to gui_arcs module 2020-04-16 11:40:58 +02:00
vocx-fc
31ca5dd812 Draft: move Draft_AddConstruction to gui_groups module
Also add a new icon for adding to the construction group.
2020-04-16 11:40:58 +02:00
vocx-fc
8640697107 Draft: move Draft_AutoGroup to gui_groups module 2020-04-16 11:40:58 +02:00
vocx-fc
125008c5e8 Draft: move Draft_Slope to gui_lineslope module
The class name was renamed to `LineSlope` as it is fundamentally
inteded to control slopes of lines.
2020-04-16 11:40:58 +02:00
vocx-fc
91c75b03f7 Draft: move Draft_FlipDimension to gui_dimension_ops module 2020-04-16 11:40:58 +02:00
vocx-fc
28e2e20a00 Draft: move Draft_Heal to gui_heal module 2020-04-16 11:40:58 +02:00
vocx-fc
df3a06399b Draft: move Draft_ToggleGrid to gui_grid module 2020-04-16 11:40:58 +02:00
vocx-fc
78c276e2a2 Draft: add base class for Snap commands 2020-04-16 11:40:58 +02:00
vocx-fc
a1f6a7f6e0 Draft: move Draft_ShowSnapBar to gui_snaps module 2020-04-16 11:40:58 +02:00
vocx-fc
eca1c75056 Draft: add correct docstring to old Array tools
Previously they mentioned incorrectly the Shape2DView tool.
2020-04-16 11:40:58 +02:00
vocx-fc
631f74d8fc Draft: move SelectGroup command to gui_groups module 2020-04-16 11:40:58 +02:00
vocx-fc
a0f9df523a Draft: move AddToGroup command to gui_groups module 2020-04-16 11:40:58 +02:00
vocx-fc
5acb94984f Draft: move DisplayMode command to gui_togglemodes module 2020-04-16 11:40:58 +02:00
vocx-fc
e3154fccb2 Draft: move mode commands to gui_togglemodes module
`Draft_ToggleConstructionMode` and `Draft_ToggleContinueMode`.
They call a base class `BaseMode` which also uses the base
`gui_base.GuiCommandSimplest` class.

Also add a new icon for continue mode.
2020-04-16 11:40:58 +02:00
vocx-fc
1b8e9d5cb8 Draft: move line GuiCommands to gui_lineops module
The commands `FinishLine`, `CloseLine`, and `UndoLine`
are moved from the huge `DraftTools.py` to `gui_lineops.py`
to reduce the complexity of the former file.

These GuiCommands aren't actually used presently
in the Draft Workbench. They were used in the past
particularly from the context menu when editing a Line object.
2020-04-16 11:40:58 +02:00
carlopav
f90921ef03 [Draft] Improved Autogroup to handle Draft Annotations
Draft Dimension, Label and Text are now correctly auto-added to Part container
2020-04-16 11:37:10 +02:00
Yorik van Havre
23fe7ba1c9 Draft: warn the user if offset direction is not set 2020-04-14 15:35:46 +02:00
vocx-fc
a1e8f97be2 Draft: move WorkingPlaneProxy to separate module
Previously it was in the `gui_selectplane` module
but we prefer to place it in its own module
so that the files are as small as possible.
2020-04-09 11:41:45 +02:00
vocx-fc
536e0ad133 Draft: move ShapeString to the creation tools
Previously it was placed in the `annotation` category
but since it creates a group of shapes, it is better
in the `creation` category.

Also small fixes in the menu text and tooltip.
2020-04-07 18:12:06 +02:00
vocx-fc
7f99cead72 Draft: DraftTools.py clean up header and imports
Small spacing fixes like imports in separate lines for
more clarity, and the position of the license.
Also use the class name `ToDo` in `CamelCase`,
as it is indicated in Python guidelines for classes.
2020-04-07 18:12:06 +02:00
vocx-fc
7d102a5370 Draft: move Draft_Edit to another module 2020-04-06 12:51:55 +02:00
vocx-fc
2a340bcfd3 Draft: move ScaleTaskPanel to a module
We remove it from `DraftGui.py` to reduce the size of this file.
Then we import it and tie it to its command defined
in `DraftTools.py`.
2020-04-02 16:53:49 +02:00
vocx-fc
46216d6032 Draft: move ShapeStringTaskPanel to a module
We remove it from `DraftGui.py` to reduce the size of this file.
Then we import it and tie it to its command defined
in `DraftTools.py`.
2020-04-01 13:22:04 +02:00
vocx-fc
72e2bca165 Draft: move and rename DraftSelectPlane 2020-03-31 12:00:38 +02:00
vocx-fc
02dabc9022 Draft: use functions from the utils module, not DraftGui
These functions were moved from DraftGui to individual
modules precisely to make them easy to import.
Otherwise we have to import the entire DraftGui module
which creates dependency problems when we want to use
some functions without the graphical interface.
2020-03-23 12:14:58 +01:00
vocx-fc
419431559a Draft: move DraftTrackers to another module.
Properly import the tracker classes. Avoid star imports,
and use the classes prefixed with the name of the module.
The BIM Workbench also has to be updated to use the new
module.
```
import draftguitools.gui_trackers as DraftTrackers
```
2020-03-23 12:14:33 +01:00
vocx-fc
580270ce4a Draft: move DraftSnap to another module
And do not load the `Snapper` in `DraftGui`.
The Snapper should be initialized by the module
that imports `DraftGui`, most probably `DraftTools`
or even by the `InitGui` of the workbench.
2020-03-20 08:11:04 -03:00
vocx-fc
6b87a416fd Draft: properly import the Snapper class
Avoid star imports, and prepend the module name,
`DraftSnap.Snapper()`.
2020-03-20 08:11:04 -03:00
vocx-fc
3ac2e079bc Draft: move snap commands to an individual module
This way we remove lines from `DraftTools.py`
and we can more easily identify where the snapping
commands are defined.
2020-03-20 08:11:04 -03:00
triplus
946fd7352b Draft - enable toggle grid command in edit mode
Some people would like to have more control over draft grid visibility  while in Sketcher edit mode.  Hence this PR enables the usage of Draft ToggleGrid  command in Sketcher edit mode.

Forum discussion:
https://forum.freecadweb.org/viewtopic.php?f=34&t=43265&start=20#p374747
2020-03-12 09:26:48 -03:00
carlopav
4396b40fec [Draft] DraftGui and DraftEdit Cleanup to remove AddPoint & DelPoint
Lines to be deleted in DraftGui in the future, are now commented.
2020-03-12 09:11:34 -03:00
vocx-fc
9d887131af Draft: Draft_Arc_3Points using the new arc function
Instead of creating the arc directly in the GuiCommand
it calls the new `make_arc_3point` function.
2020-03-05 09:03:02 -03:00
vocx-fc
b25ca7194c Draft: lowercase use_link option for arrays
Inside the class `_DraftLink` the `onDocumentRestored` function
tests for the existence of the old attribute `useLink`. If it is
present, it uses it to define the new variable name `use_link`.
This is done use Python naming conventions.
The old `useLink` is deleted so it is not longer saved
together with the object when the document is saved.
2020-03-04 09:58:56 -03:00
Syres916
4242afb8b4 [Draft] WireToBSpline Fix Placement of makeWire
See Discussion https://forum.freecadweb.org/viewtopic.php?f=23&t=43184
2020-03-02 12:08:53 -03:00
carlopav
b189fd6450 [Draft] Edit: set shortcut to D,E
Changed subelement highlight to S,E
[Draft] Edit bugfix


bugfix
2020-01-08 15:20:36 +01:00
luz.paz
8cfa85cf18 Draft: [skip ci] Fix header uniformity
This PR fixes header uniformity across all Draft files
2019-12-27 00:16:12 +01:00
vocx-fc
6626b52b5f Draft: rename SubelementModify to SubelementHighlight 2019-11-11 18:04:10 -03:00