pioneerspacesim/pioneer — pull request #1754 by skapusniak (2012-11-24 20:28:06+00:00)
Title: Sector View with zoom-out to far distances for better faction viewing

This implements a second level of zoom that kicks in after you zoom out beyond the current limit, allowing you to see the extent of the Factions on the map with their home systems labeled. I think it satisfies the request to show the Federal and Empire (Red) regions that is part of #1735

Fps on my -- pretty beefy -- windows machine ~340 at max zoom in Far view (dipping to ~150 zooming out using the scroll wheel as fast as possible), compared to ~140fps in Near view (dipping to 90 when panning). Rotation causes no frame rate changes, panning causes some dip below ~300fps as new sectors are retrieved.

Zoomed out near the new limit centred on Achernar:
![Zoomed out, centred on Achernar, with CIS & Independent hidden](http://i.imgur.com/JIUWB.png)

**Features**

- Far/Extended zoom out to > ~175 ly from the centre of view, to show a sphere of systems up to ~175 ly in radius.
- All systems in Far view are rendered as points in the their Faction colour.
- The usual rotate and pan controls are available in Far view however you cannot select most individual systems by clicking (see next item).
- In Far view, if a Faction's home system is within the sphere of systems, it will be labeled with the system name and the Faction name. These have the same effects on click (but without the animation) as system labels do in Near view.
- TAB now cycles between the existing info panel, showing no panel, and a new panel allowing you to toggle the display of Factions in the current view. If the Faction is toggled off, all systems and labels for it will be hidden. (I recommend you usually have 'Independent' toggled off for best effect). This new panel works in both Far and Near view.
- A zoom level indicator next to the zoom buttons, expressed light years from the centre of view to the camera (in Near view) or edge of the sphere of stars shown (in Far view).
- Faction home systems will no longer be marked as unexplored.
- Faction home systems now always get a name rather than catalogue number.
- Faction home systems that are populated will have large populations (Faction home systems that are unpopulated remain unpopulated, rats!).

**Accidental Features**

- The system 'Bean' turns out be the home system for both the Stellar Republic and the Inner Territories. The Inner Territories are indeed wholly enclosed within by the Stellar Republic. The label has it's text in Inner Territories colour, whilst it's clickable diamond symbol is in Stellar Republic colour.

**Requires & Incorporates**

- (#1675) Script for autogeneration of Factions.
- (#1660) Refactoring of Faction distance/colour retrieval code for SectorView.
- (#1621) Allow multiple government types to be added to Factions
- Yes, this is why the commit list is currently stupidly long for this PR.

**Know Bugs**

- Some (very few) Faction names get split across two lines in the Faction toggle panel for no obvious reason -- other names are longer. This also happens in the info view so I don't think it's specific to my code.
- The radius of the sphere of systems is ~4 light years greater than is shown by the zoom level indicator when at the maximum zoom level.

**Future Investigation**

- It might be possible to improving panning in far view, by doing a secondary culling pass in the vertex and color arrays for the points.