30#include "ocpn_types.h"
31#include "color_types.h"
46typedef enum ChartInitFlag {
52typedef enum RenderTypeEnum {
55 DC_RENDER_RETURN_IMAGE
58typedef enum InitReturn {
85typedef enum ChartDepthUnitType {
93typedef enum OcpnProjType {
96 PROJECTION_TRANSVERSE_MERCATOR,
99 PROJECTION_ORTHOGRAPHIC,
101 PROJECTION_STEREOGRAPHIC,
103 PROJECTION_EQUIRECTANGULAR,
104 PROJECTION_WEB_MERCATOR
122 virtual InitReturn Init(
const wxString &name, ChartInitFlag init_flags) = 0;
124 virtual void Activate(
void){};
125 virtual void Deactivate(
void){};
128 virtual ThumbData *GetThumbData(
int tnx,
int tny,
float lat,
float lon) = 0;
130 virtual bool UpdateThumbData(
double lat,
double lon) = 0;
132 virtual double GetNormalScaleMin(
double canvas_scale_factor,
133 bool b_allow_overzoom) = 0;
134 virtual double GetNormalScaleMax(
double canvas_scale_factor,
135 int canvas_width) = 0;
137 virtual bool GetChartExtent(
Extent *pext) = 0;
139 virtual OcpnProjType GetChartProjectionType() {
return m_projection; }
140 virtual wxDateTime GetEditionDate(
void) {
return m_EdDate; }
142 virtual wxString GetPubDate() {
return m_PubYear; }
143 virtual int GetNativeScale() {
return m_Chart_Scale; }
144 wxString GetFullPath()
const {
return m_FullPath; }
145 wxString GetHashKey()
const;
146 wxString GetName() {
return m_Name; }
147 wxString GetDescription() {
return m_Description; }
148 wxString GetID() {
return m_ID; }
149 wxString GetSE() {
return m_SE; }
150 wxString GetDepthUnits() {
return m_DepthUnits; }
151 wxString GetSoundingsDatum() {
return m_SoundingsDatum; }
152 wxString GetDatumString() {
return m_datum_str; }
153 wxString GetExtraInfo() {
return m_ExtraInfo; }
154 double GetChart_Error_Factor() {
return Chart_Error_Factor; }
155 ChartTypeEnum GetChartType() {
return m_ChartType; }
156 ChartFamilyEnum GetChartFamily() {
return m_ChartFamily; }
157 double GetChartSkew() {
return m_Chart_Skew; }
159 virtual ChartDepthUnitType GetDepthUnitType(
void) {
return m_depth_unit_id; }
161 virtual bool IsReadyToRender() {
return bReadyToRender; }
162 virtual bool RenderRegionViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint,
165 virtual bool RenderRegionViewOnGL(
const wxGLContext &glc,
168 const LLRegion &Region) = 0;
172 virtual void GetValidCanvasRegion(
const ViewPort &VPoint,
174 virtual LLRegion GetValidRegion() = 0;
176 virtual void SetColorScheme(ColorScheme cs,
bool bApplyImmediate =
true) = 0;
178 virtual double GetNearestPreferredScalePPM(
double target_scale_ppm) = 0;
180 virtual int GetCOVREntries() {
return m_nCOVREntries; }
181 virtual int GetCOVRTablePoints(
int iTable) {
182 return m_pCOVRTablePoints[iTable];
184 virtual int GetCOVRTablenPoints(
int iTable) {
185 return m_pCOVRTablePoints[iTable];
187 virtual float *GetCOVRTableHead(
int iTable) {
return m_pCOVRTable[iTable]; }
189 virtual int GetNoCOVREntries() {
return m_nNoCOVREntries; }
190 virtual int GetNoCOVRTablePoints(
int iTable) {
191 return m_pNoCOVRTablePoints[iTable];
193 virtual int GetNoCOVRTablenPoints(
int iTable) {
194 return m_pNoCOVRTablePoints[iTable];
196 virtual float *GetNoCOVRTableHead(
int iTable) {
197 return m_pNoCOVRTable[iTable];
202 ChartTypeEnum m_ChartType;
203 ChartFamilyEnum m_ChartFamily;
207 wxString m_Description;
210 wxString m_SoundingsDatum;
211 wxString m_datum_str;
212 wxString m_ExtraInfo;
214 wxString m_DepthUnits;
216 OcpnProjType m_projection;
217 ChartDepthUnitType m_depth_unit_id;
223 ColorScheme m_global_color_scheme;
226 double Chart_Error_Factor;
228 double m_lon_datum_adjust;
230 double m_lat_datum_adjust;
244 int *m_pCOVRTablePoints;
246 float **m_pCOVRTable;
249 int m_nNoCOVREntries;
250 int *m_pNoCOVRTablePoints;
252 float **m_pNoCOVRTable;
265 virtual InitReturn Init(
const wxString &name, ChartInitFlag init_flags);
268 virtual ThumbData *GetThumbData(
int tnx,
int tny,
float lat,
float lon);
269 virtual ThumbData *GetThumbData() {
return pThumbData; }
270 virtual bool UpdateThumbData(
double lat,
double lon);
272 double GetNormalScaleMin(
double canvas_scale_factor,
bool b_allow_overzoom) {
275 double GetNormalScaleMax(
double canvas_scale_factor,
int canvas_width) {
279 virtual bool GetChartExtent(
Extent *pext);
281 virtual bool RenderRegionViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint,
284 virtual bool RenderRegionViewOnGL(
const wxGLContext &glc,
287 const LLRegion &Region);
291 virtual void GetValidCanvasRegion(
const ViewPort &VPoint,
293 virtual LLRegion GetValidRegion();
295 virtual void SetColorScheme(ColorScheme cs,
bool bApplyImmediate);
297 virtual double GetNearestPreferredScalePPM(
double target_scale_ppm) {
298 return target_scale_ppm;
302 bool RenderViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint);