Bridges-C++ 3.5.0-dev1
Bridges(C++ API)
Loading...
Searching...
No Matches
Country.h
Go to the documentation of this file.
1#ifndef COUNTRY_H
2#define COUNTRY_H
3
4#include "../Color.h"
5
6#include <string>
7#include <unordered_map>
8
9using std::string;
10
11
12namespace bridges {
13 namespace dataset {
14 /*
15 * @brief This object stores a Country and links to information
16 *
17 * This object is used alongside with the WorldMap object. Each country
18 * has a stroke color and fill color.
19 *
20 * See tutorial at https://bridgesuncc.github.io/tutorials/Map.html
21 *
22 * @author Kalpathi Subramanian, Erik Saule
23 * @date Last modified May 22, 2025
24 */
25 class Country {
26 string name; // country name
27 string alpha2_id; // two letter alphabetic id
28 string alpha3_id; // three letter alphabetic id
29 int numeric3_id; // numerical id
30 datastructure::Color fill_color; // fill color of country
31 datastructure::Color stroke_color; // boundary color
32 float stroke_width; // boundary width
33
34 public:
38 Country() = default;
39
45 Country(string cntry) {
46 name = cntry;
47 alpha2_id = "";
48 alpha3_id = "";
49 numeric3_id = 0;
50 stroke_color = datastructure::Color("green");
51 stroke_width = 1.;
52 fill_color = datastructure::Color("lightblue");
53 }
54
66 Country (string cntry, string alpha2, string alpha3, int numeric,
67 datastructure::Color fill_col, datastructure::Color stroke_col,
68 float stroke_w) {
69 name = cntry;
70 alpha2_id = alpha2;
71 alpha3_id = alpha3;
72 numeric3_id = numeric;
73 fill_color = fill_col;
74 stroke_color = stroke_col;
75 stroke_width = stroke_w;
76 }
77
81 string getCountryName() const {
82 return name;
83 }
84 void setCountryName(string n) {
85 name = n;
86 }
87 string getAlpha2Id() const {
88 return alpha2_id;
89 }
90 void setAlpha2Id(string id) {
91 alpha2_id = id;
92 }
93 string getAlpha3Id() const {
94 return alpha3_id;
95 }
96 void setAlpha3Id(string id) {
97 alpha3_id = id;
98 }
99 int getNumeric3Id() const {
100 return numeric3_id;
101 }
102 void setNumeric3Id(int id) {
103 numeric3_id = id;
104 }
106 return stroke_color;
107 }
109 stroke_color = c;
110 }
111
113 return fill_color;
114 }
116 fill_color = c;
117 }
118
119 float getStrokeWidth() const {
120 return stroke_width;
121 }
122 void setStrokeWidth(float width) {
123 stroke_width = width;
124 }
125 };
126 };
127};
128#endif
Definition Country.h:25
void setNumeric3Id(int id)
Definition Country.h:102
string getAlpha2Id() const
Definition Country.h:87
void setStrokeColor(datastructure::Color c)
Definition Country.h:108
datastructure::Color getFillColor() const
Definition Country.h:112
string getCountryName() const
getters, setters for class
Definition Country.h:81
Country()=default
constructors
Country(string cntry)
creates a country object for a specific country
Definition Country.h:45
string getAlpha3Id() const
Definition Country.h:93
Country(string cntry, string alpha2, string alpha3, int numeric, datastructure::Color fill_col, datastructure::Color stroke_col, float stroke_w)
creates a country object with specific parameters
Definition Country.h:66
void setAlpha3Id(string id)
Definition Country.h:96
void setAlpha2Id(string id)
Definition Country.h:90
int getNumeric3Id() const
Definition Country.h:99
datastructure::Color getStrokeColor() const
Definition Country.h:105
void setStrokeWidth(float width)
Definition Country.h:122
float getStrokeWidth() const
Definition Country.h:119
void setFillColor(datastructure::Color c)
Definition Country.h:115
void setCountryName(string n)
Definition Country.h:84
This class represents Color, and supports rgba, hexadecimal and named color values.
Definition Color.h:50
Support for drawing Bar charts.
Definition alltypes.h:4