I had an interesting conversations on the irc over the weekend on this polyline stuff.. Never did make it fishing though, wound up cleaning up the yard and help the daughter capture butterflies (catch and release) instead.
So I need to clump everything together and see if I can make sense of it and form an action plan here.
Ok let me do my gtd thing here:.. Lets define success/completion of the goal as being able to draw an arc while in polyline mode and having it loaded into the freecad code trunk..
Now there are a couple of ways of doing this. One suggestion was to toggle between the “A” and the “L” and then either draw lines or arc’s.
My preference would be that arcs would be drawn when the “A” is depressed and lines when not. Another suggestion was to use the shift as it is on the other side of the keyboard. In sort, it looks like people would have their own preferred keystroke method of getting the desired arc out of the polyline. What I get out of this is that decision to either draw the arc or line wouldn’t be based on the keydown/keyup state of the “A” The foundations for future user definable keystrokes should be laid but implementation doesn’t design success for this undertaking…
Individual Keystate status/Next step:
My understanding(which since I’m a newbie at this software could easily be wrong) is the keyup/keydown individual keys is currently not stored. It appears that this might come in handy for things beyond the polyline. The suggestion as been made implement the keystroke status that I understand as follows:
Create a new method register_keypress, within DrawSketchHandlerDone
edit->sketchHandler.register_pressed_key(key) will be used to set the Mode Flag
(I need to dissect Mode flag functionality, since I’ve seen it in code, but I don’t understand it’s intent and functionality at this point.Done The keypress registration will be set in a ViewProviderSketch::keyPressed event.(Done) The keypress status for a key will be read through the mode flagDone..Not exactly this way
It appears the all keystate status needs to be trapped for uses beyond polyline-arc use. No… not going that route.
After the setting/getting individual keypress status out of the way major steps to this will be:
Key State translation
At some point, during a mouse move, the determination needs to be made if any keys are down what does it mean.
So.. Just thinking out loud here for possible methods. This needs to be hashed out once the Keystates are in place
bool AllKeysUp? I t seems to me something like this would be handy. Not going that route
If I’m in polyline mode, what does this keydown state designate, should I draw a line or arc or??(not for this design iteration)
(logari81 had thought that the line or arc mode within polyline could be made sticky).. His thoughts where pressing L or A to toggle between Line or Arc. Just a thought here but perhaps, Shift-L or Shirt-R could denote stickyness
(bool) IsStickyEnabled or something along that line.
Implementing the desired effect on the screen
mouseMove [3-28.. Did some quick testing within the mouse move to test if the A was depressed… Seems to be working..]
If the arc key is down need to display an arc, if not it needs to display a line.
This should be fun to implement. My understand is that at this point a OCC line or arc does not exist yet, but exist in coin. Devil in the details on that , I haven’t dug yet on that one.
This is create the OCC line or Arc Object
This will create a new coin line or arc.
Figuring out this git stuff
a project unto its own.