Commit Graph

46 Commits

Author SHA1 Message Date
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
Abdullah Tahiri
4946eddc6b 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
696d4a5f4a + fix warnings with clang 2014-09-24 17:46:04 +02:00
Abdullah Tahiri
f1035e8481 Sketcher fixes: Symmetry arrows properly scaled, fixed icon in constraint taskbar list contextual menu 2014-09-18 16:01:34 +02:00
Abdullah Tahiri
7ab50d69d4 Sketcher new feature: Selects the elements associated with the selected constraint(s)
Ex 1: User selects constraints from the list => right click => select "select elements" from the contextual menu => The elements (edges,vertex) involved in the constraint(s) are selected.

Ex 2: User selects (a) constraint(s) => Clicks button in toolbar (if included by the user) => The elements (edges,vertex) involved in the constraint(s) are selected.

Intended as visual aid to see which elements are being affected by a constraint.

Requested by Jim on thread:
http://forum.freecadweb.org/viewtopic.php?f=19&t=6875&start=10

Solving another Mantis ticket I can not find now.
2014-09-17 16:43:49 +02:00
wmayer
36c6365e00 + change comment 2014-06-07 10:56:45 +02:00
Abdullah Tahiri
14d5914651 Fixed Datum Filter showing Named non-datum variables 2014-06-07 10:50:14 +02:00
wmayer
4bc20b267f + Add action to modify current item in constraint view 2014-05-01 16:12:03 +02:00
wmayer
7c7734f833 + Add context-menu to constraint view for renaming and deleting items, fix edit mode 2014-05-01 15:36:52 +02:00
wmayer
c3384e4b5a + fixes #0001380: Allow to set user-defined names for constraints 2014-02-10 15:36:58 +01:00
logari81
220930941d + fixes #0000928: Change selection numbering base in the Sketcher from 0 to 1 2014-02-08 23:51:15 +01:00
wmayer
1c09a78202 + fixes #0001380: Allow to set user-defined names for constraints 2014-02-04 18:32:05 +01:00
wmayer
e3d641d4d8 + fixes #0001380: Allow to set user-defined names for constraints 2014-02-03 14:45:41 +01:00
jriegel
16c6fe2470 Add unti support to Sketcher 2013-12-15 22:47:47 +01:00
logari81
1c858b4b4b + fix minor bug in constraints list filters
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5141 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-11-15 21:57:51 +00:00
logari81
85b2fec8f6 + revert to previous values when setDatum fails
+ detect well known invalid values for setDatum
+ hide some negative distance datums in the gui


git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5133 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-11-14 18:45:59 +00:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00