Commit Graph

453 Commits

Author SHA1 Message Date
vocx-fc
4b8dda1555 Draft: move LinkArray GuiCommand to gui_array_simple module
The code is kept for historical reasons, but the tool
is no longer accessible from the toolbars or menus,
as it was superseded by the three commands `Draft_OrthoArray`,
`Draft_PolarArray` and `Draft_CircularArray`.
2020-04-24 13:49:13 +02:00
vocx-fc
82efd33581 Draft: move Array GuiCommand to gui_array_simple module
The code is kept for historical reasons, but the tool
is no longer accessible from the toolbars or menus,
as it was superseded by the three commands `Draft_OrthoArray`,
`Draft_PolarArray` and `Draft_CircularArray`.
2020-04-24 13:49:13 +02:00
vocx-fc
d4c699c844 Draft: move Draft2Sketch GuiCommand to gui_draft2sketch module 2020-04-24 13:49:13 +02:00
vocx-fc
6f060d513d Draft: move Shape2DView GuiCommand to gui_shape2dview module 2020-04-24 13:49:13 +02:00
vocx-fc
8643025d49 Draft: move WireToBSpline GuiCommand to gui_wire2spline module 2020-04-24 13:49:13 +02:00
vocx-fc
4ed80cdf83 Draft: move Drawing GuiCommand to gui_drawing module
Also, finally the command is removed from the toolbar
as the Drawing Workbench is obsolete since v0.17.

The command is still loaded and defined by the workbench
but it is no longer presented to the user interface in the menu
or toolbar.
2020-04-24 13:49:13 +02:00
vocx-fc
868435bfd9 Draft: move Scale GuiCommand to gui_scale module
The scale operation can be used with subelements, vertices
and edges, but in this case this only works with polylines
(wires) because internally the functions `scaleVertex`
and `scaleEdges` only work with polylines that have a `Points`
property.

When doing a copy and scale, it also calls `copyScaledEdges`
which calls `joinWires`, so problems with joining wires
may also be present when performing this operation.
2020-04-24 13:49:13 +02:00
vocx-fc
81d77e2ca1 Draft: move Trimex GuiCommand to gui_trimex module 2020-04-24 13:49:13 +02:00
vocx-fc
418bafe6ee Draft: move Downgrade GuiCommand to gui_downgrade module 2020-04-24 13:49:13 +02:00
vocx-fc
c3221222b3 Draft: move Upgrade GuiCommand to gui_upgrade module 2020-04-24 13:49:13 +02:00
vocx-fc
a9688f7d00 Draft: move Split GuiCommand to gui_split module 2020-04-24 13:49:13 +02:00
vocx-fc
cb5aa765fb Draft: move Join GuiCommand to gui_join module
Occasionally it fails to join lines even if the lines
visually share a point.

This is a rounding error in the comparison of the shared point;
a small distance will result in the points being considered
different and thus the lines not joining.

The solution is to test properly the two points using
`DraftVecUtils.equals` which considers the value of
the `precision` set in the Draft preferences.
2020-04-24 13:49:13 +02:00
vocx-fc
8ea1358dcb Draft: move Stretch GuiCommand to gui_stretch module 2020-04-24 13:49:13 +02:00
vocx-fc
eb21502d0f Draft: move Offset GuiCommand to gui_offset module
Include Yorik's commit 97c8eff825.
2020-04-24 13:49:13 +02:00
vocx-fc
5cf9dadd68 Draft: move Rotate GuiCommand to gui_rotate module 2020-04-24 13:49:13 +02:00
vocx-fc
bad30329d7 Draft: move ApplyStyle GuiCommand to gui_styles module
Also fix an error in determining the objects of type group.

Also call `finish` to properly terminate the command,
otherwise it stays active and behaves incorrectly.
2020-04-24 13:49:13 +02:00
vocx-fc
5f11802bc0 Draft: move Move GuiCommand to gui_move module 2020-04-24 13:49:13 +02:00
vocx-fc
3370e870fe Draft: move SubelementHighlight to its own module 2020-04-24 13:49:13 +02:00
Yorik van Havre
5b3fea59e0 Draft: Annotation editor 2020-04-22 13:38:17 +02:00
vocx-fc
ace8c98aa8 Draft: move Label GuiCommand to gui_labels module
Also include carlopav's commit ff3bdf86bc for the Draft_Label tool,
which runs the autogroup function on the created label.
2020-04-22 12:07:25 +02:00
vocx-fc
d3646b0577 Draft: move Facebinder GuiCommand to gui_facebinders module 2020-04-22 12:07:25 +02:00
vocx-fc
4c297587c4 Draft: move Point GuiCommand to gui_points module 2020-04-22 12:07:25 +02:00
vocx-fc
afd941b66d Draft: move ShapeString GuiCommand to gui_shapestrings module 2020-04-22 12:07:25 +02:00
vocx-fc
44be767583 Draft: move Dimension GuiCommand to gui_dimensions module 2020-04-22 12:07:25 +02:00
vocx-fc
bec9d01058 Draft: move Text GuiCommand to gui_texts module 2020-04-22 12:07:25 +02:00
vocx-fc
66055ebf14 Draft: move Ellipse GuiCommand to gui_ellipses module 2020-04-22 12:07:25 +02:00
vocx-fc
0e089e998d Draft: move Polygon GuiCommand to gui_polygons module 2020-04-22 12:07:25 +02:00
vocx-fc
59c41fab33 Draft: move Circle GuiCommand to gui_circles module 2020-04-22 12:07:25 +02:00
vocx-fc
ea31a7d452 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
0d891a85e3 Draft: move Rectangle GuiCommand to gui_rectangles module 2020-04-22 12:07:25 +02:00
vocx-fc
689324fe22 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
17281a250f Draft: move BezCurve GuiCommand to gui_beziers module 2020-04-22 12:07:25 +02:00
vocx-fc
b6cdf9f558 Draft: move BSpline GuiCommand to gui_splines module 2020-04-22 12:07:25 +02:00
vocx-fc
529ec1e1a6 Draft: move Wire GuiCommand to gui_lines module 2020-04-22 12:07:25 +02:00
vocx-fc
934d0f3752 Draft: move Line GuiCommand to gui_lines module 2020-04-22 12:07:25 +02:00
vocx-fc
982a0fdd9c Draft: move Modifier class to gui_base_original module 2020-04-21 12:53:30 +02:00
vocx-fc
9f5e215751 Draft: move Creator class to gui_base_original module 2020-04-21 12:53:30 +02:00
vocx-fc
181c5cb60d 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
9b3096353c 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
0ba89d1662 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
6c890c1966 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
1a2e79ecb9 Draft: move Draft_Arc_3Points to gui_arcs module 2020-04-16 11:40:58 +02:00
vocx-fc
1f3a88f1ce 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
68119de02f Draft: move Draft_AutoGroup to gui_groups module 2020-04-16 11:40:58 +02:00
vocx-fc
60f3155651 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
8aeb33f203 Draft: move Draft_FlipDimension to gui_dimension_ops module 2020-04-16 11:40:58 +02:00
vocx-fc
ed55c6e824 Draft: move Draft_Heal to gui_heal module 2020-04-16 11:40:58 +02:00
vocx-fc
8c177c7fe8 Draft: move Draft_ToggleGrid to gui_grid module 2020-04-16 11:40:58 +02:00
vocx-fc
1ed3df9df0 Draft: add base class for Snap commands 2020-04-16 11:40:58 +02:00
vocx-fc
11206b1d3a Draft: move Draft_ShowSnapBar to gui_snaps module 2020-04-16 11:40:58 +02:00