29#include "OCPNRegion.h"
46 LLRegion ActiveRegion;
51 LLRegion quilt_region;
63 const LLRegion &GetCandidateRegion();
64 LLRegion &GetReducedCandidateRegion(
double factor);
65 void SetScale(
int scale);
66 bool Scale_eq(
int b)
const {
return abs(ChartScale - b) <= rounding; }
67 bool Scale_ge(
int b)
const {
return Scale_eq(b) || ChartScale > b; }
78 LLRegion reduced_candidate_region;
82WX_DEFINE_SORTED_ARRAY(
QuiltCandidate *, ArrayOfSortedQuiltCandidates);
89 void SetQuiltParameters(
double CanvasScaleFactor,
int CanvasWidth) {
90 m_canvas_scale_factor = CanvasScaleFactor;
91 m_canvas_width = CanvasWidth;
94 void EnableHighDefinitionZoom(
bool value) { m_b_hidef = value; }
98 bool IsComposed() {
return m_bcomposed; }
104 std::vector<int> GetQuiltIndexArray(
void);
106 bool IsChartQuiltableRef(
int db_index);
107 ViewPort &GetQuiltVP() {
return m_vp_quilt; }
108 wxString GetQuiltDepthUnit() {
return m_quilt_depth_unit; }
109 void SetRenderedVP(
ViewPort &vp) { m_vp_rendered = vp; }
110 bool HasOverlays(
void) {
return m_bquilt_has_overlays; }
112 int GetExtendedStackCount(
void) {
return m_extended_stack_array.size(); }
114 int GetnCharts() {
return m_PatchList.GetCount(); }
115 double GetBestStartScale(
int dbi_ref_hint,
const ViewPort &vp_in);
118 bool RenderQuiltRegionViewOnDCNoText(wxMemoryDC &dc,
ViewPort &vp,
120 bool RenderQuiltRegionViewOnDCTextOnly(wxMemoryDC &dc,
ViewPort &vp,
123 bool IsVPBlittable(
ViewPort &VPoint,
int dx,
int dy,
124 bool b_allow_vector =
false);
127 int GetChartdbIndexAtPix(
ViewPort &VPoint, wxPoint p);
128 void InvalidateAllQuiltPatchs(
void);
129 void Invalidate(
void) {
131 m_vp_quilt.Invalidate();
135 m_bquiltskew = g_bopengl;
137 m_bquiltanyproj = g_bopengl;
141 LLRegion &GetFullQuiltRegion(
void) {
return m_covered_region; }
142 OCPNRegion &GetFullQuiltRenderedRegion(
void) {
return m_rendered_region; }
143 bool IsChartSmallestScale(
int dbIndex);
145 int AdjustRefOnZoomOut(
double proposed_scale_onscreen);
146 int AdjustRefOnZoomIn(
double proposed_scale_onscreen);
149 int AdjustRefSelection(
const ViewPort &vp_in);
151 void SetHiliteIndex(
int index) { m_nHiLiteIndex = index; }
152 void SetReferenceChart(
int dbIndex) {
153 m_refchart_dbIndex = dbIndex;
158 int GetRefChartdbIndex(
void) {
return m_refchart_dbIndex; }
162 int GetQuiltProj(
void) {
return m_quilt_proj; }
163 double GetMaxErrorFactor() {
return m_max_error_factor; }
164 double GetRefScale() {
return m_reference_scale; }
166 ChartFamilyEnum GetRefFamily() {
return (ChartFamilyEnum)m_reference_family; }
168 void SetPreferrefFamily(ChartFamilyEnum family) {
169 m_preferred_family = family;
172 double GetRefNativeScale();
174 std::vector<int> GetCandidatedbIndexArray(
bool from_ref_chart,
175 bool exclude_user_hidden);
176 std::vector<int> GetExtendedStackIndexArray() {
177 return m_extended_stack_array;
179 std::vector<int> GetEclipsedStackIndexArray() {
180 return m_eclipsed_stack_array;
183 unsigned long GetXStackHash() {
return m_xa_hash; }
185 bool IsBusy() {
return m_bbusy; }
188 bool IsChartInQuilt(wxString &full_path);
190 bool IsQuiltVector(
void);
191 bool DoesQuiltContainPlugins(
void);
193 LLRegion GetHiliteRegion();
196 int GetNomScaleMin(
int scale, ChartTypeEnum type, ChartFamilyEnum family);
197 int GetNomScaleMax(
int scale, ChartTypeEnum type, ChartFamilyEnum family);
198 ChartFamilyEnum GetPreferredFamily(
void) {
return m_preferred_family; }
201 bool BuildExtendedChartStackAndCandidateArray(
int ref_db_index,
203 int AdjustRefOnZoom(
bool b_zin, ChartFamilyEnum family, ChartTypeEnum type,
204 double proposed_scale_onscreen);
206 bool DoRenderQuiltRegionViewOnDC(wxMemoryDC &dc,
ViewPort &vp,
208 bool DoRenderQuiltRegionViewOnDCTextOnly(wxMemoryDC &dc,
ViewPort &vp,
211 void EmptyCandidateArray(
void);
212 void SubstituteClearDC(wxMemoryDC &dc,
ViewPort &vp);
213 int GetNewRefChart(
void);
214 const LLRegion &GetTilesetRegion(
int dbIndex);
216 bool IsChartS57Overlay(
int db_index);
218 LLRegion m_covered_region;
221 PatchList m_PatchList;
225 wxPatchListNode *cnode;
229 ArrayOfSortedQuiltCandidates *m_pcandidate_array;
230 std::vector<int> m_last_index_array;
231 std::vector<int> m_index_array;
232 std::vector<int> m_extended_stack_array;
233 std::vector<int> m_eclipsed_stack_array;
239 int m_refchart_dbIndex;
240 int m_reference_scale;
241 int m_reference_type;
242 int m_reference_family;
244 LLRegion m_back_region;
245 wxString m_quilt_depth_unit;
246 double m_max_error_factor;
247 double m_canvas_scale_factor;
249 bool m_bquilt_has_overlays;
250 unsigned long m_xa_hash;
255 int m_lost_refchart_dbIndex;
259 bool m_bquiltanyproj;
260 ChartFamilyEnum m_preferred_family;
bool Compose(const ViewPort &vp)