Commit Graph

63 Commits

Author SHA1 Message Date
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
wmayer
c1f19d3854 remove trailing spaces 2018-11-05 10:53:01 +01:00
Abdullah Tahiri
6a1aed66e2 Sketcher: Refactor code relating to dimensional constraint checks 2018-11-04 14:41:20 -03:00
wmayer
48ec50db38 fix segfault in ExpressionDelegate in case constraint property is invalidated 2018-10-04 23:34:19 +02:00
wmayer
36fa72488c comment out unused icons (to fix C2603 MSVC error) 2018-07-30 09:52:41 +02:00
Abdullah Tahiri
1414f986dc Sketcher: Constraint Widget support for the diameter constraint 2018-07-30 00:47:25 +02:00
Abdullah Tahiri
dccb86a5db Sketcher: Optional extended naming for constraints widget giving first-second-third information 2018-05-31 14:29:00 +02:00
luz.paz
420c2d7c03 Source typos fixes 2018-05-11 10:02:56 -03:00
wmayer
73522c3d10 fix scan coverity issues 2018-02-10 14:29:49 +01:00
wmayer
d1949f6e28 add command to show/hide several constraints at once 2018-01-27 21:10:01 +01:00
wmayer
7f3b40a9ca fix crash when deleting constraint 2018-01-27 17:08:49 +01:00
wmayer
e9e0071ccc improve whitespaces 2018-01-27 16:47:55 +01:00
Abdullah Tahiri
740afeb642 Sketcher: constraints' widget checkbox as python command
========================================================

Enables do/undo after switching constraints from one space to the other
2018-01-26 17:05:25 +01:00
Abdullah Tahiri
0c888309d6 Sketcher: Extend virtual space switching and update to constraints widget 2018-01-26 17:03:39 +01:00
Abdullah Tahiri
cccaa6d4dc Sketcher: Extension of Constraints Widget to support checkboxes for Virtual Space
=================================================================================

The checkboxes enable a constraint to swap virtual space.

If checked the constraint is visible in the selected space and hidden in the other space (Real Space or Virtual Space).
If unchecked the constraint is visible in the other space and hidden in the selected space.
2018-01-26 17:01:35 +01:00
Abdullah Tahiri
c7b137fe85 Sketcher: Change nomenclature relating to Block constraint 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
a4c29ba521 Sketcher: Constraint widget adapted to Block constraint 2018-01-22 22:52:56 +01:00
wmayer
1ad7724d50 avoid error 'Duplicate constraint not allowed' when deleting a constraint 2017-12-31 01:57:44 +01:00
wmayer
651ff24481 when painting items make sure that constraint id is in range 2017-12-02 10:11:45 +01:00
wmayer
6e5bba3999 fix crash ExpressionDelegate::paint 2017-04-20 22:31:18 +02:00
Abdullah Tahiri
b06150ba02 Sketcher: Hide Internal Alignment Constraints 2017-04-17 20:53:12 +02:00
Mateusz Skowroński
d7541bcd28 QStyleOptionViewItemV4 is deprecated in Qt5. Replace it with QStyleOptionViewItem. 2017-02-12 05:46:07 +01:00
wmayer
43e8c21743 issue #0002816: Trimming tool crashes 2017-01-23 19:06:48 +01:00
wmayer
1cdee20953 Qt4/Qt5 neutral changes:
+ replace Q_WS_WIN with Q_OS_WIN
+ replace Q_WS_X11 with Q_OS_LINUX
+ replace Q_WS_MACX with Q_OS_MACX
+ set explicit cast to HWND
2016-12-12 14:09:21 +01:00
wmayer
15d7ae5e2c fix -Wextra in Sketcher 2016-09-22 18:34:35 +02:00
wmayer
d39bd4906b fix Coverity issues 2016-08-20 19:45:36 +02:00
Eivind Kvedalen
7afcb4beda Sketcher: Changed return type of Constraint::getPresentationValue() to Quantity, to be able to include unit. 2016-06-18 09:48:52 +02:00
Eivind Kvedalen
171fce7b19 Sketcher: Fixed radian/degree mix-up for Angle constraint. 2016-06-18 09:48:46 +02:00
DeepSOIC
e624a1d00d Sketcher: never ever hide constraint value sign, anymore 2016-03-12 21:28:22 +01:00
wmayer
b25ef6235d + on rename of contraint make sure that new name is different, on swap constraint names make sure they have user-defined names 2016-03-12 20:02:18 +01:00
wmayer
a17870c93c + fixes #0002471: In constraint context menu, 'Change Value' is always greyed out 2016-03-12 15:26:06 +01: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
ad2c4c23d0 + fix compiler warnings 2015-12-30 10:58:14 +01:00
Eivind Kvedalen
b68ae65f56 Sketcher: Fixed keeping sign of constraints. 2015-10-06 21:26:22 +02:00
wmayer
10786c65b8 + support of unicode names for sketch constraints 2015-09-24 03:17:47 +02:00
Eivind Kvedalen
67800ec8c4 Sketcher: Added support for expressions. 2015-09-21 14:51:10 +02:00
wmayer
fa1d43345a + fixes #0000870: Center sketch to a constraint that has been double clicked in the constraint list. 2015-09-15 17:24:23 +02:00
wmayer
694c409caf + minor changes 2015-09-13 23:24:12 +02:00
wmayer
979d1299cc + fix various warnings with gcc 2015-09-01 19:29:39 +02:00
wmayer
834c0a642d + include missing header files 2015-07-01 13:02:29 +02:00
Ian Rees
418cefd7ee Cleaning up compile warnings, mainly in Sketcher
fabs() instead of std::abs(), add cmath include
2015-06-04 18:12:39 +02:00
Abdullah Tahiri
a1c3b942aa Sketcher: Driving/reference creation improvements and some other fixes
======================================================================

- Changing from Driving to reference does not include unnecessary solvings.
- Added some checks to avoid making Driving constraints when calling directly from python and involving only external geometry (would give redundant constraints).
- New python command toggleDriving to just change the status from reference to Driving
- New UI toolbar Command to toggle constraints
- Fix to allow switching from/to construction mode during continuous mode creation.
- Enable/Disable for constraints in constraints widget has changed to operate on multiselection and now effects "toggle" instead of enable/disable.
- Disable the option to directly create a SnellsLaw non-driving constraint (this constraint does not support direct creation, it can be toggled to non-driving after creation though).
2015-05-30 16:39:32 +02:00
Abdullah Tahiri
f7c9566f1e Sketcher bug fixes: Non-driving constraints editable on double click and color settings not working
===================================================================================================

This fixes a bug in the original implementation, that a non-driving constraint value could be
edited by double clicking on it in the 3D view.

It also includes minimal documentation on some functions.

It also includes:
- Color setting for non-driving constraints was not working.
- Settle UI terminology dispute:
  * Driving Constraint (normal red constraint)
  * Reference Constraint (non-driving constraint)
2015-05-30 16:39:26 +02:00
Abdullah Tahiri
bc85670ce9 Sketcher new Feature: Non-driving constraints (aka Driven constraints or dimensions)
====================================================================================

It allows to enable and disable a constraint in the constraint list.

When disabled, the constraints current value is shown, but its value is not enforced (it is driven by the other constraints and user interaction).

A disabled constraint can be enabled (as far as it is enforceable, see non-driving constraints to external geometry below).

The sketcher functionality has been extended to support non-driving constraints to external geometry elements. This were previously excluded from
the possibility of creating a constraint on them (as their values depend on other sketches and would be redundant with the unchanged value or conflicting when value is changed).
Now these constraints are created as non-driving, but as they are not enforceable, the UI does not allow you to make them driving.

The constraint filter has been extended to include a Non-Driving constraints category.

Thanks again to Werner for his continuous support, and specially in this case to DeepSOIC, as he pointed towards a much better implementation solution than my original idea.
2015-05-30 16:39:25 +02:00
DeepSOIC
43e8b30846 OpticConstraints: Adding Snell's law
Fix AngleViaPoint to support new derivative calculation technique.

OpticConstraints: Adding Snell's law. Fix AngleViaPoint to support new derivative calculation technique.

Snell's law constraint added to GCS, but not yet exposed and cannot be
tested.
Since the way CalculateNormal() returns derivatives had changed,
AngleViaPoint constraint needed modifications. Nothing serious.

OpticConstraints: SnellsLaw progress

Addable through python. Fix math. Some quick-and-dirty visual stuff to
get rid of hangs and to see the constraint in action.

OpticConstraints: SnellsLaw: flipping logic fix

OpticConstraints: SnellsLaw progress

Added toolbar button. Allowed editing a datum by doubleclick. New error
message approach during constraint creation.

OpticConstraints: SnellsLaw

OpticConstraints: SnellsLaw: list label improvement

OpticConstraints: SnellsLaw: fix after rebase

OpticConstraints: SnellsLaw: expose helper constraints

Snell's law internally is made of three constraints: point-on-object,
coincident and the Snell's sin/sin. They were all buried under one UI
constraint. Exposing them allows to construct reflection and
birefringence on the point (attempting to do so used to result in
redundant constraints and was often not functional at all).
This commit breaks compatibility with older files.

OpticConstraints: SnellsLaw: small refactor of math

Placing the duplicated code of error and gradient calculation into a
private method.

OpticConstraints: SnellsLaw: fix datum edit unit

OpticConstraints: SnellsLaw: fix datum edit bug

After previous fix, the dimensionless value was not accepted (the
constraint's value did not change, the changes were ignored).
2015-01-02 11:48:31 +01:00
wmayer
ff09f0524d + fixes #0001656: Vertical/horizontal distance constraint confuses for a line or two points 2014-12-30 15:20:29 +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
wmayer
032c893183 + fix warnings with clang 2014-09-24 17:46:04 +02:00
Abdullah Tahiri
749abc5ed7 Sketcher fixes: Symmetry arrows properly scaled, fixed icon in constraint taskbar list contextual menu 2014-09-18 16:01:34 +02:00