Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template selection sets #2332

Open
dl3sdo opened this issue Feb 4, 2025 · 6 comments · May be fixed by #2333
Open

Template selection sets #2332

dl3sdo opened this issue Feb 4, 2025 · 6 comments · May be fixed by #2333

Comments

@dl3sdo
Copy link
Member

dl3sdo commented Feb 4, 2025

When using a larger number of templates, I consider it beneficial to have multiple sets of template settings which disable or enable a group of templates by a single mouse click especially if a hill shading image or aerial photo is split in multiple images:

Demo1.mp4

The current state is a Proof of Concept:

  • The code needs refactoring (encapsulation, naming of functions and variables, documentation)
  • Tests need to be added
  • It's currently focusing on the desktop version
  • It's needs to be discussed whether changing between template selections sets shall be possible by a key (e.g., use F4 instead for Overprinting simulation) or by extending the wheel menu
  • Icons different from those used for adding and removing templates itself

Nevertheless, it's fully working (although no guarantee of having no errors or even crashing Mapper):

  • Templates selection sets can be saved to and loaded from a map
  • Templates selection are stored such that the first set is stored as today, the remaining sets are stored in a separate structure which is silently ignored when loading from a Mapper version which does not yet support templates selection sets => maps are fully backward compatible.

See also #118, #534, #1185, #2242

dl3sdo added a commit to dl3sdo/mapper that referenced this issue Feb 4, 2025
Template selection sets allow to easily switch between different sets
of visibilities for the map and templates.
Template selection sets are saved to and loaded from the map file in
a backward compatible way.

Closes OpenOrienteering#2332 (Template selection sets).
dl3sdo added a commit to dl3sdo/mapper that referenced this issue Feb 4, 2025
Template selection sets allow to easily switch between different sets
of visibilities for the map and templates.
Template selection sets are saved to and loaded from the map file in
a backward compatible way.

Closes OpenOrienteering#2332 (Template selection sets).
@dl3sdo dl3sdo linked a pull request Feb 4, 2025 that will close this issue
@mlerjen
Copy link
Contributor

mlerjen commented Feb 5, 2025

Wow! Very nice!

@dl3sdo
Copy link
Member Author

dl3sdo commented Feb 9, 2025

Please test the current build.
Your feedback will help to improve and merge this feature.

@mlerjen
Copy link
Contributor

mlerjen commented Feb 10, 2025

@dl3sdo: I tested the current build. Love it! That is a very powerful move as it largely reduces the (painful) click-amount for users with several different templates. Up to nine presets, that is luxury. :-)

Some oberservations:

  1. I defined my first set and intend to make a second one. If I press +, a second set is added, but the focus remains on the first. Wouldn't it be more logical, the focus switched to the new one?
  2. I notice that a set even preserves the opacitiy of a template in the according set. Now if I changed the template order position in one set, it changes to the new position for all other sets too. I see that could be complicated to handle but is the current behaviour consistent? You now can change existant sets while modifying a new one?
  3. Last but not least, as @puzzlepaint already mentioned in Template configurations #118 the functionality would of course unfold even more if the defined sets here addressable by some sort of shortcut. Either a directly adressing key e.g. Alt & 1, a key to loop through the sets or some buttons in tool or bottom bar or a list in the Template dropdown menu? What are your thoughts on that?

All in all: Great and Thanks.

@dl3sdo
Copy link
Member Author

dl3sdo commented Feb 12, 2025

Thank you @mlerjen, your feedback is motivating and inspiring me.

Regarding your observations:

  1. You are right, I added a commit today that leads to switching to the added template set.
  2. Indeed, the mechanism does not really provide fully independent template sets, it are really template visibility sets. To make it fully independent such that you can have any set and order of templates in a set requires fundamental changes.
    Mapper stores templates, their name and placement etc. independent from the visibility information. The visibility information for each template just points to the template. If you move templates up and down this does not change the visibility structure as the order is stored in the template structure.
    For a full independence also the template structure needs to replicated not just because of the order of templates but due to the fact that the placement of the same template file could be different in different template sets.
    It's certainly doable but requires much more effort than the current (limited) approach.
  3. I would like to start by using F4 for example to step up through the different templates sets. For two that is the same as switching and even for three that seems acceptable.
    I'm not sure whether Alt + key is available on all platforms, Mapper seems not to use the Alt + key combination.
    The wheel menu which I proposed to directly select symbols could also include the selection of templates sets.
    How many templates sets would you consider as being useful?

@mlerjen
Copy link
Contributor

mlerjen commented Feb 13, 2025

@dl3sdo

  1. Great!
  2. I do not see a direct use case atm. If one really needs different orders he/she could consider working with duplicate templates. I just wonder if we can leave it as it is, or whether there would be a need to alert in case one had at least two sets to work with. Kind like "Changing the order of the templates will be effective in all sets" ??
  3. I think a way to loop through will do. For those with many sets F4 counting up and something like ctrl&F4 counting down might be extra useful. Crucial is that passing by a set, you don't want, should not take to long.
    As for the wheel menu: One might guess usually three sets might cover 95% of the needs. But that brings something to my mind I mentioned (years) earlier, The question is if it would be possible to get an alternate wheel with ctrl&rightclick? Let's say one that opens a direct way to every of the max. nine possible sets? :-)

@dl3sdo
Copy link
Member Author

dl3sdo commented Feb 18, 2025

@mlerjen: I now use F4 to step through the templates sets. Once the templates are loaded, switching appears to be fast enough, but that may be different in real mapping scenarios.
Please give it a try and provide feedback, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants