95 virtual InitReturn Init(
const wxString &name, ChartInitFlag flags);
99 virtual ThumbData *GetThumbData(
int tnx,
int tny,
float lat,
float lon);
100 virtual ThumbData *GetThumbData() {
return pThumbData; }
101 bool UpdateThumbData(
double lat,
double lon);
103 virtual int GetNativeScale() {
return m_Chart_Scale; }
104 virtual double GetNormalScaleMin(
double canvas_scale_factor,
105 bool b_allow_overzoom);
106 virtual double GetNormalScaleMax(
double canvas_scale_factor,
109 void SetNativeScale(
int s) { m_Chart_Scale = s; }
111 virtual bool RenderRegionViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint,
113 virtual bool RenderOverlayRegionViewOnDC(wxMemoryDC &dc,
117 virtual bool RenderRegionViewOnDCNoText(wxMemoryDC &dc,
120 virtual bool RenderRegionViewOnDCTextOnly(wxMemoryDC &dc,
124 virtual void GetValidCanvasRegion(
const ViewPort &VPoint,
126 virtual LLRegion GetValidRegion();
128 virtual void GetPointPix(ObjRazRules *rzRules,
float rlat,
float rlon,
130 virtual void GetPointPix(ObjRazRules *rzRules, wxPoint2DDouble *en,
131 wxPoint *r,
int nPoints);
132 virtual void GetPixPoint(
int pixx,
int pixy,
double *plat,
double *plon,
135 virtual void SetVPParms(
const ViewPort &vpt);
140 virtual double GetNearestPreferredScalePPM(
double target_scale_ppm) {
141 return target_scale_ppm;
144 void SetFullExtent(
Extent &ext);
145 bool GetChartExtent(
Extent *pext);
147 void SetColorScheme(ColorScheme cs,
bool bApplyImmediate =
true);
148 virtual void UpdateLUPs(
s57chart *pOwner);
150 int _insertRules(S57Obj *obj, LUPrec *LUP,
s57chart *pOwner);
152 virtual ListOfObjRazRules *GetObjRuleListAtLatLon(
153 float lat,
float lon,
float select_radius,
ViewPort *VPoint,
154 int selection_mask = MASK_ALL);
155 bool DoesLatLonSelectObject(
float lat,
float lon,
float select_radius,
157 bool IsPointInObjArea(
float lat,
float lon,
float select_radius, S57Obj *obj);
158 virtual ListOfObjRazRules *GetLightsObjRuleListVisibleAtLatLon(
159 float lat,
float lon,
ViewPort *VPoint);
161 wxString GetObjectAttributeValueAsString(S57Obj *obj,
int iatt,
162 wxString curAttrName);
163 static wxString GetAttributeValueAsString(S57attVal *pAttrVal,
166 wxString CreateObjDescriptions(ListOfObjRazRules *rule);
167 static wxString GetAttributeDecode(wxString &att,
int ival);
169 int BuildRAZFromSENCFile(
const wxString &SENCPath);
170 static void GetChartNameFromTXT(
const wxString &FullPath, wxString &Name);
171 wxString buildSENCName(
const wxString &name);
174 bool GetNearestSafeContour(
double safe_cnt,
double &next_safe_cnt);
176 virtual std::list<S57Obj *> *GetAssociatedObjects(S57Obj *obj);
178 virtual std::unordered_map<unsigned, VE_Element *> &Get_ve_hash() {
181 virtual std::unordered_map<unsigned, VC_Element *> &Get_vc_hash() {
185 virtual void ForceEdgePriorityEvaluate();
187 float *GetLineVertexBuffer() {
return m_line_vertex_buffer; }
189 void ClearRenderedTextCache();
191 double GetCalculatedSafetyContour() {
return m_next_safe_cnt; }
193 virtual bool RenderRegionViewOnGL(
const wxGLContext &glc,
196 const LLRegion &Region);
197 virtual bool RenderOverlayRegionViewOnGL(
const wxGLContext &glc,
200 const LLRegion &Region);
201 virtual bool RenderRegionViewOnGLNoText(
const wxGLContext &glc,
204 const LLRegion &Region);
205 virtual bool RenderViewOnGLTextOnly(
const wxGLContext &glc,
211 wxArrayPtrVoid *pFloatingATONArray;
212 wxArrayPtrVoid *pRigidATONArray;
214 double ref_lat, ref_lon;
218 bool m_bLinePrioritySet;
221 double m_easting_vp_center, m_northing_vp_center;
222 double m_pixx_vp_center, m_pixy_vp_center;
223 double m_view_scale_ppm;
230 virtual bool IsCacheValid() {
return (pDIB !=
nullptr); }
231 virtual void InvalidateCache();
232 virtual bool RenderViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint);
234 virtual void ClearDepthContourArray();
235 virtual void BuildDepthContourArray();
236 int ValidateAndCountUpdates(
const wxFileName file000,
const wxString CopyDir,
237 wxString &LastUpdateDate,
bool b_copyfiles);
238 static int GetUpdateFileArray(
const wxFileName file000,
239 wxArrayString *UpFiles, wxDateTime date000,
242 InitReturn PostInit(ChartInitFlag flags, ColorScheme cs);
244 char GetUsageChar() {
return m_usage_char; }
245 static bool IsCellOverlayType(
const wxString &pFullPath);
251 chart_context *m_this_chart_context;
253 int FindOrCreateSenc(
const wxString &name,
bool b_progress =
true);
254 void DisableBackgroundSENC() { m_disableBackgroundSENC =
true; }
255 void EnableBackgroundSENC() { m_disableBackgroundSENC =
false; }
258 void AssembleLineGeometry();
260 ObjRazRules *razRules[PRIO_NUM][LUPNAME_NUM];
261 double m_next_safe_cnt;
264 int GetLineFeaturePointArray(S57Obj *obj,
void **ret_array);
265 void SetSafetyContour();
267 bool DoRenderViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint,
268 RenderTypeEnum option,
bool force_new_view);
270 bool DoRenderRegionViewOnDC(wxMemoryDC &dc,
const ViewPort &VPoint,
273 int DCRenderRect(wxMemoryDC &dcinput,
const ViewPort &vp, wxRect *rect);
274 bool DCRenderLPB(wxMemoryDC &dcinput,
const ViewPort &vp, wxRect *rect);
275 bool DCRenderText(wxMemoryDC &dcinput,
const ViewPort &vp);
277 int BuildSENCFile(
const wxString &FullPath000,
const wxString &SENCFileName,
278 bool b_progress =
true);
280 void SetLinePriorities();
282 bool BuildThumbnail(
const wxString &bmpname);
283 bool CreateHeaderDataFromENC();
284 bool CreateHeaderDataFromSENC();
285 bool CreateHeaderDataFromoSENC();
286 bool GetBaseFileAttr(
const wxString &file000);
291 bool InitENCMinimal(
const wxString &FullPath);
293 OGRFeature *GetChartFirstM_COVR(
int &catcov);
294 OGRFeature *GetChartNextM_COVR(
int &catcov);
296 void FreeObjectsAndRules();
297 const char *getName(OGRFeature *feature);
299 bool DoRenderOnGL(
const wxGLContext &glc,
const ViewPort &VPoint);
300 bool DoRenderOnGLText(
const wxGLContext &glc,
const ViewPort &VPoint);
301 bool DoRenderRegionViewOnGL(
const wxGLContext &glc,
const ViewPort &VPoint,
303 const LLRegion &Region,
bool b_overlay);
307 void ChangeThumbColor(ColorScheme cs);
309 void CreateChartContext();
310 void PopulateObjectsWithContext();
316 wxString m_SENCFileName;
318 wxArrayString *m_tmpup_array;
321 wxBitmap *m_pCloneBM;
324 bool bGLUWarningSent;
326 wxBitmap *m_pDIBThumbDay;
327 wxBitmap *m_pDIBThumbDim;
328 wxBitmap *m_pDIBThumbOrphan;
329 bool m_bneed_new_thumbnail;
331 bool m_bbase_file_attr_known;
332 wxDateTime m_date000;
338 OGRS57DataSource *m_pENCDS;
343 double *m_pvaldco_array;
345 float *m_line_vertex_buffer;
346 size_t m_vbo_byte_length;
348 bool m_blastS57TextRender;
349 wxString m_lastColorScheme;
350 wxRect m_last_vprect;
351 long m_plib_state_hash;
357 std::unordered_map<unsigned, VE_Element *> m_ve_hash;
358 std::unordered_map<unsigned, VC_Element *> m_vc_hash;
359 std::vector<connector_segment *> m_pcs_vector;
360 std::vector<VE_Element *> m_pve_vector;
362 wxString m_TempFilePath;
363 bool m_disableBackgroundSENC;
366 sm_parms vp_transform;