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.
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.
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.
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.
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.
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.
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.
`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.
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.