127 virtual InitReturn Init(
const wxString &name, ChartInitFlag flags);
131 virtual ThumbData *GetThumbData(
int tnx,
int tny,
float lat,
float lon);
132 virtual ThumbData *GetThumbData() {
return pThumbData; }
133 bool UpdateThumbData(
double lat,
double lon);
135 virtual int GetNativeScale() {
return m_Chart_Scale; }
136 virtual double GetNormalScaleMin(
double canvas_scale_factor,
137 bool b_allow_overzoom);
138 virtual double GetNormalScaleMax(
double canvas_scale_factor,
141 void SetNativeScale(
int s) { m_Chart_Scale = s; }
143 virtual bool RenderRegionViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint,
145 virtual bool RenderOverlayRegionViewOnDC(wxMemoryDC &dc,
149 virtual bool RenderRegionViewOnDCNoText(wxMemoryDC &dc,
152 virtual bool RenderRegionViewOnDCTextOnly(wxMemoryDC &dc,
156 virtual void GetValidCanvasRegion(
const ViewPort &VPoint,
158 virtual LLRegion GetValidRegion();
160 virtual void GetPointPix(ObjRazRules *rzRules,
float rlat,
float rlon,
162 virtual void GetPointPix(ObjRazRules *rzRules, wxPoint2DDouble *en,
163 wxPoint *r,
int nPoints);
164 virtual void GetPixPoint(
int pixx,
int pixy,
double *plat,
double *plon,
167 virtual void SetVPParms(
const ViewPort &vpt);
172 virtual double GetNearestPreferredScalePPM(
double target_scale_ppm) {
173 return target_scale_ppm;
176 void SetFullExtent(
Extent &ext);
177 bool GetChartExtent(
Extent *pext);
179 void SetColorScheme(ColorScheme cs,
bool bApplyImmediate =
true);
180 virtual void UpdateLUPs(
s57chart *pOwner);
182 int _insertRules(S57Obj *obj, LUPrec *LUP,
s57chart *pOwner);
184 virtual ListOfObjRazRules *GetObjRuleListAtLatLon(
185 float lat,
float lon,
float select_radius,
ViewPort *VPoint,
186 int selection_mask = MASK_ALL);
187 bool DoesLatLonSelectObject(
float lat,
float lon,
float select_radius,
189 bool IsPointInObjArea(
float lat,
float lon,
float select_radius, S57Obj *obj);
190 virtual ListOfObjRazRules *GetLightsObjRuleListVisibleAtLatLon(
191 float lat,
float lon,
ViewPort *VPoint);
193 wxString GetObjectAttributeValueAsString(S57Obj *obj,
int iatt,
194 wxString curAttrName);
195 static wxString GetAttributeValueAsString(S57attVal *pAttrVal,
198 wxString CreateObjDescriptions(ListOfObjRazRules *rule);
199 static wxString GetAttributeDecode(wxString &att,
int ival);
201 int BuildRAZFromSENCFile(
const wxString &SENCPath);
202 static void GetChartNameFromTXT(
const wxString &FullPath, wxString &Name);
203 wxString buildSENCName(
const wxString &name);
206 bool GetNearestSafeContour(
double safe_cnt,
double &next_safe_cnt);
208 virtual std::list<S57Obj *> *GetAssociatedObjects(S57Obj *obj);
210 virtual std::unordered_map<unsigned, VE_Element *> &Get_ve_hash(
void) {
213 virtual std::unordered_map<unsigned, VC_Element *> &Get_vc_hash(
void) {
217 virtual void ForceEdgePriorityEvaluate(
void);
219 float *GetLineVertexBuffer(
void) {
return m_line_vertex_buffer; }
221 void ClearRenderedTextCache();
223 double GetCalculatedSafetyContour(
void) {
return m_next_safe_cnt; }
225 virtual bool RenderRegionViewOnGL(
const wxGLContext &glc,
228 const LLRegion &Region);
229 virtual bool RenderOverlayRegionViewOnGL(
const wxGLContext &glc,
232 const LLRegion &Region);
233 virtual bool RenderRegionViewOnGLNoText(
const wxGLContext &glc,
236 const LLRegion &Region);
237 virtual bool RenderViewOnGLTextOnly(
const wxGLContext &glc,
243 wxArrayPtrVoid *pFloatingATONArray;
244 wxArrayPtrVoid *pRigidATONArray;
246 double ref_lat, ref_lon;
250 bool m_bLinePrioritySet;
253 double m_easting_vp_center, m_northing_vp_center;
254 double m_pixx_vp_center, m_pixy_vp_center;
255 double m_view_scale_ppm;
262 virtual bool IsCacheValid() {
return (pDIB !=
nullptr); }
263 virtual void InvalidateCache();
264 virtual bool RenderViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint);
266 virtual void ClearDepthContourArray(
void);
267 virtual void BuildDepthContourArray(
void);
268 int ValidateAndCountUpdates(
const wxFileName file000,
const wxString CopyDir,
269 wxString &LastUpdateDate,
bool b_copyfiles);
270 static int GetUpdateFileArray(
const wxFileName file000,
271 wxArrayString *UpFiles, wxDateTime date000,
273 wxString GetISDT(
void);
274 InitReturn PostInit(ChartInitFlag flags, ColorScheme cs);
276 char GetUsageChar(
void) {
return m_usage_char; }
277 static bool IsCellOverlayType(
const wxString &pFullPath);
283 chart_context *m_this_chart_context;
285 int FindOrCreateSenc(
const wxString &name,
bool b_progress =
true);
286 void DisableBackgroundSENC() { m_disableBackgroundSENC =
true; }
287 void EnableBackgroundSENC() { m_disableBackgroundSENC =
false; }
290 void AssembleLineGeometry(
void);
292 ObjRazRules *razRules[PRIO_NUM][LUPNAME_NUM];
293 double m_next_safe_cnt;
296 int GetLineFeaturePointArray(S57Obj *obj,
void **ret_array);
297 void SetSafetyContour(
void);
299 bool DoRenderViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint,
300 RenderTypeEnum option,
bool force_new_view);
302 bool DoRenderRegionViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint,
305 int DCRenderRect(wxMemoryDC &dcinput,
const ViewPort &vp, wxRect *rect);
306 bool DCRenderLPB(wxMemoryDC &dcinput,
const ViewPort &vp, wxRect *rect);
307 bool DCRenderText(wxMemoryDC &dcinput,
const ViewPort &vp);
309 int BuildSENCFile(
const wxString &FullPath000,
const wxString &SENCFileName,
310 bool b_progress =
true);
312 void SetLinePriorities(
void);
314 bool BuildThumbnail(
const wxString &bmpname);
315 bool CreateHeaderDataFromENC(
void);
316 bool CreateHeaderDataFromSENC(
void);
317 bool CreateHeaderDataFromoSENC(
void);
318 bool GetBaseFileAttr(
const wxString &file000);
323 bool InitENCMinimal(
const wxString &FullPath);
325 OGRFeature *GetChartFirstM_COVR(
int &catcov);
326 OGRFeature *GetChartNextM_COVR(
int &catcov);
328 void FreeObjectsAndRules();
329 const char *getName(OGRFeature *feature);
331 bool DoRenderOnGL(
const wxGLContext &glc,
const ViewPort &VPoint);
332 bool DoRenderOnGLText(
const wxGLContext &glc,
const ViewPort &VPoint);
333 bool DoRenderRegionViewOnGL(
const wxGLContext &glc,
const ViewPort &VPoint,
335 const LLRegion &Region,
bool b_overlay);
337 void BuildLineVBO(
void);
339 void ChangeThumbColor(ColorScheme cs);
341 void CreateChartContext();
342 void PopulateObjectsWithContext();
348 wxString m_SENCFileName;
350 wxArrayString *m_tmpup_array;
353 wxBitmap *m_pCloneBM;
356 bool bGLUWarningSent;
358 wxBitmap *m_pDIBThumbDay;
359 wxBitmap *m_pDIBThumbDim;
360 wxBitmap *m_pDIBThumbOrphan;
361 bool m_bneed_new_thumbnail;
363 bool m_bbase_file_attr_known;
364 wxDateTime m_date000;
370 OGRS57DataSource *m_pENCDS;
375 double *m_pvaldco_array;
377 float *m_line_vertex_buffer;
378 size_t m_vbo_byte_length;
380 bool m_blastS57TextRender;
381 wxString m_lastColorScheme;
382 wxRect m_last_vprect;
383 long m_plib_state_hash;
389 std::unordered_map<unsigned, VE_Element *> m_ve_hash;
390 std::unordered_map<unsigned, VC_Element *> m_vc_hash;
391 std::vector<connector_segment *> m_pcs_vector;
392 std::vector<VE_Element *> m_pve_vector;
394 wxString m_TempFilePath;
395 bool m_disableBackgroundSENC;
398 sm_parms vp_transform;