30 #include "OCPNRegion.h"
35 extern bool g_bopengl;
47 LLRegion ActiveRegion;
52 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; }
77 LLRegion reduced_candidate_region;
81 WX_DEFINE_SORTED_ARRAY(
QuiltCandidate *, ArrayOfSortedQuiltCandidates);
88 void SetQuiltParameters(
double CanvasScaleFactor,
int CanvasWidth) {
89 m_canvas_scale_factor = CanvasScaleFactor;
90 m_canvas_width = CanvasWidth;
93 void EnableHighDefinitionZoom(
bool value) { m_b_hidef = value; }
97 bool IsComposed() {
return m_bcomposed; }
103 std::vector<int> GetQuiltIndexArray(
void);
105 bool IsChartQuiltableRef(
int db_index);
106 ViewPort &GetQuiltVP() {
return m_vp_quilt; }
107 wxString GetQuiltDepthUnit() {
return m_quilt_depth_unit; }
108 void SetRenderedVP(
ViewPort &vp) { m_vp_rendered = vp; }
109 bool HasOverlays(
void) {
return m_bquilt_has_overlays; }
111 int GetExtendedStackCount(
void) {
return m_extended_stack_array.size(); }
112 int GetFullScreenIndexCount(
void) {
return m_fullscreen_index_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 SetHiliteIndexArray(
const std::vector<int> &index_array) {
153 m_HiLiteIndexArray = index_array; }
154 void ClearHiliteIndexArray() { m_HiLiteIndexArray.clear(); }
156 void SetReferenceChart(
int dbIndex) {
157 m_refchart_dbIndex = dbIndex;
162 int GetRefChartdbIndex(
void) {
return m_refchart_dbIndex; }
166 int GetQuiltProj(
void) {
return m_quilt_proj; }
167 double GetMaxErrorFactor() {
return m_max_error_factor; }
168 double GetRefScale() {
return m_reference_scale; }
170 ChartFamilyEnum GetRefFamily() {
return (ChartFamilyEnum)m_reference_family; }
172 void SetPreferrefFamily(ChartFamilyEnum family) {
173 m_preferred_family = family;
176 double GetRefNativeScale();
178 std::vector<int> GetCandidatedbIndexArray(
bool from_ref_chart,
179 bool exclude_user_hidden);
180 std::vector<int> &GetExtendedStackIndexArray() {
181 return m_extended_stack_array;
183 std::vector<int> GetEclipsedStackIndexArray() {
184 return m_eclipsed_stack_array;
186 std::vector<int> &GetFullscreenIndexArray() {
187 return m_fullscreen_index_array;
190 unsigned long GetXStackHash() {
return m_xa_hash; }
192 bool IsBusy() {
return m_bbusy; }
195 bool IsChartInQuilt(wxString &full_path);
197 bool IsQuiltVector(
void);
198 bool DoesQuiltContainPlugins(
void);
200 LLRegion GetHiliteRegion();
201 std::vector<int> &GetHiLiteIndexArray(){
return m_HiLiteIndexArray; }
205 int GetNomScaleMin(
int scale, ChartTypeEnum type, ChartFamilyEnum family);
206 int GetNomScaleMax(
int scale, ChartTypeEnum type, ChartFamilyEnum family);
207 ChartFamilyEnum GetPreferredFamily(
void) {
return m_preferred_family; }
210 bool BuildExtendedChartStackAndCandidateArray(
int ref_db_index,
212 int AdjustRefOnZoom(
bool b_zin, ChartFamilyEnum family, ChartTypeEnum type,
213 double proposed_scale_onscreen);
215 bool DoRenderQuiltRegionViewOnDC(wxMemoryDC &dc,
ViewPort &vp,
217 bool DoRenderQuiltRegionViewOnDCTextOnly(wxMemoryDC &dc,
ViewPort &vp,
220 void EmptyCandidateArray(
void);
221 void SubstituteClearDC(wxMemoryDC &dc,
ViewPort &vp);
222 int GetNewRefChart(
void);
223 const LLRegion &GetTilesetRegion(
int dbIndex);
225 bool IsChartS57Overlay(
int db_index);
227 LLRegion m_covered_region;
230 PatchList m_PatchList;
234 wxPatchListNode *cnode;
238 ArrayOfSortedQuiltCandidates *m_pcandidate_array;
239 std::vector<int> m_last_index_array;
240 std::vector<int> m_index_array;
241 std::vector<int> m_extended_stack_array;
242 std::vector<int> m_eclipsed_stack_array;
243 std::vector<int> m_fullscreen_index_array;
249 std::vector<int> m_HiLiteIndexArray;
250 int m_refchart_dbIndex;
251 int m_reference_scale;
252 int m_reference_type;
253 int m_reference_family;
255 LLRegion m_back_region;
256 wxString m_quilt_depth_unit;
257 double m_max_error_factor;
258 double m_canvas_scale_factor;
260 bool m_bquilt_has_overlays;
261 unsigned long m_xa_hash;
266 int m_lost_refchart_dbIndex;
270 bool m_bquiltanyproj;
271 ChartFamilyEnum m_preferred_family;
bool Compose(const ViewPort &vp)