Sure thing - I wasn't too sure what you were working on but sounds good. Experimenting is good as you get to delve further into FreeCAD. I don't think my focus is really on the UI details like this, rather than on the underlying tools.j-dowsett wrote:So I've only had a little time to spend on the template selection side of things so far. It's also going to be slow as this involves interacting more with bits of FreeCAD that I've not worked with before. I have a github repo here https://github.com/j-dowsett/FreeCAD.git and the branch templates_menu_working is what I've got so far - this is definitely not for users, right now it's much more of an experimentation branch, but you're welcome to look Luke (or anyone else as long as you don't expect it to do anything!). [really, this is effectively just a local branch, but that i have on github as I'm working on two computers].
In reality all it has so far is a Drawing preferences page, two preferences for ortho_views that (without yet properly being tested...) appear to work. The preferences page also has two preferences for the not-yet-existent template selection dialog - these currently do nothing (not even save the preference). Oh, I have added an 'All templates...' menu item, but haven't connected it up properly yet, I think there might also be a first approximation dialog .ui file in there, but that's definitely not connected to anything, not in any makefiles etc yet.
It really is more still me experimenting with the different things that might come togethor to give something along the lines of this, thinking that I'd get that skeleton function in place before coming back here to finalise whether to have tabs in the dialog for MRU or favourites or whatever. I'll carry on in this experimental / learning vein as time allows, but if you want to work on this too then please do - if anything is going to get into 0.14 then I think it's much more likely to come from you!
Well that might be a bit of a winner of an idea.j-dowsett wrote:I'd vaguely had the same thought after finally catching up with a couple of things Luke had said in the same regard. In the short term I'd hoped to simply play with python a little bit and try to get it to create a template of a given size, with a given margin and number of border intervals(? - ie the A, B, C... 1,2,3... bits) and with a given titleblock in a given corner... of course I've yet to manage to put any time into this, and think I'll be looking at the C++ stuff above first.
Stuff like this seems better to be programmed with an interpreted language as it soon becomes messy with c++ when many options are presented. The problem is I'm terrible with python but I can build up the c++ infrastructure to deal with this.
What I'm thinking is the canvas has python methods to draw onto the background behind the views with other template logic for managing the title block size and position but not necessarily calculating it - this is needed e.g. for your ortho-view calculations.
A python class will be given a template file of some format - maybe xml / python for which contains basic template parameters such border position, thickness etc. This python class then draws these using methods on the canvas which I can provide in my Canvas View. We can also provide the option for user defined drawing methods.
Using an abstraction like this means the template drawing data can be interpreted into other formats whether .svg , .dxf, .dwg
Using python functionality would mean someone else could get involved and help reduce the workload for us too. What do people think?