Commit Graph

66 Commits

Author SHA1 Message Date
Zheng, Lei
0f66755843 Sketcher: fix external editing 2019-08-17 15:32:50 +02:00
Zheng, Lei
d4ac072306 Gui: support in-place editing
The link support means that an object can now appear in more than one
places, and even inside a document different from its own. This patch
adds support for in-place editing, meaning that the object can be edited
at correct place regardless where it is.

See [here](https://git.io/fjPIk) for more info about the relavent APIs.

This patch includes two example of modifications to support in-place
editing. One is the ViewProviderDragger, which simply adds the dragger
node to editing root node by calling
View3DInventorViewer::setupEditingRoot(dragger). The other much more
complex one is ViewProviderSketch which calls setupEditingRoot(0) to
transfer all its children node into editing root. ViewProviderSketch
also includes various modifications to command invocation, because we
can no longer assume the active document is the owner of the editing
object.

This patch also includes necessary modification of the 'Show' module to
support in-place editing.
2019-08-17 15:08:32 +02:00
Abdullah Tahiri
3facea7ed0 Sketcher: Constraints' widget deactivated constraints commands and representation 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
62e721e8fd Sketcher: GUI PCH 2019-05-02 07:12:51 +02:00
triplus
92efd5fbe9 Improved icon themes support 2019-02-13 10:42:46 -02:00
wmayer
a67ee5648c remove trailing spaces 2018-11-05 10:53:01 +01:00
Abdullah Tahiri
21f2e79021 Sketcher: Refactor code relating to dimensional constraint checks 2018-11-04 14:41:20 -03:00
wmayer
4fd9d1078d fix segfault in ExpressionDelegate in case constraint property is invalidated 2018-10-04 23:34:19 +02:00
wmayer
80cd28bec9 comment out unused icons (to fix C2603 MSVC error) 2018-07-30 09:52:41 +02:00
Abdullah Tahiri
12025a02ed Sketcher: Constraint Widget support for the diameter constraint 2018-07-30 00:47:25 +02:00
Abdullah Tahiri
278c8266cd Sketcher: Optional extended naming for constraints widget giving first-second-third information 2018-05-31 14:29:00 +02:00
luz.paz
68c4b22315 Source typos fixes 2018-05-11 10:02:56 -03:00
wmayer
b780ba650f fix scan coverity issues 2018-02-10 14:29:49 +01:00
wmayer
1eaf70a80e add command to show/hide several constraints at once 2018-01-27 21:10:01 +01:00
wmayer
b147e4c810 fix crash when deleting constraint 2018-01-27 17:08:49 +01:00
wmayer
1f8f27b5e8 improve whitespaces 2018-01-27 16:47:55 +01:00
Abdullah Tahiri
a33f094e46 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
847becb32c Sketcher: Extend virtual space switching and update to constraints widget 2018-01-26 17:03:39 +01:00
Abdullah Tahiri
600bcf9513 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
46aa2c6356 Sketcher: Change nomenclature relating to Block constraint 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
fc0e6478f3 Sketcher: Constraint widget adapted to Block constraint 2018-01-22 22:52:56 +01:00
wmayer
1050378a2e avoid error 'Duplicate constraint not allowed' when deleting a constraint 2017-12-31 01:57:44 +01:00
wmayer
337657e85d when painting items make sure that constraint id is in range 2017-12-02 10:11:45 +01:00
wmayer
1b81ffaaaf fix crash ExpressionDelegate::paint 2017-04-20 22:31:18 +02:00
Abdullah Tahiri
be1cf4044f Sketcher: Hide Internal Alignment Constraints 2017-04-17 20:53:12 +02:00
Mateusz Skowroński
013d51e1c2 QStyleOptionViewItemV4 is deprecated in Qt5. Replace it with QStyleOptionViewItem. 2017-02-12 05:46:07 +01:00
wmayer
97905b8c7b issue #0002816: Trimming tool crashes 2017-01-23 19:06:48 +01:00
wmayer
a34c441373 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
c06b6f081f fix -Wextra in Sketcher 2016-09-22 18:34:35 +02:00
wmayer
d1d9db6d1c fix Coverity issues 2016-08-20 19:45:36 +02:00
Eivind Kvedalen
00516cc409 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
625a5b7945 Sketcher: Fixed radian/degree mix-up for Angle constraint. 2016-06-18 09:48:46 +02:00
DeepSOIC
acec16d5dc Sketcher: never ever hide constraint value sign, anymore 2016-03-12 21:28:22 +01:00
wmayer
ab449f5dd8 + 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
edd55999cc + fixes #0002471: In constraint context menu, 'Change Value' is always greyed out 2016-03-12 15:26:06 +01:00
Mateusz Skowroński
c275b35d48 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
bc4f4de54b + fix compiler warnings 2015-12-30 10:58:14 +01:00
Eivind Kvedalen
208ba9eb9d Sketcher: Fixed keeping sign of constraints. 2015-10-06 21:26:22 +02:00
wmayer
92b330bbcb + support of unicode names for sketch constraints 2015-09-24 03:17:47 +02:00
Eivind Kvedalen
cacf7bdaf1 Sketcher: Added support for expressions. 2015-09-21 14:51:10 +02:00
wmayer
d9aa9e4bf1 + 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
f0c9368f71 + minor changes 2015-09-13 23:24:12 +02:00
wmayer
756a9c8130 + fix various warnings with gcc 2015-09-01 19:29:39 +02:00
wmayer
6b3340e7b5 + include missing header files 2015-07-01 13:02:29 +02:00
Ian Rees
33e0441c39 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
4a052bebb5 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
18e5aed762 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
f59ef75cfa 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
cf4e9df78d 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
cdb02f271f + fixes #0001656: Vertical/horizontal distance constraint confuses for a line or two points 2014-12-30 15:20:29 +01:00