GL Studio C++ Runtime API
gls_map_grid.h
Go to the documentation of this file.
1 /*! \file
2  \brief The disti::GlsMapGrid class.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2017 The DiSTI Corporation.<br>
7  11301 Corporate Blvd; Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38 
39 */
40 #ifndef INCLUDED_GLSMAPGRID_H
41 #define INCLUDED_GLSMAPGRID_H
42 
43 #include "display.h"
44 #include "events.h"
45 #include "gls_map_util.h"
46 #include "gls_map_view.h"
47 
48 //////////////////// Provides support for creating DLLs ////////////////////////
49 #if( defined( GLSGEN_EXPORT_GLSMAPGRID ) || defined( GLSGEN_IMPORT_GLSMAPGRID ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
50  && defined( _MSC_VER )
51 # if defined( GLSGEN_EXPORT_GLSMAPGRID ) || defined( GLS_EXPORT_GENERATED )
52 # define GLSGEN_GLSMAPGRID_EXPORT __declspec( dllexport )
53 # else
54 # define GLSGEN_GLSMAPGRID_EXPORT __declspec( dllimport )
55 # endif
56 #else
57 # define GLSGEN_GLSMAPGRID_EXPORT
58 #endif
59 ///////////////////////////////////////////////////////////////////////////////
60 
61 #define LIB_BASE_NAME "gls_map_toolkit"
62 #include "gls_auto_lib.h"
63 #undef LIB_BASE_NAME
64 
65 namespace disti
66 {
67 /** \brief A customizable object that allows the user to display a map grid that can be configured to measure
68  * in degrees for Latitude and Longitude, or meters for Universal Transverse Mercator (UTM) coordinate system.
69  */
70 class GlsMapGrid : public DisplayObject
71 {
72 public:
73  DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
74  typedef DisplayObject _BaseClass;
75  typedef DisplayObject BaseClass;
76  friend class GlsMapGridEditor;
77 
78  /** Create a new GlsMapGrid.
79  * \param generateInstance Whether or not to generate an instance name
80  * for this inputdevice */
81  GLSGEN_GLSMAPGRID_EXPORT GlsMapGrid( bool generateInstance = false );
82 
83  /** Destructs a GlsMapGrid object */
84  virtual GLSGEN_GLSMAPGRID_EXPORT ~GlsMapGrid();
85 
86  static GLSGEN_GLSMAPGRID_EXPORT DisplayObject* CreateInstance();
87 
88  //////////////////////////////////////////////////
89  // Overridden base class methods
90  //////////////////////////////////////////////////
91 
92  virtual GLSGEN_GLSMAPGRID_EXPORT void SetAvailableAttributes( unsigned int value );
93  virtual GLSGEN_GLSMAPGRID_EXPORT DisplayObject* CloneObject( bool generateNames = false );
94  virtual GLSGEN_GLSMAPGRID_EXPORT void CopyProperties( DisplayObject* src );
95 
96  virtual GLSGEN_GLSMAPGRID_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL );
97  virtual GLSGEN_GLSMAPGRID_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array );
98 
99  virtual GLSGEN_GLSMAPGRID_EXPORT void PreDraw( const OpenGLMatrices& parentMatrices, Culler& culler );
100  virtual GLSGEN_GLSMAPGRID_EXPORT void Draw( void );
101 
102  virtual GLSGEN_GLSMAPGRID_EXPORT DisplayObject* Pick3D( const Vector& winLoc,
103  const Vector& logicalCoords,
104  float scale,
105  const Vector& directionVector,
106  Vector& collisionWinLoc /*Returned*/,
107  const OpenGLMatrices& drawnMatrices );
108 
109  virtual GLSGEN_GLSMAPGRID_EXPORT DisplayObject* handle( DisplayEvent* ev );
110 
111  virtual GLSGEN_GLSMAPGRID_EXPORT void SetValue( int spec, va_list& args );
112 
113  //////////////////////////////////////////////////
114  // GlsMapGrid specific operations
115  //////////////////////////////////////////////////
116 
117  /** \returns pointer to the GlsMapView that the symbology will use for rendering
118  * or NULL if not found. */
120  {
121  return GetParentMapView( this );
122  }
123 
124  /** Set the default color for the lines
125  * \param value color of the line in RGBA
126  */
127  void SetColor( const glsColor& value );
128  glsColor GetColor();
129 
130  enum EGridReference
131  {
132  GRID_LAT_LON, // Default
133  GRID_UTM,
134  GRID_MGRS,
135  GRID_UTM_SINGLE
136  };
137 
138  /** Get the current grid reference */
139  EGridReference GetGridReference() const { return _referenceSystem; }
140 
141  /** Set Display Geo Lat/Lon
142  * \param gridLevel is from 1.0 arc-seconds to 20.0 degrees
143  */
144  void SetDisplayGeoLatLon( double gridLevel );
145 
146  /** Set Display in UTM (Universal Transverse Mercator) with a given grid scale (from 10m to 100,000 m)
147  * /param gridScale scale of the grid from 10m to 100,000m
148  */
149  void SetDisplayUTM( double gridScale );
150 
151  /** Set Display in UTM (Universal Transverse Mercator) over the specified zone and band with a given grid scale (from 10m to 100,000 m)
152  * /param gridScale scale of the grid from 10m to 100,000m
153  * /param zoneNumber zone to set the display in from 1 to 60
154  * /param latitudeBandLetter latitude to display
155  */
156  void SetDisplayUTM( double gridScale, int zoneNumber, char latitudeBandLetter );
157 
158 protected:
159  // The line geometry
160  DisplayObject* _defaultPathGeometry;
161 
162  // Current grid reference and scale
163  EGridReference _referenceSystem;
164  double _scale;
165  int _UTMdrawZone;
166  int _UTMdrawLatBand;
167 
168  // Grid Reference work
169  void DrawGeoLatLon();
170  void DrawGeoLatLonTransverseMercator();
171  void DrawUTM();
172  void DrawUTM( int zone, int latZoneIndex );
173 };
174 
175 } // namespace disti
176 
177 #endif
Definition: cull.h:49
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:436
Definition: dynamic_array.h:66
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:471
virtual void SetValue(int spec, va_list &args)
virtual void SetAvailableAttributes(unsigned int value)
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices)
Definition: display.h:98
The GlsMapView is a special group that controls the map view parameters. It contains all of the objec...
Definition: gls_map_view.h:86
Utility classes for GL Studio Map toolkit.
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
void SetDisplayGeoLatLon(double gridLevel)
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler)
The disti::DisplayObject class and global enumerations.
virtual DisplayObject * CloneObject(bool generateNames=false)
virtual void Draw(void)
The standard Mouse and keyboard events and event structures.
void SetColor(const glsColor &value)
A customizable object that allows the user to display a map grid that can be configured to measure in...
Definition: gls_map_grid.h:70
virtual ~GlsMapGrid()
virtual DisplayObject * handle(DisplayEvent *ev)
Definition: events.h:112
Definition: gls_color.h:53
GlsMapView * GetMapView()
Definition: gls_map_grid.h:119
GlsMapView * GetParentMapView(DisplayObject *obj)
Definition: gls_map_view.h:290
The gls_auto_lib.
void SetDisplayUTM(double gridScale)
Definition: vertex.h:84
glsColor GetColor()
The disti::GlsMapView class.
virtual void CopyProperties(DisplayObject *src)
Definition: bmpimage.h:46
EGridReference GetGridReference() const
Definition: gls_map_grid.h:139
GlsMapGrid(bool generateInstance=false)