Commit Graph

655 Commits

Author SHA1 Message Date
vocx-fc
81d7267e72 Draft: add new viewprovider icon for radius dimension
If it is a linear dimension show the older icon;
if it is a radius or diameter dimension show a new icon.

These three modes use the same Proxy class
and the same viewprovider class. Depending on the linked geometry
one icon or the other will be shown.
2020-03-12 09:12:11 -03:00
vocx-fc
dce7f63c02 Draft: add new viewprovider icons for specific objects
When there are many Draft objects in the tree view
the icon can be used to tell different objects apart quickly.
One icon is used for objects that are "straight lines",
whose Proxy is of type `Line`, `Wire` or `Polyline`; another icon
for "regular geometrical" shapes of type `Rectangle` or `Polygon`;
and another icon for "curved" objects of type `Circle`,
`Ellipse`, `BSpline`, `BezCurve`, or `Fillet`.

Other objects use the older default icon.
2020-03-12 09:12:11 -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
3ae13a012a [Draft] Change boolean If statement 2020-03-02 12:08:53 -03:00
Syres916
e26f306895 [Draft] WireToBSpline Fix makeWire Placement
See discussion https://forum.freecadweb.org/viewtopic.php?f=23&t=43184
2020-03-02 12:08:53 -03:00
vocx-fc
4c8bef7c91 Draft: new view provider icon for the angle dimension
The linear and radial dimensions use the same Proxy class,
but the angular dimension uses a different Proxy class.
To recognize quickly in the tree view the different
types of dimensions, we provide a new icon.

The icon is inspired on the `Draft_Dimension.svg` and
`TechDraw_AngleDimensions.svg` icons.
2020-02-15 13:07:38 +01:00
carlopav
b44031df60 [Draft] Move and rotate bugfix to handle App::DocumentGroup
Bugfix, ref https://forum.freecadweb.org/viewtopic.php?f=23&t=43061
2020-02-10 11:16:34 +01:00
vocx-fc
6a66044c21 Draft: override text in dimension only when GUI is up 2020-02-10 11:14:01 +01:00
M G Berberich
15bef3283f [Draft]fix circular array python2
There was semantic change of the division operator ‘/’
from python2 to python3. This fix makes the circular array
work with python2 correctly.
See PEP 238
2020-01-29 09:33:24 +01:00
vocx-fc
8eb56228cf Draft: plane proxy by default saves the state and view 2020-01-28 11:59:36 +01:00
Yorik van Havre
3f30f8b345 Merge branch 'master' into DraftModifiersAppPart 2020-01-16 14:26:45 +01:00
vocx-fc
d8fd4b2f9c Draft: move translate function to translate module
The translate mechanism in Draft depends on the `QtCore`
`translate` function. This is defined in its own module
so that `DraftGui.py` is not as big and hard to manage.

Other modules in Draft can import the translate function
without needing to import the entire interface, which
often causes errors and circular dependencies.

We can import `QtCore.QT_TRANSLATE_NOOP` at the top level
in `Draft.py` because it does not depend on the graphical
interface.
2020-01-15 10:05:52 +01:00
carlopav
6e70467335 Merge remote-tracking branch 'upstream/master' into DraftModifiersAppPart 2020-01-10 10:36:34 +01:00
vocx-fc
4d956930f5 Draft: new module for GUI utility functions
Many auxiliary tools used by `Draft.py` can be defined
in another module. Many functions are moved to this module
so that `Draft.py` isn't as big and hard to maintain.

The following is a list o functions that were moved:
`get3DView`, `autogroup`, `dimSymbol`, `dimDash`,
`removeHidden`, `formatObject`, `getSelection`,
`getSelectionEx`, `select`, `loadTexture`.

Moreover, many of these functions were renamed
to comply better with PEP8 guidelines,
particularly the use of `snake_case`. For example,
`get3DView` is now `get_3d_view`.

Aliases are provided for the old names so that
other functions and classes that depend on these
won't break. The new names should be the official
programming interface, while the old names
should be deprecated at some point in the future.
2020-01-10 10:04:07 +01:00
carlopav
0ab2826123 Merge branch 'master' into DraftModifiersAppPart
merged upstream master and resolved conflicts
2020-01-09 14:42:58 +01:00
vocx-fc
7721ca0157 Draft: new module for utility functions
Many auxiliary tools used by `Draft.py` can be defined
in another module. Many functions are moved to this module
so that `Draft.py` isn't as big and hard to maintain.

The following is a list of functions and attributes that were moved:
`stringencodecoin`, `arrowtypes`, `typecheck`,
`getParamType`, `getParam`, `setParam`, `precision`,
`tolerance`, `epsilon`, `getRealName`, `getType`,
`getObjectsOfType`, `isClone`, `getGroupNames`,
`ungroup`, `shapify`, `getGroupContents`,
`printShape`, `compareObjects`, `loadSvgPatterns`,
`svgpatterns`, `getMovableChildren`, `getWindows`,
`utf8_decode`.

Moreover, many of these functions were renamed
to comply better with PEP8 guidelines, particularly
the use of `snake_case`. For example, `getGroupNames`
is now `get_group_names`; `getMovableChildren`
is now `get_movable_children`.

Aliases are provided for the old names so that
other functions and classes that depend on these
won't break. The new names should be the official
programming interface, while the old names
should be deprecated at some point in the future.
2020-01-08 15:16:55 +01:00
carlopav
a3d650b386 [Draft] Auto add new object to App::Part
Auto add object to part container if active and if no other autogroup object is selected by the user.
Note that object placement is automatically corrected to not jump over space.
[Draft] App::Part autogroup point object
2019-12-29 20:25:50 +01:00
carlopav
d4e32c1607 [Draft] getGroupContents and App::Part
App::Part contained objects should not be moved if also App::Part is moved
2019-12-29 15:24:14 +01:00
carlopav
f0d21a8755 [Draft] Move and Rotate documentation of recent changes
[Draft] Edit: small typo fix
2019-12-29 11:46:02 +01:00
carlopav
36340068ec [Draft] Draft.rotate() add support for App::Part 2019-12-27 22:44:07 +01:00
carlopav
f2792f9fc6 [Draft] Draft.move() add support for App::Part
Added getGlobalPlacement to vector calculation.
[Draft] Move bug fix
2019-12-27 20:41:04 +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
Zheng, Lei
ad3167137d Draft: fix array restore 2019-12-26 15:56:31 -03:00
ageeye
2a5328b693 Use DraftVecUtils.tup only two times. 2019-12-26 15:54:10 -03:00
ageeye
0f81a0dd68 Fix the Draft Array polar type. Rotate first global and then object own rotation(spin) of placement. 2019-12-26 15:54:10 -03:00
Yorik van Havre
4e167f32bb Draft: Fixed regression in Rotate tool 2019-12-17 15:30:31 -03:00
Yorik van Havre
bb5f17c7f7 Draft: fixed minor bug 2019-12-12 14:11:59 -03:00
Yorik van Havre
97804f851d Draft: fixed regression in rotations 2019-12-11 23:15:05 -03:00
Zheng, Lei
65bc3ae5c0 Draft: support linked transform and color override in link array 2019-12-06 14:33:59 -03:00
vocx-fc
6f98a20c03 Draft: fix double translation in Draft._PointArray 2019-10-25 10:55:19 -03:00
vocx-fc
28831b4c78 Draft: set the Autoconstraint view property only if the interface is up (FreeCAD.GuiUp) 2019-10-25 10:54:31 -03:00
vocx-fc
10cb6835a3 Draft: change DisplayMode only if the interface is up (FreeCAD.GuiUp) 2019-10-25 10:54:31 -03:00
luz.paz
e804698edc Draft: use string operator instead of numeric LGTM fix 2019-10-25 10:25:31 -03:00
luz.paz
5c5fa07c10 Draft: Draft.py missing translate() context LGTM fixes [skip ci] 2019-10-25 10:25:31 -03:00
luz.paz
30a717beac Fix typos and misc. formatting [skip ci]
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml`
2019-10-21 16:02:23 -03:00
Yorik van Havre
60d843b2c1 Draft: Added property to hide lines in dimensions 2019-10-08 17:19:13 -03:00
Yorik van Havre
144df82f14 Draft: Better fix of copy mode 2019-10-08 16:32:23 -03:00
Yorik van Havre
f6d4c06ce9 Draft: Fixed copying of windows 2019-10-07 15:46:16 -03:00
M G Berberich
4f13d25933 Draft circular array
Adds a circular array case to the Draft Array.

Parameters are: radial and tangential distance, number of circles,
symmetry-axes, axis and center of rotation.

see https://forum.freecadweb.org/viewtopic.php?f=13&t=39726 (german)
2019-10-07 13:53:10 -03:00
M G Berberich
fcb021a4dd Circular Array
ciruclar array for Draft workbench
2019-10-07 13:53:10 -03:00
vocx-fc
e731d08c38 Draft, makeBezCurve(), changed parameter Degree to degree, preferred lowercase 2019-10-07 13:44:25 -03:00
Zheng, Lei
694cfc202e Draft: relax Part::Feature type checking for Link support
Replace isDerivedFrom('Part::Feature') with hasattr(obj,'Shape')
2019-10-07 10:48:42 -03:00
vocx-fc
f55059cedf Draft: new icon for Draft_Dimension in the tree view in SVG, instead of XPM 2019-10-07 14:17:17 +02:00
Zheng, Lei
de9732db1e Draft: disable implicit property linking in LinkArray 2019-08-30 13:35:25 +02:00
Yorik van Havre
0b3df322fb Draft: misc small fixes 2019-08-27 21:29:20 -03:00
vocx-fc
4c5e719e45 Draft: added DraftFillet.py to the sources, also InitGui.py, Draft.py, DraftTools.py, and CMakeLists.txt 2019-08-22 10:54:41 -03:00
vocx-fc
f5f4fd5e07 Draft: _PointArray, removed the tabs, and replaced with four spaces; mixing spaces and tabs may cause a syntax error in Python 3 2019-08-20 10:31:01 -03:00
Yorik van Havre
4ca71c16d4 Draft: removed degub message 2019-08-19 13:42:29 -03:00
Zheng, Lei
7747680d35 Draft: fix PathLinkArray 2019-08-17 15:32:51 +02:00
Zheng, Lei
0a4f1abf00 Draft: fix Link(Path)Array 2019-08-17 15:32:51 +02:00