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(_T (
"/Settings/GlobalState" ));
83 conf->Read(_T (
"bShowLightDescription" ), &bShowENCLightDescriptions, 1);
84 conf->Read(_T (
"nDisplayCategory" ), &nENCDisplayCategory,
86 conf->Read(_T (
"bShowSoundg" ), &bShowENCDepths, 1);
87 conf->Read(_T (
"bShowAtonText" ), &bShowENCBuoyLabels, 0);
88 bShowENCLights =
true;
89 bShowENCVisibleSectorLights =
false;
90 bShowENCAnchorInfo =
false;
91 bShowENCDataQuality =
false;
93 conf->SetPath(_T (
"/Settings/AIS" ));
94 conf->Read(_T (
"bShowScaledTargets" ), &
bAttenAIS, 0);
96 conf->SetPath(_T (
"/Settings" ));
99 conf->Read(_T (
"CourseUpMode" ), &
bCourseUp, 0);
100 conf->Read(_T (
"HeadUpMode" ), &
bHeadUp, 0);
101 conf->Read(_T (
"LookAheadMode" ), &
bLookahead, 0);
103 conf->Read(_T (
"ShowGrid" ), &
bShowGrid, 0);
106 conf->Read(_T (
"ChartQuilting" ), &
bQuilt, 1);
108 conf->Read(_T (
"ActiveChartGroup" ), &GroupID, 0);
109 conf->Read(_T (
"InitialdBIndex" ), &DBindex, -1);
111 conf->SetPath(_T (
"/Settings/GlobalState" ));
113 double st_view_scale, st_rotation;
114 if (conf->Read(wxString(_T (
"VPScale" )), &st)) {
115 sscanf(st.mb_str(wxConvUTF8),
"%lf", &st_view_scale);
117 st_view_scale = fmax(st_view_scale, .001 / 32);
118 st_view_scale = fmin(st_view_scale, 4);
122 if (conf->Read(wxString(_T (
"VPRotation" )), &st)) {
123 sscanf(st.mb_str(wxConvUTF8),
"%lf", &st_rotation);
125 st_rotation = fmin(st_rotation, 360);
126 st_rotation = fmax(st_rotation, 0);
132 if (conf->Read(_T (
"VPLatLon" ), &sll)) {
133 sscanf(sll.mb_str(wxConvUTF8),
"%lf,%lf", &lat, &lon);
136 if (fabs(lon) < 360.) {
137 while (lon < -180.) lon += 360.;
139 while (lon > 180.) lon -= 360.;
144 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.