125 virtual InitReturn Init(
const wxString &name, ChartInitFlag flags);
129 virtual ThumbData *GetThumbData(
int tnx,
int tny,
float lat,
float lon);
130 virtual ThumbData *GetThumbData() {
return pThumbData; }
131 bool UpdateThumbData(
double lat,
double lon);
133 virtual int GetNativeScale() {
return m_Chart_Scale; }
134 virtual double GetNormalScaleMin(
double canvas_scale_factor,
135 bool b_allow_overzoom);
136 virtual double GetNormalScaleMax(
double canvas_scale_factor,
139 void SetNativeScale(
int s) { m_Chart_Scale = s; }
141 virtual bool RenderRegionViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint,
143 virtual bool RenderOverlayRegionViewOnDC(wxMemoryDC &dc,
147 virtual bool RenderRegionViewOnDCNoText(wxMemoryDC &dc,
150 virtual bool RenderRegionViewOnDCTextOnly(wxMemoryDC &dc,
154 virtual void GetValidCanvasRegion(
const ViewPort &VPoint,
156 virtual LLRegion GetValidRegion();
158 virtual void GetPointPix(ObjRazRules *rzRules,
float rlat,
float rlon,
160 virtual void GetPointPix(ObjRazRules *rzRules, wxPoint2DDouble *en,
161 wxPoint *r,
int nPoints);
162 virtual void GetPixPoint(
int pixx,
int pixy,
double *plat,
double *plon,
165 virtual void SetVPParms(
const ViewPort &vpt);
170 virtual double GetNearestPreferredScalePPM(
double target_scale_ppm) {
171 return target_scale_ppm;
174 void SetFullExtent(
Extent &ext);
175 bool GetChartExtent(
Extent *pext);
177 void SetColorScheme(ColorScheme cs,
bool bApplyImmediate =
true);
178 virtual void UpdateLUPs(
s57chart *pOwner);
180 int _insertRules(S57Obj *obj, LUPrec *LUP,
s57chart *pOwner);
182 virtual ListOfObjRazRules *GetObjRuleListAtLatLon(
183 float lat,
float lon,
float select_radius,
ViewPort *VPoint,
184 int selection_mask = MASK_ALL);
185 bool DoesLatLonSelectObject(
float lat,
float lon,
float select_radius,
187 bool IsPointInObjArea(
float lat,
float lon,
float select_radius, S57Obj *obj);
188 virtual ListOfObjRazRules *GetLightsObjRuleListVisibleAtLatLon(
189 float lat,
float lon,
ViewPort *VPoint);
191 wxString GetObjectAttributeValueAsString(S57Obj *obj,
int iatt,
192 wxString curAttrName);
193 static wxString GetAttributeValueAsString(S57attVal *pAttrVal,
196 wxString CreateObjDescriptions(ListOfObjRazRules *rule);
197 static wxString GetAttributeDecode(wxString &att,
int ival);
199 int BuildRAZFromSENCFile(
const wxString &SENCPath);
200 static void GetChartNameFromTXT(
const wxString &FullPath, wxString &Name);
201 wxString buildSENCName(
const wxString &name);
204 bool GetNearestSafeContour(
double safe_cnt,
double &next_safe_cnt);
206 virtual std::list<S57Obj *> *GetAssociatedObjects(S57Obj *obj);
208 virtual std::unordered_map<unsigned, VE_Element *> &Get_ve_hash(
void) {
211 virtual std::unordered_map<unsigned, VC_Element *> &Get_vc_hash(
void) {
215 virtual void ForceEdgePriorityEvaluate(
void);
217 float *GetLineVertexBuffer(
void) {
return m_line_vertex_buffer; }
219 void ClearRenderedTextCache();
221 double GetCalculatedSafetyContour(
void) {
return m_next_safe_cnt; }
223 virtual bool RenderRegionViewOnGL(
const wxGLContext &glc,
226 const LLRegion &Region);
227 virtual bool RenderOverlayRegionViewOnGL(
const wxGLContext &glc,
230 const LLRegion &Region);
231 virtual bool RenderRegionViewOnGLNoText(
const wxGLContext &glc,
234 const LLRegion &Region);
235 virtual bool RenderViewOnGLTextOnly(
const wxGLContext &glc,
241 wxArrayPtrVoid *pFloatingATONArray;
242 wxArrayPtrVoid *pRigidATONArray;
244 double ref_lat, ref_lon;
248 bool m_bLinePrioritySet;
251 double m_easting_vp_center, m_northing_vp_center;
252 double m_pixx_vp_center, m_pixy_vp_center;
253 double m_view_scale_ppm;
260 virtual bool IsCacheValid() {
return (pDIB !=
nullptr); }
261 virtual void InvalidateCache();
262 virtual bool RenderViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint);
264 virtual void ClearDepthContourArray(
void);
265 virtual void BuildDepthContourArray(
void);
266 int ValidateAndCountUpdates(
const wxFileName file000,
const wxString CopyDir,
267 wxString &LastUpdateDate,
bool b_copyfiles);
268 static int GetUpdateFileArray(
const wxFileName file000,
269 wxArrayString *UpFiles, wxDateTime date000,
271 wxString GetISDT(
void);
272 InitReturn PostInit(ChartInitFlag flags, ColorScheme cs);
274 char GetUsageChar(
void) {
return m_usage_char; }
275 static bool IsCellOverlayType(
const wxString &pFullPath);
281 chart_context *m_this_chart_context;
283 int FindOrCreateSenc(
const wxString &name,
bool b_progress =
true);
284 void DisableBackgroundSENC() { m_disableBackgroundSENC =
true; }
285 void EnableBackgroundSENC() { m_disableBackgroundSENC =
false; }
288 void AssembleLineGeometry(
void);
290 ObjRazRules *razRules[PRIO_NUM][LUPNAME_NUM];
291 double m_next_safe_cnt;
294 int GetLineFeaturePointArray(S57Obj *obj,
void **ret_array);
295 void SetSafetyContour(
void);
297 bool DoRenderViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint,
298 RenderTypeEnum option,
bool force_new_view);
300 bool DoRenderRegionViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint,
303 int DCRenderRect(wxMemoryDC &dcinput,
const ViewPort &vp, wxRect *rect);
304 bool DCRenderLPB(wxMemoryDC &dcinput,
const ViewPort &vp, wxRect *rect);
305 bool DCRenderText(wxMemoryDC &dcinput,
const ViewPort &vp);
307 int BuildSENCFile(
const wxString &FullPath000,
const wxString &SENCFileName,
308 bool b_progress =
true);
310 void SetLinePriorities(
void);
312 bool BuildThumbnail(
const wxString &bmpname);
313 bool CreateHeaderDataFromENC(
void);
314 bool CreateHeaderDataFromSENC(
void);
315 bool CreateHeaderDataFromoSENC(
void);
316 bool GetBaseFileAttr(
const wxString &file000);
321 bool InitENCMinimal(
const wxString &FullPath);
323 OGRFeature *GetChartFirstM_COVR(
int &catcov);
324 OGRFeature *GetChartNextM_COVR(
int &catcov);
326 void FreeObjectsAndRules();
327 const char *getName(OGRFeature *feature);
329 bool DoRenderOnGL(
const wxGLContext &glc,
const ViewPort &VPoint);
330 bool DoRenderOnGLText(
const wxGLContext &glc,
const ViewPort &VPoint);
331 bool DoRenderRegionViewOnGL(
const wxGLContext &glc,
const ViewPort &VPoint,
333 const LLRegion &Region,
bool b_overlay);
335 void BuildLineVBO(
void);
337 void ChangeThumbColor(ColorScheme cs);
339 void CreateChartContext();
340 void PopulateObjectsWithContext();
346 wxString m_SENCFileName;
348 wxArrayString *m_tmpup_array;
351 wxBitmap *m_pCloneBM;
354 bool bGLUWarningSent;
356 wxBitmap *m_pDIBThumbDay;
357 wxBitmap *m_pDIBThumbDim;
358 wxBitmap *m_pDIBThumbOrphan;
359 bool m_bneed_new_thumbnail;
361 bool m_bbase_file_attr_known;
362 wxDateTime m_date000;
368 OGRS57DataSource *m_pENCDS;
373 double *m_pvaldco_array;
375 float *m_line_vertex_buffer;
376 size_t m_vbo_byte_length;
378 bool m_blastS57TextRender;
379 wxString m_lastColorScheme;
380 wxRect m_last_vprect;
381 long m_plib_state_hash;
387 std::unordered_map<unsigned, VE_Element *> m_ve_hash;
388 std::unordered_map<unsigned, VC_Element *> m_vc_hash;
389 std::vector<connector_segment *> m_pcs_vector;
390 std::vector<VE_Element *> m_pve_vector;
392 wxString m_TempFilePath;
393 bool m_disableBackgroundSENC;
396 sm_parms vp_transform;