Rogue Wave Views Maps Package API Reference Guide |
Rogue Wave Views Documentation Home |
The IlvMapInfo
class is used to attach map information to an IlvManager
.
More...
#include <ilviews/maps/mapinfo.h>
Public Member Functions | |
IlvMapInfo (const IlvProjection *projection, const IlvMapAdapter *adapter=0, IlBoolean copy=IlTrue) | |
Initializes a new instance of IlvMapInfo . More... | |
IlvMapInfo * | attach (IlvManager *manager) |
Attaches the map information to manager. The map information will be automatically saved with the manager. This method returns the instance of IlvMapInfo that was previously attached to the manager or 0 if none. It also notifies the listeners that have been attached to the manager by the AddMapInfoListener() static method.More... | |
void | detach () |
Detaches map information from its manager and notifies the listeners of the manager. | |
IlvMapsError | forward (const IlvCoordinate &coord, IlvPoint &point) const |
Converts a latitude and a longitude into graphic coordinates. More... | |
const IlvMapAdapter * | getAdapter () const |
Returns the adapter of the map information. More... | |
IlvManager * | getManager () const |
Returns the manager that this map info is attached to. More... | |
const IlvProjection * | getProjection () const |
Returns the projection of the map information. More... | |
IlDouble | getScale (IlvView *view) const |
Returns the cartographic scale of the view. More... | |
const IlvUnitConverter * | getUnitConverter () const |
Returns the unit converter of the map information. More... | |
IlvMapsError | inverse (const IlvPoint &point, IlvCoordinate &coord) const |
Converts graphic coordinates into geographic coordinates. More... | |
IlvMapsError | inverse (const IlvEvent &event, const IlvView *view, IlvCoordinate &coord) const |
Computes the longitude and latitude of the mouse event event that occurred in view. The result is stored in coord. More... | |
void | setScale (IlvView *view, IlDouble scale, IlBoolean redraw=IlTrue) const |
Sets the scale of view to scale. In the following example scale is set to 1/50,000th. More... | |
IlvMapsError | toViews (const IlvCoordinate &data, const IlvProjection *sourceProjection, IlvPoint &result) const |
Converts a coordinate expressed in a source projection into the manager coordinate system, after having applied the projection of the map info. More... | |
Static Public Member Functions | |
static void | AddMapInfoListener (IlvManager *manager, IlvMapInfoListener *listener) |
Registers listener so that it can be notified about map information changes occurring to manager. More... | |
static IlvMapInfo * | Get (IlvManager *manager) |
Returns the map information that is attached to the specified manager. More... | |
static void | RemoveMapInfoListener (IlvManager *manager, IlvMapInfoListener *listener) |
Removes specified listener to the notification list of the specified manager. More... | |
static void | SetScreenSize (IlvDisplay *display, IlUInt heightmm, IlUInt widthmm) |
Specifies the height and the width of the display screen for a more accurate scale management. More... | |
The IlvMapInfo
class is used to attach map information to an IlvManager
.
This class is used to attach map information to an IlvManager
.
This information is persistent and is automatically saved when the manager is saved.
When an IlvMapInfo
is attached to an IlvManager
, the manager becomes georeferenced. The points of the manager can be interpreted in terms of distances. Heterogeneous map data can be potentially loaded into the manager because the Cartesian coordinate system of the manager (specified by a projection) is known.
In addition to enabling applications to save georeferencing information, the IlvMapInfo
class provides additional services, such as directly converting latitude and longitude into points expressed in the manager coordinate system, converting mouse events into latitude and longitude, or setting the scale of a view.
Library: ilvmaps
IlvMapAdapter
, IlvProjection
, IlvUnitConverter
, IlvMapInfoListener
. IlvMapInfo::IlvMapInfo | ( | const IlvProjection * | projection, |
const IlvMapAdapter * | adapter = 0 , |
||
IlBoolean | copy = IlTrue |
||
) |
Initializes a new instance of IlvMapInfo
.
Initializes an IlvMapInfo
with projection and adapter.
projection | The projection to be attached. |
adapter | The adapter for this projection. If this parameter is not specified, a new IlvMapAdapter optimized for the projection is used. |
copy | If IlTrue , the arguments projection and adapter are copied. If not specified, defaults to IlTrue . |
|
static |
Registers listener so that it can be notified about map information changes occurring to manager.
manager | The manager to listen to. |
listener | The listener to register. |
IlvMapInfo* IlvMapInfo::attach | ( | IlvManager * | manager | ) |
Attaches the map information to manager. The map information will be automatically saved with the manager.
This method returns the instance of IlvMapInfo
that was previously attached to the manager or 0
if none. It also notifies the listeners that have been attached to the manager by the AddMapInfoListener()
static method.
manager | The manager this map info is attached to. |
IlvMapsError IlvMapInfo::forward | ( | const IlvCoordinate & | coord, |
IlvPoint & | point | ||
) | const |
Converts a latitude and a longitude into graphic coordinates.
This member function is a convenience function that first calls the forward()
function of the projection of the map information, and then the toViews()
function of the adapter.
coord | The geographic coordinates to be converted. |
point | Stores the graphic coordinates of the point. |
IlvProjection::forward()
.
|
static |
Returns the map information that is attached to the specified manager.
This static function is a convenience function that returns the instance of IlvMapInfo
that is attached to manager, or a null pointer if no map information is attached to it.
manager | The manager which map information is to be returned. |
IlvMapInfo
. const IlvMapAdapter* IlvMapInfo::getAdapter | ( | ) | const |
Returns the adapter of the map information.
The adapter is used to convert coordinates expressed in the geographic Cartesian coordinate system (that is, projected latitude and longitude) into points in a manager coordinate system.
IlvManager* IlvMapInfo::getManager | ( | ) | const |
Returns the manager that this map info is attached to.
const IlvProjection* IlvMapInfo::getProjection | ( | ) | const |
Returns the projection of the map information.
The projection is used to convert latitude and longitude into a Cartesian coordinate system.
Returns the cartographic scale of the view.
The scale is the ratio between the size of the objects drawn in view and the size of these objects in the geographic Cartesian coordinate system, which could be called the real size of these objects.
getScale()
() method tries to determine this size, but the platform API to get this size often returns inaccurate results. For a more precise scale management, you can specify the size of the screen using the SetScreenSize()
static function. view | The view for which the scale is to be computed. |
const IlvUnitConverter* IlvMapInfo::getUnitConverter | ( | ) | const |
Returns the unit converter of the map information.
The unit converter is used to convert distances in the geographic Cartesian coordinate system into meters.
IlvMapsError IlvMapInfo::inverse | ( | const IlvPoint & | point, |
IlvCoordinate & | coord | ||
) | const |
Converts graphic coordinates into geographic coordinates.
This member function is a convenience function that calls first the fromViews()
function of the adapter of the map information, and then the inverse()
function of the projection.
point | The graphic coordinates to be converted. |
coord | Stores the geographic coordinates of the point. |
IlvProjection::inverse()
. IlvMapsError IlvMapInfo::inverse | ( | const IlvEvent & | event, |
const IlvView * | view, | ||
IlvCoordinate & | coord | ||
) | const |
Computes the longitude and latitude of the mouse event event that occurred in view. The result is stored in coord.
IlvMapInfo
is not attached to the manager of the view. event | The mouse event. |
view | The view in which the event occurred. |
coord | Stores the result of the computation. |
IlvProjection::inverse()
.
|
static |
Removes specified listener to the notification list of the specified manager.
Removes listener from the list of listeners that will be notified about the map information changes that occur to manager.
manager | The target manager. |
listener | The listener to be removed. |
Sets the scale of view to scale. In the following example scale is set to 1/50,000th.
view | The view which scale is to be set. |
scale | The scale to be set. |
redraw | If IlTrue , an immediate refresh of the view is performed. If IlFalse , this method only affects the transformer of the view. If not specified, this defaults to IlTrue . |
|
static |
Specifies the height and the width of the display screen for a more accurate scale management.
display | The display. |
heightmm | The height of the screen, in millimeters. |
widthmm | The width of the screen, in millimeters. |
IlvMapsError IlvMapInfo::toViews | ( | const IlvCoordinate & | data, |
const IlvProjection * | sourceProjection, | ||
IlvPoint & | result | ||
) | const |
Converts a coordinate expressed in a source projection into the manager coordinate system, after having applied the projection of the map info.
data | The coordinate to be translated, expressed in the source projection. |
sourceProjection | The projection of data. If this parameter is set to 0 , the function assumes that data is expressed in the mapinfo projection. |
result | Stores the result of the translation. |
© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.