Some help needed with making operand path invisible in bool op LPE
Dear Inkscape Team,
with my recent pull request, the bool op LPE should work properly.
A few notes / questions:
1.) The operand (other) path is not made invisible. I typically have my operand paths in an invisible layer. Is this ok, or should the bool op LPE make the operand path invisible? If so, I wonder how this could be done. The main problem is that I have no idea how I could re-enable the operand path when the bool op LPE is disabled (with the eye button in the bool op list). As far as I can tell, the bool-op code doesn't run at all when the bool-op is disabled, only when it is enabled.
Or should I change the bool op so that it works on groups of paths (as created with Ctrl+K)? This would obviously solve the problem, but then I would need a grouping LPE, because one of my operand paths is typically a result of an LPE stack, while the other isn't
2.) The cut boolops only make sense if one path is an open path and one path is a closed path. Should I disable the cut options, if this is not the case? How can I detect this?
3.) The LPE only works on paths, not on objects. Is this ok? I guess this is the case for all LPE.
4.) The LPE has options for the fill type (odd-even, non-zero, positive). For the operand path (the other path) I can find out the inherent fill type of the path. The problem is somehow that the fill type is stored in SPItem objects, but the LPEs operator on SPCurve. The closest point upstream in the call stack is SPLPEItem::performPathEffect, but the SpItem is not passed down the the specific LPE code. Any ideas?
Btw.: fill type negative would be nice to have.
Best regards,
Michael
Hi Michael:
On Sun, 2017-06-11 at 16:47 +0200, Michael Soegtrop via Inkscape-devel wrote:
Dear Inkscape Team,
with my recent pull request, the bool op LPE should work properly.
merged
A few notes / questions:
1.) The operand (other) path is not made invisible. I typically have my operand paths in an invisible layer. Is this ok, or should the bool op LPE make the operand path invisible? If so, I wonder how this could be done. The main problem is that I have no idea how I could re-enable the operand path when the bool op LPE is disabled (with the eye button in the bool op list). As far as I can tell, the bool-op code doesn't run at all when the bool-op is disabled, only when it is enabled.
I could help you about this there is a LPE function called doOnVisibilityToggled can be addded to any LPE. Uou also can acces to the "Other" SPObject from the path parameter variable and the function pathparam.getObject(). and you can cast to a SPItem to set visible or not. I think you realy need the LPE work itselff as most of posible fully whithout hacks to explain line hide a leyer to view the effect, but this is my opinion.
Or should I change the bool op so that it works on groups of paths (as created with Ctrl+K)? This would obviously solve the problem, but then I would need a grouping LPE, because one of my operand paths is typically a result of an LPE stack, while the other isn't
Is a cool adition the LPE work in shapes and groups, anyway the "operator" could be a path or a item if you change the pathparameter to a item parameter like in clone LPE. Anyway I think in paths, with subpaths if posibol is enought
2.) The cut boolops only make sense if one path is an open path and one path is a closed path. Should I disable the cut options, if this is not the case? How can I detect this?
pathvector.isClosed() or similar. One cuestion how handle selfintersections?
3.) The LPE only works on paths, not on objects. Is this ok? I guess this is the case for all LPE.
LPE works in paths, shapes and groups but not all. Maybe in the future we can add text and bitmaps
4.) The LPE has options for the fill type (odd-even, non-zero, positive). For the operand path (the other path) I can find out the inherent fill type of the path. The problem is somehow that the fill type is stored in SPItem objects, but the LPEs operator on SPCurve. The closest point upstream in the call stack is SPLPEItem::performPathEffect, but the SpItem is not passed down the the specific LPE code. Any ideas?
Btw.: fill type negative would be nice to have.
You can use "SPItem * item = sp_lpe_item;" for the whole LPE item in most parts of LPE code. Also if your plan is working with groups you have: SPShape * shape = sp_shape; that change in the effect cycle to current effected shaped.
Best regards,
Ping me if you need anything more. Is great work with you.
Cheers, Jabier.
Michael
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Dear Jabier,
thanks for your hints! I managed to set the operand path visibility in doEffect, doOnVisibilityToggled, doOnRemove.
A few questions remain:
1.) I wanted to make the operand path initially invisible in doOnApply, but there the operand path is not yet set. Is there a way to get a notification when the operand path is set? I do this now in doEffect which works, but is not terribly nice, especially together with 4.)
2.) I saw that some of your LPEs call "processObjects(LPE_VISIBILITY)" in doOnVisibilityToggled and similar function in other callbacks. What is the purpose of this? Should I do this in the boolop LPE as well?
3.) I use setExplicitlyHidden(true) to hide the operand path, but I am not sure if this is the best method. I also tried setEvaluated, but it didn't work.
4.) It is possible that the operand path is already invisible when I set the bool LPE. The bool LPE sets the operand path to visible when it is removed. It would be nicer to reset the operand paths original visibility state in this situation, but then I would have to remember it. Of cause not much of an issue, but then I should possibly also serialize it? What do you think? Just ignore this (probably would break undo), store the original state in the LPE object - lost when file is saved and reloaded or somehow serialize in SVG?
5.) Should I add on option (true by default) to make the operand path invisible?
6.) I saw the keep_paths option in removeCurrentPathEffect and also how it is implemented in your LPEs. But I couldn't find the UI for it.
Best regards,
Michael
participants (2)
-
Jabier Arraiza
-
Michael Soegtrop