Commit Graph

40 Commits

Author SHA1 Message Date
DeepSOIC
d9376eb487 Sketcher: visibility automation
Added the following properties to Sketch ViewProvider:
* 4 bools to enable/disable parts of automation
* TempoVis property to hold instance of TempoVis python object, that helps with the automation
2016-06-20 01:19:06 +03:00
Stefan Tröger
4ed0302404 Ensure correct sketch placement calculation
As bodies are movable now they need to be taken into account for calculating the sketch placement.
2016-04-12 18:12:21 +02:00
Stefan Tröger
a8f27937de fix sketch editing within transformed parts 2016-04-12 18:12:08 +02:00
jriegel
db460cff8a auto WB switching for editing Sketches and new TaskWatcher 2016-04-12 18:11:45 +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
Abdullah Tahiri
d1acd124cc Sketcher: Bug fix: Undo/Redo implementation
================================================

Fixes a bug in master that the dependent 3D geometry would not update on Undo (in Auto update mode enabled).

Undo and redo signals are handled by ViewProvider in order to introduce an recompute or solve() of the sketchObject
as determined by the Auto Update Mode in order to update DoF and dependent geometry if necessary.
2015-06-15 22:56:04 +02:00
Abdullah Tahiri
0e92e6356f Sketcher: Major re-structuration: New Solving Model: General Sketch Solve call reduction
=======================================================================================

ActSketch in ViewProvider dissapears. The temporal sketch (sketch.cpp) for solving is now a data member of SketchObject.cpp (hereinafter solvedSketch). All the solving is concentrated in SketchObject.cpp.

SketchObject provides an interface to expose its solver, as it is still currently needed for some UI operations from ViewProviderSketch, like dragging points (solving rubber bands).

ViewProviderSketch still can select whether to draw the solvedSketch geometry (previously ActSketch) geometry (UI staff) or the SketchObject geometry. Performancewise, it makes sense to separate this two
geometries, as the SketchObject one involves modifying the Geometry and Constraint Properties (including all the undo related functionality), which would mess the undo functinality and incur in a big
peformance penalisation while dragging. One characteristic of solvedSketch is that its geometry is solved, whereas the geometry of SketchObject may not have been solved yet.

These geometries may differ at for the following reasons:
1. The geometry corresponds to an ongoing dragging operation, so solvedSketch has the last calculated dragging geometry, while SketchObject has the one corresponding to initial position.
2. Geometry/constraints were added to the sketch, but no solve/execute was triggered yet (envisioned situation is the future group creation functionality not in this commit).

What do I gain?

- Inserting a (simple) geometry element now costs 1 solver execution.
- Inserting a constraint now costs 1 solver executions.

For reference, in previous versions inserting a constraint involved 5 solver executions.

The following information provide a historical review of the coding of this commit (formed of 10 squashed commits):

This is a general sketch solve call reduction, not only during geometry creation (this commit does not include until here any specific measure to reduce calls on geometry creation, that is another branch)

After a lot of profiling, it seems that the "cause"(tm) that creates so many solver calls is that every update generates a solving in ViewProviderSketch, regardless of the need for that update,
many times with the only aim of providing the DoF for the message dialog and keeping ActSketch in sync with SketchObject in case it is needed (currently UI moving points, constraints,...).

Sketch solver is now a data member of SketchObject instead of a temporal object that gets initilized and destroyed.

This allows:
1. Potentially more synergy reducing calls to setUpSketch (still to be seen, still to be optimized)
2. Allowing SketchObject to access the latest geometry that has been solved => In future, allow objects that use SketchObject to obtain the latest
solved geometry instead the geometry of SketchObject that may still be unsolved. This is relevant for drawing the geometry

No more solving in ViewProviderSketch. Solving a Sketch is now an exclusive competence of SketchObject.

There is however a lot of cleaning to do in ViewProviderSketch

(I mean, not that these commits are making a mess in VPSketch,
but that as a consequence of the changes, it should be possible to
optimize VPSketch, specially moving and drawing methods)

Very useful comment for future developers that may wonder why a solve per constraint just upon addition is necessary.

Added a new function to get the size of the geometry of the instance of the solver object (Sketch.cpp).
The previous way was to extract the geometry, which is costly and error prone, as you have to delete it afterwards.

Inserted comment about the necessity of triggering a Part2D update during edit mode
2015-06-15 22:53:59 +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
wmayer
27863408c9 + remove references to SoFCSelection where not needed 2015-05-20 19:24:12 +02:00
Stefan Tröger
72cab0c002 Adaption of FreeCAD to QuarterWidget
-removes all soqtviewer references
-create a quarter adaptor class which implements missing functionality
-adopts freecad code to make use of SoRenderManager and changed View3DInventorViewer  interface
2014-09-23 10:11:11 +02:00
Abdullah Tahiri
fdb7de1dda Sketcher visualization enhancement: Do not group sketcher symmetry icons.
Do not add a symmetry constraint icon to a group of icons, so that it lies on the line or point providing the symmetry (symmetry axis/point),
as it is more clear to the user which line this is.
2014-09-17 18:48:36 +02:00
Abdullah Tahiri
95c512d9a1 Sketcher feature enhancement: Symmetry constraint perpendicular to axis of symmetry
Solves Mantis ticket: http://www.freecadweb.org/tracker/view.php?id=1623
Unrelated minor fix: remove unused variable
2014-09-17 18:48:15 +02:00
Abdullah Tahiri
34cc7c3136 Sketcher new feature: Select Conflict and Redundant Constraints
Based (and solves) Mantis ticket:
http://www.freecadweb.org/tracker/view.php?id=1643

The ticket refers only to redundant, and ask for deletion.

Two commands are created, one for redundant constraints and other for conflicting constraints.

As usually removing one constraint of the "at least one" is sufficient, the implementation selects the constraints (but does not delete them).

The user therefore easily identify the constraints involved and decide to delete them.

This implementation takes into account the edit->Actsketch that ViewProvidedSketch creates for solving, as it is this instance the one that generates the messages in the Sketcher Taskbar.

No buttons in the toolbar by default (can be added by the user), but an hyperlink in the solver messages which triggers the selection of the appropriate command (conflicting or redundant).
2014-09-17 16:43:50 +02:00
wmayer
1011dd4175 Squashed commit of the following:
commit 695becbbfff961b13e3edb5a4e1e4487bc53b4bb
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Mon Aug 4 15:24:33 2014 +0200

    - Making combo disable state.
    - Updating Art (Thanks Jim!)

commit d5391d40ace450fa2e65fe2b4ab8029ad37cacf8
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Fri Aug 1 00:40:15 2014 +0200

    - Adaptation of code to Workbench's new Template structure.
    - Minor adaptation of new ViewProvideSketch code to new constraint code (only in code extensions needed for element Widget)

commit ecdec20afa33c9a950e6054e80e4aa9c72aad8b6
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Thu Jul 31 15:31:38 2014 +0200

    Fix so that when applying a coincident constraint to a plurality of points,
    if one constraint on a couple of points exists, no new coincident constraint is
    added to this couple.

    Fixes: http://forum.freecadweb.org/viewtopic.php?f=3&t=6890

commit 32ef59d76e6c63356f5d36598ca11eb47c2e52af
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Thu Jul 31 14:13:58 2014 +0200

    Add some placeholder art for icons to avoid having a cross icon and annoying icon not found messages.

commit ccb60a3a7e71a0eb8ad5d896542314a98ef314a8
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Mon Jul 28 20:15:29 2014 +0200

    - Fixed Length Constraint accelerator (D) to SHIFT+D to avoid colision with other higher level FreeCAD accelerator assignment.
    - Selection Accelerators now toggle on shortcut execution, and act when no other element is selected (fixed bug)

    TODO: Art+Toolbar

commit 791358d046e8eeb03fa00272f5627c75254c48eb
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Mon Jul 28 15:12:07 2014 +0200

    Fixing shortcut system:
    - Take shortcuts automatically from CommandManager.
    - Fixed two shortcuts in CommandConstraints (Point on Object - O and
    Parallel Constraint - P to SHIFT+O and SHIFT+P to avoid collision with other constraints)
    - Fixed shortcuts in CommandConstraintAccel to non-already-existing combinations
    - Fixed Sketcher Menu to show accelerators

commit 12d366406a45038ce1a4f725a98e4f570475084b
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Mon Jul 28 11:53:37 2014 +0200

    Implemented SHIFT multiple selection functionality in listwidget.

commit 0606ea7dfe38fdf8924f65f14382f1b327145c80
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Mon Jul 28 11:02:02 2014 +0200

    Added Sketcher Accelerators for:
    - Selection of H Axis
    - V Axis
    - Origin

    Main TODO: Shortcuts and Shift in list widget implementation

commit 297464807fc56fbcf31efadff9625fc05bb20c41
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Wed Jul 23 11:37:21 2014 +0200

    Implementation of:
    - Switch on 'Z' instead of 'Shift'
    - Checkbox to select whether element internal name (e.g. Edge10) should be presented on list or not (Sponssi requested)
    - Checkbox to force going back to "Edge" type on change from one element to the next (Sponssi requested)

commit c8764b116acdcfdc7ef7658dc6009fb8db807906
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Wed Jul 23 07:57:11 2014 +0200

    TaskSketcher Elements:
    - Store Vertex within elements for optimization (reduce loops searching for vertex in every function call)
    - Added the accelerators described below + Toggle Construction as context menu commands
    - Fixed bug (Thanks sponssi!): After some element has been preselected from the list and the cursor moved to the drawing area,
    the preselection doesn't seem to be resetted in the widget or whereever it is handled.
    Tapping shift still swaps the preselection between the points of the previously selected element.
    The left mouse button has to be clicked in the draw area to get rid of this.
    http://forum.freecadweb.org/viewtopic.php?f=10&t=6861&sid=7eea4adc7ecf4cebd561b357601866a2&start=20
    - Extended naming of elements, to facilitate writing python code (as requested by sponssi).
    - Minor modifications (creation of utility fuctions, code readibility, ...)

    Sketcher Workbench:
    - First effort to add a toolbar with the accelerators.

    Sketcher Accelerators: (Perform actions on existing elements, as opposed to Geometry Creation, not restricted to applying constraints)
    - Close Shape : of selected edges (i.e. lines and arcs)
    - Connect : selected edges (connect endpoint edge with starting point of next edge according to selection order)
    - Select Constraints : associated with currently selected edges

commit 1dc18204a4e2e38f71d729a7692383f50a7d4654
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Sat Jul 12 16:06:48 2014 +0200

    New alternative implementation of the Sketch Element List.

    This version comprises:
    - Identification via icon of type of geometric element (Point, Arc, Line, Circle) and
      Type of selection (Edge, Starting Point, End Point, Center Point)
    - Corrected a bug where upon selection from the combobox, the icons were not updated (Thanks Jim!)
    - Implementation of jump to next valid type of last preselected element (aka fast-forward) for all the types.

commit 4d472ef796362405c3982355f86489fa92cbfe6d
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Thu Jun 26 17:15:51 2014 +0200

    Feature request by jmaustpc
    - When an object does not have an element, lets put a different icon.
    - Currently the constraint lock icon is used until availability of a new one.

commit 6d15478f6533ff3805520a8ca36d1c41908cb0af
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Thu Jun 26 14:54:23 2014 +0200

    Bug fix (preselection not disappearing on changing element without the element Type).

commit e33043e17781fcf6399257696f115f68ab4580ec
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Thu Jun 26 14:39:20 2014 +0200

    New nicer icons by jmaustpc. They look much nicer :-)

commit 2ce2d6ff1ad2d81b0b1e30ffcbe9f2cc445f2e5b
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Thu Jun 26 14:37:21 2014 +0200

    Fast-Forward functionality:
    - If an element not having "midpoint" is preselected, then on pressing SHIFT the
    Type will jump from EndPoint to Line skipping midpoint.
    - This is intended as a productivity feature, as most sketch elements usually are lines

commit 1865d06d06582a49da10ddc123133807a4593060
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Wed Jun 25 15:47:22 2014 +0200

    Bug fix (thanks jmaustpc)
    - Preselection is maintained even though the geometric element does not have the "Type".
    - Fix involves calling for remove preselection in TaskSketcherElement
    - Implementing the response to the message RmvPreselection in ViewProviderSketch

commit 14e21da4b4ed0e9a2b3e846a4e51f6745d5e0ab7
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Mon Jun 23 14:25:35 2014 +0200

    Fix Bug with null pointer (thanks jmaustpc!)
    Clean up code

commit 0d99eb633f1bca45d4e7bb22c57bd4892767a390
Author: Abdullah Tahiri <abdullah.tahiri.yo@gmail.com>
Date:   Wed Jun 11 16:32:48 2014 +0200

    New widget for the Taskbar of the Sketcher WB.

    The objectives of this widget are:
    1. Allow editing of sketches when they have (partially) overlapping lines of any type
       (construction/external/normal).
    2. Allow the construction of sketches using the keyboard (less mouse intensive)

    The widget works as follows:
    1. A QListWidget presents a list of elements, element is here a geometric element
    formed Types edges, starting points, end points and midpoints (e.g. circles, arcs)
    2. On hovering/Entering one item in the list, it is preselected for easy identification.
    3. The selection can be switched from one type to another using the SHIFT key
    (press and release) in a round-robin fashion (or you can select it using the droplist)
    4. Selection of different types is possible (e.g. two points and a line).
    5. The contextual menu accessible by right click allow to apply a constraint to the
    selection.
    6. The constraints in the contextual menu have shortcuts, so you can actually use the
    shortcut directly from the QListWidget.

    Additional features introduced to other parts during development...
    - New color introduced for Types that are selected and preselected at the same time
    - Edges is a SoLineSet. You can not apply many So modifiers (width,offset) to parts of a SoLineSet.
    An edge part of a SoLineSet that is drawn after another one, covers it unless it is closer to the
    camera. The system of manual offsets already in place for points has been extended to properly
    handle (i.e. show) overlapping lines part of a SoLineSet.
2014-08-05 00:35:02 +02:00
wmayer
a252471625 + fix author notes, fix memory leak, fix build failure under Windows 2014-07-30 10:05:13 +02:00
wmayer
6ca580456b Squashed commit of the following:
commit 8853bf442b6e1a98699fa90fca5eb30b3f6d3a5e
Author: Ian Rees <ian.rees@gmail.com>
Date:   Tue Jul 29 15:46:59 2014 +1200

    Refactoring and small fix in constraint icon bounding boxes

commit c03e4c13d8fd657e18e3c78d16bbdef209f8c779
Author: Ian Rees <ian.rees@gmail.com>
Date:   Mon Jul 28 15:41:15 2014 +1200

    Implemented picking of individual constraints from combined icons

commit 254aaab450fe6646bee7542c532c454af91b6597
Author: Ian Rees <ian.rees@gmail.com>
Date:   Mon Jul 28 13:04:18 2014 +1200

    Added bounding boxes for combined constraint icons

commit 4f0738ec30220fbf1abdea14dd121d0a134e5dfd
Author: Ian Rees <ian.rees@gmail.com>
Date:   Sat Jul 26 18:53:33 2014 +1200

    Added screenCoordsOfPath() to View3DInventorViewer

commit 14e2dc7b4aa79db97cbacd2c848728a66276d644
Author: Ian Rees <ian.rees@gmail.com>
Date:   Sun Jul 20 14:24:27 2014 +1200

    Bit of code to make constraint icon text rendering nicer.

    This won't be useful unless the font changes, but wanted to add it while
    I was thinking about it.

commit 8020d2d62214d71875cbae101d5ac5e96d998201
Author: Ian Rees <ian.rees@gmail.com>
Date:   Sun Jul 20 13:54:51 2014 +1200

    Fixed an off-by-one in ViewProviderSketch::combineConstratintIcons

    Bug resulted in icons occasionally not being combined into groups,
    when they should've been.

commit 20d92a3ccc1f795be1cb86f6f92045518dc8eb81
Author: Ian Rees <ian.rees@gmail.com>
Date:   Tue Jul 15 19:38:20 2014 +1200

    Fixed a bug that was introduced two commits ago.

commit 69e1ea848e3bc3c8c372c539f30a7b4d2a563aa2
Author: Ian Rees <ian.rees@gmail.com>
Date:   Tue Jul 15 15:33:30 2014 +1200

    Fixed dumb copy-and-paste error

commit a998b75a905cc31e1f4f49869e81ecaef5858b69
Author: Ian Rees <ian.rees@gmail.com>
Date:   Sun Jul 13 18:39:22 2014 +1200

    Fixed crash reported by sponssi

    More info at http://forum.freecadweb.org/viewtopic.php?f=10&t=6965&p=56590

commit 27b7b804790dda5164c7ef0b9418f6c160228859
Author: Ian Rees <ian.rees@gmail.com>
Date:   Thu Jul 10 13:32:16 2014 +1200

    Cleaning up my git repo for FreeCAD.

    This branch now has just the Sketcher icon fixes, plus a few random comment edits.
2014-07-30 10:05:12 +02:00
wmayer
a5efc53bfc + fix transparency issue, disable sample buffers when using front buffer 2014-05-09 19:20:30 +02:00
wmayer
a7aca65e77 + issue #0001475: Implement a 3 point arc similar to solidworks in sketcher 2014-03-17 09:37:56 +01:00
wmayer
3ea41ff0c9 + fixes #0000844: Cannot use edge hidden by sketch axis as external geometry 2014-03-15 19:53:14 +01:00
wmayer
c50c30c320 + fixes #0001330: Cannot link edge to external geometry 2014-03-03 18:50:43 +01:00
wmayer
9f0b1ac66e Improve performance of box selection in sketcher 2013-04-27 20:45:16 +02:00
logari81
b6eec06fa3 Sketcher: Support auto-constraints with root cross elements and swap axes colors 2012-11-29 16:13:13 +01:00
wmayer
f03b2e80d0 0000869: Mousepointer does not track to line endpoint in sketches attached to copied or imported sketches. 2012-11-15 11:17:59 +01:00
wmayer
c71b753730 Prepare sketch solver messages to be translated 2012-10-30 13:51:08 +01:00
logari81
e7ca7631fe Sketcher: implement box selection (based on mrlukeparry's work) 2012-09-04 14:14:03 +02:00
wmayer
ec0ae08612 Fix build errors on Windows 2012-08-13 10:26:02 +02:00
logari81
96c5dda4eb Sketcher: crashes fix and other small fixes for the polyline tool 2012-08-12 12:21:53 +02:00
logari81
b3938ad045 Sketcher: simplify positioning of constraint icons 2012-07-18 16:26:24 +02:00
logari81
714908d3e9 Sketcher: add support for points as construction geometry 2012-07-08 12:01:07 +02:00
mrlukeparry
c5b2f377a4 Sketcher: improve position hints on arc and circle creation 2012-06-24 16:30:48 +02:00
logari81
d92f627a8d Sketcher: simplify sketch solver messages 2012-05-26 20:02:57 +02:00
logari81
73d2fa9e61 Sketcher: avoid duplicate code and unnecessary arguments 2012-05-14 10:44:44 +02:00
logari81
6b89ba2641 + initial support for external geometry constraints in sketches (work in progress)
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5346 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-12-24 16:12:45 +00:00
wmayer
73dd4ab9eb + respect Selectable property in SoFCUnifiedSelection node
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5136 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-11-15 10:04:21 +00:00
logari81
62e8357b5d + change default colors
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5123 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-11-12 23:47:45 +00:00
logari81
8c515c381b + improve automatic grid resizing in the sketcher
+ make sketch axes always visible
+ remove redundant funtions 


git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5097 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-11-07 21:45:13 +00:00
jriegel
e21cb403f5 + fix bug #470
+ different color for H and V axis in sketcher edit Mode

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5091 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-11-04 21:40:47 +00:00
logari81
e1326a9760 + simplify arc and circle trimming implementation in the Sketcher
+ fix a memory leak in freegcs
+ small improvements and typo fixes in freegcs
+ homogenize coding style, strip trailing spaces


git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5044 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-21 09:45:19 +00:00
mrlukeparry
601bd29b2d Fixed the dreaded infinite loop bug. Implemented a few methods for SoZoomTranslate to ensure that it works correctly in all cases.
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5036 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-18 21:55:29 +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