View Issue Details

IDProjectCategoryView StatusLast Update
0000112FreeCADFeaturepublic2011-08-01 14:53
Reporteryorik Assigned ToJriegel 
PrioritylowSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target Version0.12Fixed in Version0.12 
Summary0000112: Make python workbenches able to handle edit mode
DescriptionI think it would be cool if workbenches could handle edit mode...
Specially with parametric objects, Edit mode could allow you to edit parameters graphically.

For example, in the case of a parametric rectangle, in edit mode you would see a draggable dot at the placement point, and draggable length and width parameters.

I suppose what would be best is a function in the Workbench class that is called when entering edit mode, like Activated()? If that function doesn't exist, then fall back to default edit mode.

Then all the rest (adding temporary extra nodes to the object coin node, etc...) would be the responsablility of the workbench itself...

What do you think?

Maybe there is also another approach, more powerful, but much harder to do... It would be, instead of making workbenches handle editmode, make edit mode handle parameters?

But that's hard, because imagine the case of the rectangle: it has a placement point, a length and a width. But the edit mode has no way to know where the length and width parameters are used... How/where to draw them on screen? Then each and every parameter should contain additional info, so the edit mode knows where to draw them. Pretty complicated I think.

So probably first idea is handier to do... What is your opinion?
TagsNo tags attached.
FreeCAD Information

Relationships

child of 0000276 closedJriegel Stringent user interface behavior 

Activities

Jriegel

2010-06-29 12:03

administrator   ~0000253

Actually the methode is called at the ViewProvider. Called setEdit() and resetEdit(). I think thats easy to do....

yorik

2010-07-14 16:14

administrator   ~0000267

Perfect! I've been playing a bit with the SoDragger nodes, it's super cool to create very professional-looking draggers, that can also display all kind of custom information. I think it will be pretty easy to build a good editmode for the draft module, specially now that it's all parametric.

On this page http://www-evasion.imag.fr/~Francois.Faure/doc/inventorMentor/sgi_html/ch15.html there is even an interesting section treating about swapping nodes with manipulators. That could be used to create a kind of "generic" edit mode for Part shapes, where you could simply "drag" the vertices...

Just an idea for later.

wmayer

2011-08-01 14:53

administrator   ~0000969

Done in r4717

The python binding has been extended by a couple of methods:

* for a given view provider you can call the methods:
+ startEditing(int mode=0) -> True/False
+ finishEditing() -> None
+ isEditing() -> True/False

And for you custom view provider classes you can implement the methods:
+ def setEdit(vp, mode)
+ def unsetEdit(vp, mode)

Issue History

Date Modified Username Field Change
2010-06-27 14:16 yorik New Issue
2010-06-29 12:03 Jriegel Note Added: 0000253
2010-06-29 12:04 Jriegel Status new => assigned
2010-06-29 12:04 Jriegel Assigned To => Jriegel
2010-06-29 13:36 Jriegel Target Version => 0.11
2010-07-14 16:14 yorik Note Added: 0000267
2011-01-06 21:30 Jriegel Target Version 0.11 => 0.12
2011-02-22 12:00 Jriegel Relationship added child of 0000276
2011-08-01 14:53 wmayer Note Added: 0000969
2011-08-01 14:53 wmayer Status assigned => closed
2011-08-01 14:53 wmayer Resolution open => fixed
2011-08-01 14:53 wmayer Fixed in Version => 0.12