#include <ShapeUpAPI.h>
Inheritance diagram for SUMap:
Public Member Functions | |
SUMap (SUHANDLE hMap) | |
void | GetBounds (SURectf &r) |
void | GetViewSize (SUSize &s) |
void | GPtoDP (const SUPointf &p, SUPoint &pt) |
void | DPtoGP (const SUPoint &p, SUPointf &pt) |
HWND | GetHWND () |
void | Repaint (bool bFullRedraw) |
void | Draw (HDC hdc, const SUSize &imagesize, const SUPointf ¢er, double geoWidth=0., double geoHeight=0.) |
void | CenterMap (const SUPointf &pt) |
void | CenterMap (double x, double y) |
void | Zoom (double factor) |
void | ZoomToSelection (SUHANDLE hTheme) |
void | ZoomToExtent (SUHANDLE hTheme) |
unsigned long | GetInteractionState () |
void | SetInteractionState (unsigned long state) |
The ShapeUp map also maintaines an interaction state, MAPSTATE, which controls the behaviour of the map presented to the user.
SUMap::SUMap | ( | SUHANDLE | hMap | ) | [inline] |
Constructor.
hMap | = handle to a ShapeUp map window. |
void SUMap::GetBounds | ( | SURectf & | r | ) | [inline] |
Retrieves the geographical bounds of the map window.
r | = a SURectf that will receive the bounds. |
void SUMap::GetViewSize | ( | SUSize & | s | ) | [inline] |
Retrieves the view size in device units of the map window.
s | = a SUSize that will receive the size. |
Converts geographical points, GP, to device points, DP.
p | = a SUPointf containing the geographical points. | |
pt | = a SUPoint that will receive the device points. |
Converts device points, DP, to geographical points, GP.
p | = a SUPoint containing the device points. | |
pt | = a SUPointf that will receive the geographical points. |
HWND SUMap::GetHWND | ( | ) | [inline] |
Gets access to the ShapeUp map window.
void SUMap::Repaint | ( | bool | bFullRedraw | ) | [inline] |
Forces the map window to repaint itself. The map is rendered in two steps. First all map objects are drawn to a background buffer. Then that buffer is painted on the map, and on top of that, temporary objects are drawn. Temporary objects are rubber rectangles, bookmark icons, shapes being drawn, etc.
bFullRedraw | if true, all map objects are redrawn, and if false, the background buffer is used to paint the map objects and only the top items are redrawn. |
void SUMap::Draw | ( | HDC | hdc, | |
const SUSize & | imagesize, | |||
const SUPointf & | center, | |||
double | geoWidth = 0. , |
|||
double | geoHeight = 0. | |||
) | [inline] |
Paints the current map to a dc.
void SUMap::CenterMap | ( | const SUPointf & | pt | ) | [inline] |
void SUMap::CenterMap | ( | double | x, | |
double | y | |||
) | [inline] |
Centers the map.
x | is the new center point east-west component. | |
y | is the new center point north-south component. |
void SUMap::Zoom | ( | double | factor | ) | [inline] |
Zooms the map.
factor | is the factor used to zoom the map. 0.0 < factor < 1.0 zooms in, and 1.0 < factor zooms out. |
void SUMap::ZoomToSelection | ( | SUHANDLE | hTheme | ) | [inline] |
Zooms the map to the extent of selected shapes in a layer.
hTheme | is a handle to a ShapeUp theme, or a SUTheme object, in which to find selected ojects. |
void SUMap::ZoomToExtent | ( | SUHANDLE | hTheme | ) | [inline] |
Zooms the map to the extent of a layer.
hTheme | is a handle to a ShapeUp theme, or a SUTheme object. |
unsigned long SUMap::GetInteractionState | ( | ) | [inline] |
Returns the current map interaction state. The interaction state is a value indicating what the user is about to do, or is doing, in the map. This is in short the state of the mutual exclusive toolbar buttons like select, rectangle select, circle select, etc. This can be used to add new states to the map.
void SUMap::SetInteractionState | ( | unsigned long | state | ) | [inline] |
Sets a new map interaction state. The interaction state is a value indicating what the user is about to do, or is doing, in the map. This is in short the state of the mutual exclusive toolbar buttons like select, rectangle select, circle select, etc. This can be used to add new states to the map.
state | is the new state. It must be one of the defined map interaction states. Note: Not all map states defined can be set. Check MAPSTATE for more info. |