| GlsMap Toolkit 1.10.1

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
disti::GlsMapView Class Reference

`#include <gls_map_view.h>`

Inheritance diagram for disti::GlsMapView:

## Public Types
typedef Group | BaseClass

## Public Member Functions
| GlsMapView (bool generateInstance=false)
virtual | ~GlsMapView ()
virtual void | SetAvailableAttributes (unsigned int value)
virtual DisplayObject * | CloneObject (bool generateNames=false)
virtual void | CopyProperties (DisplayObject *src)
virtual InterfaceListType * | GetCppInterfaceDescription (InterfaceListType *addToThisList=NULL)
virtual void | GetCppInterfaceDescriptionFree (InterfaceListType *array)
virtual void | PreDraw (const OpenGLMatrices &parentMatrices, Culler &culler)
virtual void | Draw (void)
virtual DisplayObject * | Pick3D (const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices)
virtual DisplayObject * | handle (DisplayEvent *ev)
virtual void | SetValue (int spec, va_list &args)
void | SetProjectionType (ProjectionType value)
ProjectionType | GetProjectionType () const
void | MapCenterOffset (const Vector &value)
Vector | MapCenterOffset ()
void | ViewLocation (const GeoCoord &value)
GeoCoord | ViewLocation ()
void | SetProjectionOffset (const GeoCoord &value)
GeoCoord | GetProjectionOffset ()
void | ViewHeading (const float &value)
float | ViewHeading ()
void | ViewHeight (const double &value)
double | ViewHeight ()
void | ClipMap (const bool &value)
bool | ClipMap ()
DisplayObject * | GetBackgroundObject ()
const GeoRect & | GetVisibleRegion () const
void | LonLatToLogical (double lon, double lat, Vector *logical_out) const
void | GeoCoordToLogical (const GeoCoord &geo, Vector *logical) const
void | LogicalToGeoCoord (const Vector &logical, GeoCoord *geo) const
const GlsMatrixAffineD & | GetGeoToLogicalMatrix () const
double | ViewLogicalHeight (void) const
void | CalcGeoToLogicalMatrix () const
void | CalcVisibleRegion () const

## Static Public Member Functions
static DisplayObject * | CreateInstance ()

## Protected Member Functions
void | VisibleRegionCheckVert (const Vector &v, GeoRect &rect) const

## Protected Attributes
ProjectionType | _projectionType
GeoCoord | _projectionOffset
Vector | _mapCenterOffset
GeoCoord | _viewLocation
float | _viewHeading
double | _viewHeight
double | _viewLogicalHeight
bool | _clipMapView
bool | _geoToLogicalMatricesValid
GlsMatrixAffineD | _geoToLogicalMatrix
GlsMatrixAffineD | _logicalToGeoMatrix
GeoRect | _visibleRegion

## Friends
class | GlsMapViewEditor

## Detailed Description

A GLPolygon must be included as the first child under the GlsMapView. This defines a clipping area for the map display.

## Constructor & Destructor Documentation

## ◆ GlsMapView()

disti::GlsMapView::GlsMapView | ( | bool | generateInstance = `false` | ) |

Create a new GlsMapView.

Parameters

  generateInstance | Whether or not to generate an instance name for this inputdevice

## ◆ ~GlsMapView()

disti::GlsMapView::~GlsMapView | ( |  | ) |
| virtual

Destructs a GlsMapView object

## Member Function Documentation

## ◆ CalcGeoToLogicalMatrix()

void disti::GlsMapView::CalcGeoToLogicalMatrix | ( |  | ) | const

This method not normally called by user. It may change in future versions of GlsMapView.

## ◆ CalcVisibleRegion()

void disti::GlsMapView::CalcVisibleRegion | ( |  | ) | const

This method not normally called by user. It may change in future versions of GlsMapView.

## ◆ ClipMap()

void disti::GlsMapView::ClipMap | ( | const bool & | value | ) |

When true, the contents of the map will be clipped to draw only within the GlsMapView. You may want to disable this if you are using another method to clip/occlude the map.

## ◆ GeoCoordToLogical()

void disti::GlsMapView::GeoCoordToLogical | ( | const GeoCoord & | geo,
|  | Vector * | logical
| ) |  | const
| inline

Transform a GeoCoord coordinate to the GlsMapView logical coordinates

Parameters

  geo | The GeoCoord to transform
  logical | Pointer to a Vector to receive the transformed logical coordinate

## ◆ GetBackgroundObject()

DisplayObject * disti::GlsMapView::GetBackgroundObject | ( |  | ) |
| inline

Returns
  Pointer to the object that defines the plane of the map or NULL if the object is not found.

## ◆ GetGeoToLogicalMatrix()

const GlsMatrixAffineD & disti::GlsMapView::GetGeoToLogicalMatrix | ( |  | ) | const
| inline

Returns
  The matrix used by the GlsMapView to transform lon/lat coordinates to logical coordinates. This matrix may be used to transform Vectors or applied to the OpenGL modelview matrix to allow drawing by passing lon/lat coordinates directly to OpenGL. This matrix is recalculated whenever the GlsMapView is drawn.

## ◆ GetProjectionOffset()

GeoCoord disti::GlsMapView::GetProjectionOffset | ( |  | ) |
| inline

Get the projection offset that the map is viewing.

Returns
  GeoCoord current projection offset for the map being viewed

## ◆ GetVisibleRegion()

const GeoRect & disti::GlsMapView::GetVisibleRegion | ( |  | ) | const
| inline

Return a GeoRect that encompasses the visible region. If an object is outside of the visible region, it will not be drawn.

## ◆ LogicalToGeoCoord()

void disti::GlsMapView::LogicalToGeoCoord | ( | const Vector & | logical,
|  | GeoCoord * | geo
| ) |  | const

Determine the GeoCoord for a given logical coordinate.

Parameters

  geo | Vector containing the logical coordinate to transform
  logical | Pointer to a GeoCoord to receive the transformed coordinate

## ◆ LonLatToLogical()

void disti::GlsMapView::LonLatToLogical | ( | double | lon,
|  | double | lat,
|  | Vector * | logical_out
| ) |  | const

Transform a lon/lat coordinate to the GlsMapView logical coordinates

Parameters

  lon | longitude in degrees
  lat | latitude in degrees
  logical_out | Pointer to a Vector to receive the transformed logical coordinate

## ◆ MapCenterOffset()

void disti::GlsMapView::MapCenterOffset | ( | const Vector & | value | ) |

Offset that is applied to the center of the map (in logical coordinates) This does not change the geographical location being displayed by the map, but rather moves the screen position that that map center is placed at. This is the point that the map rotates around when the ViewHeading changes.

## ◆ SetProjectionOffset()

void disti::GlsMapView::SetProjectionOffset | ( | const GeoCoord & | value | ) |

Set the projection offset for this map. This does not change the geographical location being displayed by the map, but it does affect how each cell is projected.

Parameters

  value | the new offset to be used for projection

## ◆ SetProjectionType()

void disti::GlsMapView::SetProjectionType | ( | ProjectionType | value | ) |

Selects the projection type for the map. Legacy behavior (unprojected / equirectangular / plate carree) is the default.

## ◆ ViewHeading() [1/2]

float disti::GlsMapView::ViewHeading | ( |  | ) |
| inline

Get the rotation of the map in degrees (true north).

Returns
  float current rotation for the map being viewed

## ◆ ViewHeading() [2/2]

void disti::GlsMapView::ViewHeading | ( | const float & | value | ) |

Set the rotation of the map in degrees (true north).

Parameters

  value | desired map rotation

## ◆ ViewHeight()

void disti::GlsMapView::ViewHeight | ( | const double & | value | ) |

Set the height of the region that the map should display in degrees latitude. The width is determined from the height based on the aspect ratio of the view. Use this to control the the zoom level of the map Useful conversion factors: 1 degree latitude = 60 nautical miles = 111120 meters

## ◆ ViewLocation() [1/2]

GeoCoord disti::GlsMapView::ViewLocation | ( |  | ) |
| inline

Get the geographical location that the map is viewing.

Returns
  GeoCoord current geographic location for the map being viewed

## ◆ ViewLocation() [2/2]

void disti::GlsMapView::ViewLocation | ( | const GeoCoord & | value | ) |

Set the geographical location that the map is viewing.

Parameters

  value | new geographic location for the map being viewed

## ◆ ViewLogicalHeight()

double disti::GlsMapView::ViewLogicalHeight | ( | void |  | ) | const
| inline

Get the height in logical units of the background object that defines the plane of the map

Returns
  height in logical units of the background object that defines the plane of the map

The documentation for this class was generated from the following files:

- gls_map_view.h
- gls_map_view.cpp