Yes this is a problem I found. We would have to create our own implementation to allow per edge changes.abdullah wrote:SoLineSet, totally covers the previous segment, not only for selection, but also for visualisation). I tried adding transparency, but it is disabled for sketcher,
Code: Select all
Code: Select all
ui->listWidgetElements->item(i)->setIcon(element == 0 ? edge : element == 1 ? sp : element == 2 ? ep : mp);
abdullah wrote:I want to show you a widget I did for the Sketcher WB, in order to allow editing of sketches when they have (partially) overlapping lines of any type (construction/external/normal).
Just thought I'd mention that maybe this resolves Mantis issue #0693 and / or issue #0930 before I forget...abdullah wrote:I was having a problem with not being able to select overlapping lines (construction lines on construction lines, handy for example for making factors of the pitch of a thread). I remember someone (Ulrich1a?) opened a ticket for this in Mantis.
Thanks. I really have no problem with critiques. Just make all the remarks that come to your mind.I'm yet to try it, but firstly a good effort taking up a long needed task on the Sketcher which has been fairly dormant for a year now. It's a great way to learn/practice c++ coding and is how I first began with alot of advice and critique from logari.
Yes you gather well, that is exactly what the code does. IMHO, that a line in a SoLineSet covers a previous line at the same distance/position from the camera is not a bug. The Inventor implementation would have to choose one of the lines, and choosing the last one is just one possible solution.Yes this is a problem I found. We would have to create our own implementation to allow per edge changes. I'm trying to see what you've done in ViewProviderSketch. Im gathering you iterate through the edges and any that are selected has their z-value raised? I suppose this in practice is fine, but doesn't fix our z fighting issue.
Sorry I do not understand what you are referring to, that line is blank on my ViewProviderSketch.cpp and nothing around it refers to an objectAlso on ViewProviderSketch: line 2623 I think you need to use *it->x?
Code: Select all
There are three macros, motivated mainly to be consistent with the first of them, which must generate diffently named objects for each qaction. If you (plural) think I should not use macros for this, please let me know about FreeCADs macro policy. I will use the shell to expand it to normal code.In TaskSketcherElements.cpp you use a macro. I'm just wondering generally in FreeCAD if we are fine to use macros? I just don't tend to see them often.
To be honest with you, I did not know qobject_cast existed, and to be even more honest, I had to look up static and dynamic cast macro templates myself, as before that I only knew the standard C style cast (). The reason I used static_cast is because in the constraints part is used so.Not that it makes much difference, instead of a static_cast because ElementItem is a QListWidgetItem it's derived from a QObject so you can use qobject_cast.
Certainly. I know I have this problem with that specific operator. It is a long standing mispractice and I am trying to correct it, but because I am used to see it together I do not always realise. Another one I have is just putting the opening curly brace on a next empty line. I try to correct them. I general if you see in commited FreeCAD code one of those made by me do not hesitate to correct it for readibility.To help improve readability can you try to use spaces throughout?
Yes and no. So, yes there is a reason, but not a valid one, I wanted them not be mixed up with constraints (generally in red). However, the whole theme of sketcher is redish and I can only agree with you that red would make a much clearer constrast. You are totally right.1) Icons
Just a little thing, the three different icons are, in my opinion, too difficult to differentiate at the low resolution at which they are displayed in the taskview. Is there any reason why you have changed the colour scheme so that they do not match the "red dots" on the end of the lines in other sketcher icons? Off the top of my head, I would have thought the green (selection colour - a good idea) would be much clearer in contrast with the standard red. I can create some alternatives, .....if you want me to.
I was totally unaware of that remark on the type of green. I tried to do my best by selecting the same palette that is suggested in the art documentation page. I also took care that the light comes from the top left. But I really agree with you. Making icons (or modifying icons) is not something that I do right.By the way, it might also be a good idea for consistency to use the same green I used in the sketch profile Hexagon icon. The idea behind that green was to imply the default "selection" green, but to differentiate it from the green we use to for Mesh item icons.
Please bring forward some nice ones!!I can create some alternatives, .....if you want me to
I understand it can be misleading to a certain point, but that was at least the initially intended behaviour. The reason is that this way, when you press shift you do not get "transported" to another object, but just iterate through the elements of the same object that was preselected.2) Element types I am not sure exactly what to suggest here, but the way it works at the moment is that items are still offered in the list even when the selection/element "type" is invalid. E.g. circle start and end point, point end or centre point, line centre point. I wonder if only elements with a valid selection of that type should be shown? Although that might also get confusing, I am not sure.
Ohh!!... Let me check... yes definitely!!, that is not the intended behaviour, you found another bug!!! I will try to fix it today.Another thing currently the appropriate item is set to preselect colour as you hover the mouse over the list....that seems like a good idea, however the pre-selection is not cleared if the you hover the mouse over the next item in the list if it is invalid for the "type" selected, which can be potentially confusing.
That was the whole point of it...I like that this allows one to select an item that previously we could not select, like a line on another line.
Well, I do not know to what extend it really "solves" them. I mean, you still can not select the overlapped lines in the Inventor view.Just thought I'd mention that maybe this resolves Mantis issue #0693 and / or issue #0930 before I forget...
I only came up with that colour scheme idea about 2 weeks ago, when I suggested some icons for the sketcher profiles that Jurgen and Werner made.abdullah wrote:I was totally unaware of that remark on the type of green. I tried to do my best by selecting the same palette that is suggested in the art documentation page.
I had already made some...here they are... But really you don't have to accept these they are just my first thoughts.abdullah wrote:jmaustpc wrote: I can create some alternatives, .....if you want me to
Please bring forward some nice ones!!