12 #ifndef LINKGRAPH_GUI_H 13 #define LINKGRAPH_GUI_H 15 #include "../company_func.h" 16 #include "../station_base.h" 17 #include "../widget_type.h" 18 #include "../window_gui.h" 41 typedef std::map<StationID, LinkProperties> StationLinkMap;
42 typedef std::map<StationID, StationLinkMap> LinkMap;
43 typedef std::vector<std::pair<StationID, uint> > StationSupplyList;
45 static const uint8 LINK_COLOURS[];
56 window(w), widget_id(wid), cargo_mask(cargo_mask), company_mask(company_mask), scale(scale)
60 void SetCargoMask(CargoTypes cargo_mask);
61 void SetCompanyMask(uint32 company_mask);
93 static void AddStats(uint new_cap, uint new_usg, uint new_flow,
bool new_shared,
LinkProperties &cargo);
94 static void DrawVertex(
int x,
int y,
int size,
int colour,
int border_colour);
108 virtual void DrawWidget(
const Rect &r,
int widget)
const;
109 virtual bool OnTooltip(
Point pt,
int widget, TooltipCloseCondition close_cond);
110 virtual void OnClick(
Point pt,
int widget,
int click_count);
111 virtual void OnInvalidateData(
int data = 0,
bool gui_scope =
true);
116 void UpdateOverlayCompanies();
117 void UpdateOverlayCargoes();
Properties of a link between two stations.
Data about how and where to blit pixels.
Some typedefs for the main game.
LinkMap cached_links
Cache for links to reduce recalculation.
uint32 GetCompanyMask()
Get a bitmask of the currently shown companies.
High level window description.
uint usage
Actual usage of the link.
void ShowLinkGraphLegend()
Open a link graph legend window.
Menu window to select cargoes and companies to show in a link graph overlay.
uint scale
Width of link lines.
Data structure for an opened window.
bool shared
If this is a shared link to be drawn dashed.
LinkGraphOverlay(const Window *w, uint wid, CargoTypes cargo_mask, uint32 company_mask, uint scale)
Create a link graph overlay for the specified window.
const uint widget_id
ID of Widget in Window to be drawn to.
bool dirty
Set if overlay should be rebuilt.
uint32 company_mask
Bitmask of companies to be displayed.
const Window * window
Window to be drawn into.
CargoTypes cargo_mask
Bitmask of cargos to be displayed.
Coordinates of a point in 2D.
uint capacity
Capacity of the link.
Specification of a rectangle with absolute coordinates of all edges.
void SetDirty()
Mark the linkgraph dirty to be rebuilt next time Draw() is called.
CargoTypes GetCargoMask()
Get a bitmask of the currently shown cargoes.
Dimensions (a width and height) of a rectangle in 2D.
Handles drawing of links into some window.
uint planned
Planned usage of the link.
StationSupplyList cached_stations
Cache for stations to be drawn.