39#define PI 3.1415926535897931160E0
46canvasConfig::canvasConfig(
int index) {
56canvasConfig::~canvasConfig() {}
68 nENCDisplayCategory = (int)(
enum _DisCat)OTHER;
69 bShowENCDataQuality = 0;
70 bShowENCBuoyLabels = 0;
71 bShowENCLightDescriptions = 1;
74void canvasConfig::LoadFromLegacyConfig(wxConfigBase *conf) {
81 conf->SetPath(
"/Settings/GlobalState");
83 conf->Read(
"bShowLightDescription", &bShowENCLightDescriptions, 1);
84 conf->Read(
"nDisplayCategory", &nENCDisplayCategory, (
enum _DisCat)OTHER);
85 conf->Read(
"bShowSoundg", &bShowENCDepths, 1);
86 conf->Read(
"bShowAtonText", &bShowENCBuoyLabels, 0);
87 bShowENCLights =
true;
88 bShowENCVisibleSectorLights =
false;
89 bShowENCAnchorInfo =
false;
90 bShowENCDataQuality =
false;
92 conf->SetPath(
"/Settings/AIS");
93 conf->Read(
"bShowScaledTargets", &
bAttenAIS, 0);
95 conf->SetPath(
"/Settings");
98 conf->Read(
"CourseUpMode", &
bCourseUp, 0);
99 conf->Read(
"HeadUpMode", &
bHeadUp, 0);
105 conf->Read(
"ChartQuilting", &
bQuilt, 1);
107 conf->Read(
"ActiveChartGroup", &GroupID, 0);
108 conf->Read(
"InitialdBIndex", &DBindex, -1);
110 conf->SetPath(
"/Settings/GlobalState");
112 double st_view_scale, st_rotation;
113 if (conf->Read(wxString(
"VPScale"), &st)) {
114 sscanf(st.mb_str(wxConvUTF8),
"%lf", &st_view_scale);
116 st_view_scale = fmax(st_view_scale, .001 / 32);
117 st_view_scale = fmin(st_view_scale, 4);
121 if (conf->Read(wxString(
"VPRotation"), &st)) {
122 sscanf(st.mb_str(wxConvUTF8),
"%lf", &st_rotation);
124 st_rotation = fmin(st_rotation, 360);
125 st_rotation = fmax(st_rotation, 0);
131 if (conf->Read(
"VPLatLon", &sll)) {
132 sscanf(sll.mb_str(wxConvUTF8),
"%lf,%lf", &lat, &lon);
135 if (fabs(lon) < 360.) {
136 while (lon < -180.) lon += 360.;
138 while (lon > 180.) lon -= 360.;
143 if (fabs(lat) < 90.0)
iLat = lat;
Chart canvas configuration state
double iLat
Latitude of the center of the chart, in degrees.
bool bShowOutlines
Display chart outlines.
void Reset()
Resets all configuration options to default values.
bool bShowDepthUnits
Display depth unit indicators.
double iLon
Longitude of the center of the chart, in degrees.
double iRotation
Initial rotation angle in radians.
bool bCourseUp
Orient display to course up.
bool bQuilt
Enable chart quilting.
bool bFollow
Enable vessel following mode.
double iScale
Initial chart scale factor.
bool bShowENCText
Display ENC text elements.
bool bShowAIS
Display AIS targets.
bool bShowGrid
Display coordinate grid.
ChartCanvas * canvas
Pointer to associated chart canvas.
bool bShowCurrents
Display current information.
bool bShowTides
Display tide information.
bool bLookahead
Enable lookahead mode.
bool bHeadUp
Orient display to heading up.
bool bAttenAIS
Enable AIS target attenuation.