26#include <wx/fileconf.h>
28#include "CanvasConfig.h"
35#define PI 3.1415926535897931160E0
42canvasConfig::canvasConfig(
int index) {
52canvasConfig::~canvasConfig() {}
64 nENCDisplayCategory = (int)(
enum _DisCat)STANDARD;
67void canvasConfig::LoadFromLegacyConfig(wxFileConfig *conf) {
74 conf->SetPath(_T (
"/Settings/GlobalState" ));
76 conf->Read(_T (
"bShowLightDescription" ), &bShowENCLightDescriptions, 0);
77 conf->Read(_T (
"nDisplayCategory" ), &nENCDisplayCategory,
78 (
enum _DisCat)STANDARD);
79 conf->Read(_T (
"bShowSoundg" ), &bShowENCDepths, 1);
80 conf->Read(_T (
"bShowAtonText" ), &bShowENCBuoyLabels, 1);
81 bShowENCLights =
true;
83 conf->SetPath(_T (
"/Settings/AIS" ));
84 conf->Read(_T (
"bShowScaledTargets" ), &
bAttenAIS, 0);
86 conf->SetPath(_T (
"/Settings" ));
89 conf->Read(_T (
"CourseUpMode" ), &
bCourseUp, 0);
90 conf->Read(_T (
"HeadUpMode" ), &
bHeadUp, 0);
91 conf->Read(_T (
"LookAheadMode" ), &
bLookahead, 0);
93 conf->Read(_T (
"ShowGrid" ), &
bShowGrid, 0);
96 conf->Read(_T (
"ChartQuilting" ), &
bQuilt, 1);
98 conf->Read(_T (
"ActiveChartGroup" ), &GroupID, 0);
99 conf->Read(_T (
"InitialdBIndex" ), &DBindex, -1);
101 conf->SetPath(_T (
"/Settings/GlobalState" ));
103 double st_view_scale, st_rotation;
104 if (conf->Read(wxString(_T (
"VPScale" )), &st)) {
105 sscanf(st.mb_str(wxConvUTF8),
"%lf", &st_view_scale);
107 st_view_scale = fmax(st_view_scale, .001 / 32);
108 st_view_scale = fmin(st_view_scale, 4);
112 if (conf->Read(wxString(_T (
"VPRotation" )), &st)) {
113 sscanf(st.mb_str(wxConvUTF8),
"%lf", &st_rotation);
115 st_rotation = fmin(st_rotation, 360);
116 st_rotation = fmax(st_rotation, 0);
122 if (conf->Read(_T (
"VPLatLon" ), &sll)) {
123 sscanf(sll.mb_str(wxConvUTF8),
"%lf,%lf", &lat, &lon);
126 if (fabs(lon) < 360.) {
127 while (lon < -180.) lon += 360.;
129 while (lon > 180.) lon -= 360.;
134 if (fabs(lat) < 90.0)
iLat = lat;
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.
PlugIn Object Definition/API.