Commit Graph

56 Commits

Author SHA1 Message Date
wmayer
82866db0ca Mod: replace QRegExp with QRegularExpression 2022-10-07 14:03:53 +02:00
0penBrain
26aaf0af45 Sketcher : optimize code that was present for Qt4 compatibility
Was introduced by 634e47f31, new code only supported by Qt5
2022-10-03 11:12:35 -07:00
berniev
ddafb98813 Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
wmayer
d344ccc4eb Sketcher: [skip ci] Fix several clazy issues:
* Missing reference in range-for with non trivial type [-Wclazy-range-loop-reference]
* Unused QString [-Wclazy-unused-non-trivial-variable]
* Missing emit keyword on signal call [-Wclazy-incorrect-emit]
* Don't call QList::operator[]() on temporary [-Wclazy-detaching-temporary]
* Use multi-arg instead [-Wclazy-qstring-arg]
* Maybe you meant to call ViewProvider2DObjectGrid::onChanged() instead [-Wclazy-skipped-base-method]
2022-07-25 12:56:09 +02:00
Uwe
88a06f8f10 Mod: remove some unnecessary nullptr checks 2022-07-18 12:58:12 +02:00
Abdullah Tahiri
19a69df0fc Sketcher: Bug fix
https://forum.freecadweb.org/viewtopic.php?p=606581&sid=70cfe557d7d1985e45ea1b298282c759#p606581
2022-07-01 13:56:16 +02:00
mosfet80
620c273c4e Boost version <=1.60 is never used in freecad 0.20 (#7038)
* Boost version 1.60 is never used in freecad 0.20
2022-06-24 02:20:26 +02:00
Uwe
68a499574a [Sketch] remove unnecessary Boolean comparisons 2022-06-19 18:35:52 +02:00
Zheng, Lei
3ef438eaf0 Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
1ee046788d Sketcher: PR6497 move return statement to new line 2022-03-29 13:25:06 -05:00
wmayer
ead5154b18 Sketcher: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
wmayer
1ca7429705 Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
0penBrain
30daaa66bc Sketcher: add GeoID on extended naming of geometries 2022-02-15 14:02:07 +01:00
0penBrain
6037553f3c Sketcher: add construction mode display for points in element list 2022-02-15 14:02:07 +01:00
Abdullah Tahiri
97c82a6703 Sketcher: Convert PointPos into an enum CLASS 2021-12-11 16:17:21 +01:00
wmayer
ca5c799ce2 Gui: rename methods of SelectionObserver to clarify intention in client code 2021-12-07 14:17:07 +01:00
Abdullah Tahiri
e333225a12 Sketcher: use addSelections for group selecions in TaskSketcherElements 2021-10-06 13:44:06 +02:00
0penBrain
ea1e6595b5 [Sketcher] Radiam : make the command basically usable into Gui 2021-06-12 07:07:28 +02:00
donovaly
28c66fc501 [Sketcher] make pointers to the UI std::unique_ptr
Same as PR #4293, just for Sketcher

as noted in https://github.com/FreeCAD/FreeCAD/pull/4271#discussion_r554673632
the pointer to the UI should be a unique pointer.

This PR does this for all Sketcher dialogs that don't already use a unique_ptr.
2021-02-04 10:37:44 +01:00
Abdullah Tahiri
395a0f19b4 Part/Sketcher - Construction Migration - step 3: Removal of Geometry construction data member
=============================================================================================

This commits removes the Geometry construction data member and adapts sketcher code to use
GeometryFacade to access construction information via the SketchGeometryExtension.
2020-12-10 18:34:06 +01:00
Abdullah Tahiri
1f46b72491 Part: Geometry - encapsulate construction access 2020-10-25 03:52:51 +01:00
vocx-fc
68c7b1f078 Sketcher: rename constraint icons to be more consistent with the rest
`Sketcher_ConstrainBlock` to `Constraint_Block`.
`Sketcher_ConstrainLock` to `Constraint_Lock`, and the corresponding
`_Driven` variant.

Adjust the icons in the taskpanel for the sketcher constraints,
elements, and for the action menu for constraints.

Adjust the icon order in the `Sketcher.qrc` resource file.
2020-10-01 09:59:26 +02:00
wmayer
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
4ec45b545e boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
0penBrain
cbefa8e6fe [Sketcher] Improve elements color tampering with edge coloring
Use HSV colorspace for maximum Qt4 compatibility
2020-04-07 17:05:37 +02:00
0penBrain
634e47f318 [Sketcher] Fix Qt4 compatibility in MultIcon + minor improvement 2020-04-07 17:05:37 +02:00
Abdullah Tahiri
9752de8602 Sketcher: Element Widget External/Construction icons fixes
==========================================================

Changes:
- Move multIcon structure to be internal to TaskSketcherElements class
- Change Caps to MultIcon for consistency
- Move tamperIcon from TaskSketcherElements to MultIcon struct
- Change tamperIcon method to be the constructor of MultIcon and change from struct to class
- Update the tamperIcon algorithm, so that only the point that is not marked in green as selected
is made pink.

Bug fix:

UpdateIcons and SlotElementsChanged are methods sharing code (they could benefit from a refactoring), but
they are conceptually different and are called in very different circumnstances.

UpdateIcons preserves selection. This means that one may select the stating point of line1, press z to switch
to edges, select the edge of line 2 and do a point on object constraint all without touching the 3D view.

SlotElementsChanged occurs when there are additions or removals in the number of geometry elements of the widget.

Warning:

This code requires QT 5.6 because of function pixelColour(int, int):
https://doc.qt.io/qt-5/qimage.html#pixelColor-1

Travis without QT5 complains with:

/home/travis/build/FreeCAD/FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp:1120:31: error: ‘class QImage’ has no member named ‘pixelColor’; did you mean ‘setColor’?
2020-04-07 17:05:37 +02:00
0penBrain
9b2e7b22c5 [Sketcher] Distinguish normal/reference/construction elements in task dialog 2020-04-07 17:05:37 +02:00
Joshua Call
61c88918bc Rename Sketcher icons
Renamed Sketcher_AlterConstruction.svg to
Sketcher_ToggleConstruction.svg, and renamed the original
Sketcher_ToggleConstruction.svg to Sketcher_ToggleConstruction_old.svg
as per the directions of vocx in this forum post:
https://forum.freecadweb.org/viewtopic.php?f=21&t=42131&p=357725#p357725
2020-01-05 15:29:47 +01:00
Abdullah Tahiri
e9f3551f8f Sketcher: Mode filter of Elements Widget
========================================

A combobox type filter to filter out on Normal geometry, Construction geometry, External geometry.

Useful, for example, to select and or delete only construction geometry.

It also fixes a bug, that external geometry was wrongly indexed in non-extended naming mode.
2019-07-01 13:49:06 +02:00
Abdullah Tahiri
dc32a0685b Sketcher: GUI PCH 2019-05-02 07:12:51 +02:00
triplus
43b081947f Improved icon themes support 2019-02-13 10:42:46 -02:00
Abdullah Tahiri
2830f107ae Sketcher: Improve element widget name of external geometry
===========================================================

fixes #3719

what?
https://forum.freecadweb.org/viewtopic.php?f=3&t=32693&p=274634#p274634
2018-12-19 10:27:30 -02:00
Abdullah Tahiri
26f93eef96 Sketcher: Geometry Element Widget Support for Diameter Constraint shortcuts 2018-07-30 00:47:25 +02:00
luz.paz
6656d9c6de follow-up source typos 2018-05-11 10:02:56 -03:00
Abdullah Tahiri
09d774631c Sketcher: Elements Widget add construction information 2017-04-17 20:53:12 +02:00
wmayer
004324bbc5 fix scan coverity issues: uncaught exception 2017-04-11 14:03:08 +02:00
Abdullah Tahiri
b5c4a8a880 Sketcher: Elements widget external geometry identification fix 2017-04-08 12:58:06 +02:00
abdullahtahiriyo
3f0c9d7bc3 Merge branch 'master' into bspline_2017 2017-01-18 22:48:27 +01:00
Abdullah Tahiri
b255ada03a Sketcher: Sketcher Elements support for BSpline 2017-01-12 22:55:31 +01:00
wmayer
c2f2a25054 issue #0002739: Mac users must Command click instead of Ctrl click multiple elements. 2017-01-11 20:58:49 +01:00
wmayer
a9530bc678 issue #0002739: Mac users must Command click instead of Ctrl click multiple elements. 2017-01-11 13:25:46 +01:00
Abdullah Tahiri
01ba29ed33 Sketcher: Parabola Element Widget support 2016-12-24 04:08:53 +01:00
Abdullah Tahiri
14a2437b72 Sketcher: Hyperbola element widget support
==========================================

Support added to the Element widgets for hyperbola
2016-11-27 18:45:33 +01:00
wmayer
15d7ae5e2c fix -Wextra in Sketcher 2016-09-22 18:34:35 +02:00
wmayer
e4f0ddad84 Coverity issues: check return value of dynamic_cast or replace it with static_cast 2016-08-17 10:43:58 +02:00
Mateusz Skowroński
cd2db00f22 QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:07:25 +01:00
wmayer
834c0a642d + include missing header files 2015-07-01 13:02:29 +02:00
wmayer
29d50dbc01 + improve whitespace 2014-12-25 23:10:42 +01:00
Abdullah Tahiri
a458c3e6d2 Sketcher New Feature: Ellipse support
- Ellipse introduction button via (center,majaxis extreme, a point in edge), ellipse is always CCW so that Z axis goes in the positive direction of the sketch
- Backwards compatibility with files of previous versions of ellipse not defining a phi angle
- Art by Jim (all the icons you see and the XPMs shown on creation of an ellipse)
- Element Widget support for ellipses
- Box selection for ellipses
- Point on Ellipse constraint based on the gardener's method based on Ulrich's function proposal (radcan simplified, i.e. with simplify_radical sage function)
- Tangent: Ellipse to Line based on DeepSOIC's geometric formulation (radcan simplified)

Sketcher New Feature: Internal Alignment Constraint
- The element to which internal alignment is applied has to be selected last.
- All other elements are added in the order of priority, taking into account existing elements
- Art by Jim (beautiful icons).

Sketcher New Feature: Tool to show/hide/restore the internal geometry of an element
- New functionality for show/hide internal geometry:
  toggles between hiding all unused internal geometry elements and showing all internal geometry.
  The restore function is implicit to the showing all internal geometry

Sketcher New Feature: Arc of Ellipse support
- Part::Geometry + Python implementation
- ArcOfEllipse creation method
- Art by Jim (all the icons you see and the XPMs shown on creation of arc of ellipse elements)
- Sketcher Element widget for ArcOfEllipse.

Bug fix: Select elements associated to constraints works now for foci internal alignment constraints
2014-12-20 12:33:29 +01:00