Implement ocpn_region.h – Opencpn region handling.
More...
#include <wx/wxprec.h>
#include <wx/region.h>
#include "ocpn_region.h"
#include <wx/log.h>
Go to the source code of this file.
|
#define | EMPTY_REGION(pReg) pReg->numRects = 0 |
|
#define | REGION_NOT_EMPTY(pReg) pReg->numRects |
|
#define | NUMPTSTOBUFFER 200 |
|
#define | INBOX(r, x, y) ((((r).x2 > x)) && (((r).x1 <= x)) && (((r).y2 > y)) && (((r).y1 <= y))) |
|
#define | EXTENTCHECK(r1, r2) |
|
#define | OGROWREGION(reg, nRects) |
|
#define | OMEMCHECK(reg, rect, firstrect) |
|
#define | MIN(a, b) wxMin(a, b) |
|
#define | MAX(a, b) wxMax(a, b) |
|
#define | OBRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) |
|
#define | OBRESINCRPGON(d, minval, m, m1, incr1, incr2) |
|
#define | OBRESINITPGONSTRUCT(dmaj, min1, min2, bres) |
|
#define | OBRESINCRPGONSTRUCT(bres) |
|
#define | CLOCKWISE 1 |
|
#define | COUNTERCLOCKWISE -1 |
|
#define | SLLSPERBLOCK 25 |
|
#define | OEVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) |
|
#define | OEVALUATEEDGEEVENODD(pAET, pPrevAET, y) |
|
#define | M_REGIONDATA ((OCPNRegionRefData *)m_refData) |
|
#define | M_REGIONDATA_OF(rgn) ((OCPNRegionRefData *)(rgn.m_refData)) |
|
#define | M_REGIONDATA ((OCPNRegionRefData *)m_refData) |
|
|
enum | OGdkFillRule { OGDK_EVEN_ODD_RULE
, OGDK_WINDING_RULE
} |
|
enum | OGdkOverlapType { OGDK_OVERLAP_RECTANGLE_IN
, OGDK_OVERLAP_RECTANGLE_OUT
, OGDK_OVERLAP_RECTANGLE_PART
} |
|
|
OGdkRegion * | gdk_region_copy (const OGdkRegion *region) |
|
void | gdk_region_destroy (OGdkRegion *region) |
|
OGdkRegion * | gdk_region_rectangle (const OGdkRectangle *rectangle) |
|
bool | ogdk_region_equal (const OGdkRegion *region1, const OGdkRegion *region2) |
|
bool | gdk_region_point_in (const OGdkRegion *region, int x, int y) |
|
OGdkOverlapType | gdk_region_rect_in (const OGdkRegion *region, const OGdkRectangle *rectangle) |
|
void | gdk_region_offset (OGdkRegion *region, int dx, int dy) |
|
void | gdk_region_union_with_rect (OGdkRegion *region, const OGdkRectangle *rect) |
|
void | gdk_region_union (OGdkRegion *source1, const OGdkRegion *source2) |
|
void | gdk_region_intersect (OGdkRegion *source1, const OGdkRegion *source2) |
|
OGdkRegion * | gdk_region_polygon (const OGdkPoint *points, int n_points, OGdkFillRule fill_rule) |
|
OGdkRegion * | gdk_region_new () |
|
void | gdk_region_subtract (OGdkRegion *source1, const OGdkRegion *source2) |
|
bool | gdk_region_empty (const OGdkRegion *region) |
|
void | gdk_region_get_rectangles (const OGdkRegion *region, OGdkRectangle **rectangles, int *n_rectangles) |
|
void | gdk_region_get_clipbox (const OGdkRegion *region, OGdkRectangle *rectangle) |
|
Implement ocpn_region.h – Opencpn region handling.
Definition in file ocpn_region.cpp.
◆ CLOCKWISE
◆ COUNTERCLOCKWISE
#define COUNTERCLOCKWISE -1 |
◆ EMPTY_REGION
#define EMPTY_REGION |
( |
|
pReg | ) |
pReg->numRects = 0 |
◆ EXTENTCHECK
#define EXTENTCHECK |
( |
|
r1, |
|
|
|
r2 |
|
) |
| |
Value: ((r1)->x2 > (r2)->x1 && (r1)->x1 < (r2)->x2 && (r1)->y2 > (r2)->y1 && \
(r1)->y1 < (r2)->y2)
Definition at line 96 of file ocpn_region.cpp.
◆ INBOX
#define INBOX |
( |
|
r, |
|
|
|
x, |
|
|
|
y |
|
) |
| ((((r).x2 > x)) && (((r).x1 <= x)) && (((r).y2 > y)) && (((r).y1 <= y))) |
◆ M_REGIONDATA [1/2]
◆ M_REGIONDATA [2/2]
◆ M_REGIONDATA_OF
◆ MAX
#define MAX |
( |
|
a, |
|
|
|
b |
|
) |
| wxMax(a, b) |
◆ MIN
#define MIN |
( |
|
a, |
|
|
|
b |
|
) |
| wxMin(a, b) |
◆ NUMPTSTOBUFFER
#define NUMPTSTOBUFFER 200 |
◆ OBRESINCRPGON
#define OBRESINCRPGON |
( |
|
d, |
|
|
|
minval, |
|
|
|
m, |
|
|
|
m1, |
|
|
|
incr1, |
|
|
|
incr2 |
|
) |
| |
Value: { \
if (m1 > 0) { \
if (d > 0) { \
minval += m1; \
d += incr1; \
} else { \
minval += m; \
d += incr2; \
} \
} else { \
if (d >= 0) { \
minval += m1; \
d += incr1; \
} else { \
minval += m; \
d += incr2; \
} \
} \
}
Definition at line 189 of file ocpn_region.cpp.
◆ OBRESINCRPGONSTRUCT
#define OBRESINCRPGONSTRUCT |
( |
|
bres | ) |
|
Value: OBRESINCRPGON(bres.d, bres.minor_axis, bres.m, bres.m1, bres.incr1, \
bres.incr2)
Definition at line 228 of file ocpn_region.cpp.
◆ OBRESINITPGON
#define OBRESINITPGON |
( |
|
dy, |
|
|
|
x1, |
|
|
|
x2, |
|
|
|
xStart, |
|
|
|
d, |
|
|
|
m, |
|
|
|
m1, |
|
|
|
incr1, |
|
|
|
incr2 |
|
) |
| |
Value: { \
int dx; \
\
\
if ((dy) != 0) { \
xStart = (x1); \
dx = (x2) - xStart; \
if (dx < 0) { \
m = dx / (dy); \
m1 = m - 1; \
incr1 = -2 * dx + 2 * (dy) * m1; \
incr2 = -2 * dx + 2 * (dy) * m; \
d = 2 * m * (dy) - 2 * dx - 2 * (dy); \
} else { \
m = dx / (dy); \
m1 = m + 1; \
incr1 = 2 * dx - 2 * (dy) * m1; \
incr2 = 2 * dx - 2 * (dy) * m; \
d = -2 * m * (dy) + 2 * dx; \
} \
} \
}
Definition at line 165 of file ocpn_region.cpp.
◆ OBRESINITPGONSTRUCT
#define OBRESINITPGONSTRUCT |
( |
|
dmaj, |
|
|
|
min1, |
|
|
|
min2, |
|
|
|
bres |
|
) |
| |
Value: OBRESINITPGON(dmaj, min1, min2, bres.minor_axis, bres.d, bres.m, bres.m1, \
bres.incr1, bres.incr2)
Definition at line 224 of file ocpn_region.cpp.
◆ OEVALUATEEDGEEVENODD
#define OEVALUATEEDGEEVENODD |
( |
|
pAET, |
|
|
|
pPrevAET, |
|
|
|
y |
|
) |
| |
Value: { \
if (pAET->ymax == y) { \
pPrevAET->next = pAET->next; \
pAET = pPrevAET->next; \
if (pAET) pAET->back = pPrevAET; \
} else { \
OBRESINCRPGONSTRUCT(pAET->bres); \
pPrevAET = pAET; \
pAET = pAET->next; \
} \
}
Definition at line 305 of file ocpn_region.cpp.
◆ OEVALUATEEDGEWINDING
#define OEVALUATEEDGEWINDING |
( |
|
pAET, |
|
|
|
pPrevAET, |
|
|
|
y, |
|
|
|
fixWAET |
|
) |
| |
Value: { \
if (pAET->ymax == y) { \
pPrevAET->next = pAET->next; \
pAET = pPrevAET->next; \
fixWAET = 1; \
if (pAET) pAET->back = pPrevAET; \
} else { \
OBRESINCRPGONSTRUCT(pAET->bres); \
pPrevAET = pAET; \
pAET = pAET->next; \
} \
}
Definition at line 284 of file ocpn_region.cpp.
◆ OGROWREGION
#define OGROWREGION |
( |
|
reg, |
|
|
|
nRects |
|
) |
| |
Value: { \
if ((nRects) == 0) { \
if ((reg)->rects != &(reg)->extents) { \
free((reg)->rects); \
(reg)->rects = &(reg)->extents; \
} \
} else if ((reg)->rects == &(reg)->extents) { \
(reg)->rects[0] = (reg)->extents; \
} else \
(reg)->size = (nRects); \
}
Definition at line 111 of file ocpn_region.cpp.
◆ OMEMCHECK
#define OMEMCHECK |
( |
|
reg, |
|
|
|
rect, |
|
|
|
firstrect |
|
) |
| |
Value: { \
if ((reg)->numRects >= ((reg)->size - 1)) { \
OGROWREGION(reg, 2 * (reg)->size); \
(rect) = &(firstrect)[(reg)->numRects]; \
} \
}
Definition at line 130 of file ocpn_region.cpp.
◆ REGION_NOT_EMPTY
#define REGION_NOT_EMPTY |
( |
|
pReg | ) |
pReg->numRects |
◆ SLLSPERBLOCK
◆ OGdkPoint
◆ OGdkRectangle
◆ OGdkRegion
◆ OGdkRegionBox
◆ OGdkSegment
◆ OGdkFillRule
◆ OGdkOverlapType