OpenCPN Partial API docs
|
Represents the view port for chart display in OpenCPN. More...
#include <viewport.h>
Public Member Functions | |
wxPoint | GetPixFromLL (double lat, double lon) |
Convert latitude and longitude on the ViewPort to physical pixel coordinates. | |
void | GetLLFromPix (const wxPoint &p, double *lat, double *lon) |
Convert physical pixel coordinates on the ViewPort to latitude and longitude. | |
void | GetLLFromPix (const wxPoint2DDouble &p, double *lat, double *lon) |
Convert physical pixel coordinates on the ViewPort to latitude and longitude using double precision. | |
wxPoint2DDouble | GetDoublePixFromLL (double lat, double lon) |
Convert latitude and longitude on the ViewPort to physical pixel coordinates with double precision. | |
LLRegion | GetLLRegion (const OCPNRegion ®ion) |
OCPNRegion | GetVPRegionIntersect (const OCPNRegion ®ion, const LLRegion &llregion, int chart_native_scale) |
Get the intersection of the viewport with a given region. | |
OCPNRegion | GetVPRegionIntersect (const OCPNRegion &Region, int nPoints, float *llpoints, int chart_native_scale, wxPoint *ppoints) |
Get the intersection of the viewport with a polygon defined by lat/lon points. | |
wxRect | GetVPRectIntersect (size_t n, float *llpoints) |
Get the viewport rectangle intersecting with a set of lat/lon points. | |
ViewPort | BuildExpandedVP (int width, int height) |
void | SetBoxes (void) |
void | SetPixelScale (double scale) |
Set the physical to logical pixel ratio for the display. | |
void | Invalidate () |
void | Validate () |
bool | IsValid () const |
void | SetRotationAngle (double angle_rad) |
void | SetProjectionType (int type) |
LLBBox & | GetBBox () |
void | SetBBoxDirect (const LLBBox &bbox) |
void | SetBBoxDirect (double latmin, double lonmin, double latmax, double lonmax) |
bool | ContainsIDL () |
void | InvalidateTransformCache () |
void | SetVPTransformMatrix () |
bool | operator== (const ViewPort &rhs) const |
Public Attributes | |
double | clat |
Center latitude of the viewport in degrees. | |
double | clon |
Center longitude of the viewport in degrees. | |
double | view_scale_ppm |
Requested view scale in physical pixels per meter (ppm), before applying projections. | |
double | skew |
Angular distortion (shear transform) applied to the viewport in radians. | |
double | rotation |
Rotation angle of the viewport in radians. | |
double | tilt |
Tilt angle for perspective view in radians. | |
double | chart_scale |
Chart scale denominator (e.g., 50000 for a 1:50000 scale). | |
double | ref_scale |
The nominal scale of the "reference chart" for this view. | |
int | pix_width |
Width of the viewport in physical pixels. | |
int | pix_height |
Height of the viewport in physical pixels. | |
bool | b_quilt |
bool | b_FullScreenQuilt |
int | m_projection_type |
bool | b_MercatorProjectionOverride |
wxRect | rv_rect |
float | vp_matrix_transform [16] |
float | norm_transform [16] |
Represents the view port for chart display in OpenCPN.
Encapsulates all parameters that define the current view of the chart, including position, scale, rotation, and projection type. Provides methods for coordinate conversions and viewport manipulations.
Definition at line 84 of file viewport.h.
ViewPort::ViewPort | ( | ) |
Definition at line 119 of file viewport.cpp.
ViewPort ViewPort::BuildExpandedVP | ( | int | width, |
int | height | ||
) |
Definition at line 974 of file viewport.cpp.
bool ViewPort::ContainsIDL | ( | ) |
Definition at line 967 of file viewport.cpp.
|
inline |
Definition at line 180 of file viewport.h.
wxPoint2DDouble ViewPort::GetDoublePixFromLL | ( | double | lat, |
double | lon | ||
) |
Convert latitude and longitude on the ViewPort to physical pixel coordinates with double precision.
lat | Latitude in degrees. |
lon | Longitude in degrees. |
Definition at line 145 of file viewport.cpp.
|
inline |
Convert physical pixel coordinates on the ViewPort to latitude and longitude.
p | Physical pixel coordinates. |
lat | Pointer to store resulting latitude. |
lon | Pointer to store resulting longitude. |
Definition at line 104 of file viewport.h.
void ViewPort::GetLLFromPix | ( | const wxPoint2DDouble & | p, |
double * | lat, | ||
double * | lon | ||
) |
Convert physical pixel coordinates on the ViewPort to latitude and longitude using double precision.
p | Physical pixel coordinates as wxPoint2DDouble. |
lat | Pointer to store resulting latitude. |
lon | Pointer to store resulting longitude. |
Definition at line 268 of file viewport.cpp.
LLRegion ViewPort::GetLLRegion | ( | const OCPNRegion & | region | ) |
Definition at line 343 of file viewport.cpp.
wxPoint ViewPort::GetPixFromLL | ( | double | lat, |
double | lon | ||
) |
Convert latitude and longitude on the ViewPort to physical pixel coordinates.
lat | Latitude in degrees. |
lon | Longitude in degrees. |
Definition at line 136 of file viewport.cpp.
wxRect ViewPort::GetVPRectIntersect | ( | size_t | n, |
float * | llpoints | ||
) |
Get the viewport rectangle intersecting with a set of lat/lon points.
n | Number of points |
llpoints | Array of lat/lon points |
Definition at line 798 of file viewport.cpp.
OCPNRegion ViewPort::GetVPRegionIntersect | ( | const OCPNRegion & | region, |
const LLRegion & | llregion, | ||
int | chart_native_scale | ||
) |
Get the intersection of the viewport with a given region.
region | OCPNRegion to intersect with |
llregion | LLRegion to use for the intersection |
chart_native_scale | Native scale of the chart |
Definition at line 419 of file viewport.cpp.
OCPNRegion ViewPort::GetVPRegionIntersect | ( | const OCPNRegion & | Region, |
int | nPoints, | ||
float * | llpoints, | ||
int | chart_native_scale, | ||
wxPoint * | ppoints | ||
) |
Get the intersection of the viewport with a polygon defined by lat/lon points.
Region | OCPNRegion to intersect with |
nPoints | Number of points in the polygon |
llpoints | Array of lat/lon points defining the polygon |
chart_native_scale | Native scale of the chart |
ppoints | Array to store resulting pixel coordinates |
Definition at line 480 of file viewport.cpp.
|
inline |
Definition at line 173 of file viewport.h.
|
inline |
Definition at line 187 of file viewport.h.
|
inline |
Definition at line 175 of file viewport.h.
|
inline |
Definition at line 235 of file viewport.h.
|
inline |
Definition at line 182 of file viewport.h.
void ViewPort::SetBBoxDirect | ( | double | latmin, |
double | lonmin, | ||
double | latmax, | ||
double | lonmax | ||
) |
Definition at line 963 of file viewport.cpp.
void ViewPort::SetBoxes | ( | void | ) |
Definition at line 821 of file viewport.cpp.
void ViewPort::SetPixelScale | ( | double | scale | ) |
Set the physical to logical pixel ratio for the display.
On standard displays, one logical pixel equals one physical pixel, so this value is 1.0. On high-DPI/Retina displays, one logical pixel may equal multiple physical pixels:
scale | The ratio of physical pixels to logical pixels. |
Definition at line 133 of file viewport.cpp.
|
inline |
Definition at line 178 of file viewport.h.
|
inline |
Definition at line 177 of file viewport.h.
void ViewPort::SetVPTransformMatrix | ( | ) |
Definition at line 984 of file viewport.cpp.
|
inline |
Definition at line 174 of file viewport.h.
bool ViewPort::b_FullScreenQuilt |
Definition at line 224 of file viewport.h.
bool ViewPort::b_MercatorProjectionOverride |
Definition at line 227 of file viewport.h.
bool ViewPort::b_quilt |
Definition at line 223 of file viewport.h.
double ViewPort::chart_scale |
Chart scale denominator (e.g., 50000 for a 1:50000 scale).
Definition at line 214 of file viewport.h.
double ViewPort::clat |
Center latitude of the viewport in degrees.
Definition at line 192 of file viewport.h.
double ViewPort::clon |
Center longitude of the viewport in degrees.
Definition at line 194 of file viewport.h.
int ViewPort::m_projection_type |
Definition at line 226 of file viewport.h.
float ViewPort::norm_transform[16] |
Definition at line 232 of file viewport.h.
int ViewPort::pix_height |
Height of the viewport in physical pixels.
Definition at line 221 of file viewport.h.
int ViewPort::pix_width |
Width of the viewport in physical pixels.
Definition at line 219 of file viewport.h.
double ViewPort::ref_scale |
The nominal scale of the "reference chart" for this view.
Definition at line 216 of file viewport.h.
double ViewPort::rotation |
Rotation angle of the viewport in radians.
Definition at line 209 of file viewport.h.
wxRect ViewPort::rv_rect |
Definition at line 228 of file viewport.h.
double ViewPort::skew |
Angular distortion (shear transform) applied to the viewport in radians.
The skew parameter represents a shear transformation applied to the viewport, which maintains parallel lines while changing their angles relative to the axes.
Definition at line 207 of file viewport.h.
double ViewPort::tilt |
Tilt angle for perspective view in radians.
Definition at line 211 of file viewport.h.
double ViewPort::view_scale_ppm |
Requested view scale in physical pixels per meter (ppm), before applying projections.
Definition at line 199 of file viewport.h.
float ViewPort::vp_matrix_transform[16] |
Definition at line 231 of file viewport.h.