GL Studio C++ Runtime API
gls_map_symbology.h
Go to the documentation of this file.
1 /*! \file
2  \brief The disti::GlsMapSymbology class.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2008 The DiSTI Corporation.<br>
7  11486 Corporate Blvd; Suite 190<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_GLSMAPSYMBOLOGY_H
41 #define INCLUDED_GLSMAPSYMBOLOGY_H
42 
44 #include "gls_map_view.h"
45 
46 #include "events.h"
47 #include "group.h"
48 
49 //////////////////// Provides support for creating DLLs ////////////////////////
50 #if( defined( GLSGEN_EXPORT_GLSMAPSYMBOLOGY ) || defined( GLSGEN_IMPORT_GLSMAPSYMBOLOGY ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
51  && defined( _MSC_VER )
52 # if defined( GLSGEN_EXPORT_GLSMAPSYMBOLOGY ) || defined( GLS_EXPORT_GENERATED )
53 # define GLSGEN_GLSMAPSYMBOLOGY_EXPORT __declspec( dllexport )
54 # else
55 # define GLSGEN_GLSMAPSYMBOLOGY_EXPORT __declspec( dllimport )
56 # endif
57 #else
58 # define GLSGEN_GLSMAPSYMBOLOGY_EXPORT
59 #endif
60 ///////////////////////////////////////////////////////////////////////////////
61 
62 #define LIB_BASE_NAME "gls_map_toolkit"
63 #include "gls_auto_lib.h"
64 #undef LIB_BASE_NAME
65 
66 namespace disti
67 {
68 class GlsMapSymbologyStdDataSource;
69 
70 /** The GlsMapSymbology class is a Group that contains a collection of DisplayObjects
71  * that can be thought of as 'icon templates'. When drawing, the MapSymbologyLayer will query
72  * it's MapSymbologyDataSource for the list of visible icons and paths, then render them to
73  * the map using the icon templates. The MapSymbologyDataSource interface is simple, while
74  * still allowing the MapSymbologyDataSource the ability to override the appearance
75  * of icons and paths.
76  *
77  * When a new GlsMapSymbology instance is first created, it will create it's
78  * own GlsMapSymbologyStdDataSource which provides an interface for the user to create/update icons and paths
79  * without having to write their own MapSymbologyDataSource class. While this class provides
80  * much of the common functionality that is needed, some users will still want to create their
81  * own MapSymbologyDataSource to provide the best performance when working with their own datasets.
82  * These users have the option of deriving from the BasicDataSource class (a template class which
83  * provides basic functionality) or deriving directly from MapSymbologyDataSource interface
84  * to optimize all of the MapSymbologyDataSource code for their data set.
85  */
86 class GlsMapSymbology : public Group
87 {
88 public:
89  DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
90  typedef Group _BaseClass;
91  typedef Group BaseClass;
92  friend class GlsMapSymbologyEditor;
93 
94  /** Create a new GlsMapSymbology.
95  * \param generateInstance Whether or not to generate an instance name
96  * for this inputdevice */
97  GLSGEN_GLSMAPSYMBOLOGY_EXPORT GlsMapSymbology( bool generateInstance = false );
98 
99  /** Destructs a GlsMapSymbology object */
100  virtual GLSGEN_GLSMAPSYMBOLOGY_EXPORT ~GlsMapSymbology();
101 
102  static GLSGEN_GLSMAPSYMBOLOGY_EXPORT DisplayObject* CreateInstance();
103 
104  //////////////////////////////////////////////////
105  // Overridden base class methods
106  //////////////////////////////////////////////////
107 
108  virtual GLSGEN_GLSMAPSYMBOLOGY_EXPORT void SetAvailableAttributes( unsigned int value );
109  virtual GLSGEN_GLSMAPSYMBOLOGY_EXPORT DisplayObject* CloneObject( bool generateNames = false );
110  virtual GLSGEN_GLSMAPSYMBOLOGY_EXPORT void CopyProperties( DisplayObject* src );
111 
112  virtual GLSGEN_GLSMAPSYMBOLOGY_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL );
113  virtual GLSGEN_GLSMAPSYMBOLOGY_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array );
114 
115  virtual GLSGEN_GLSMAPSYMBOLOGY_EXPORT void PreDraw( const OpenGLMatrices& parentMatrices, Culler& culler );
116  virtual GLSGEN_GLSMAPSYMBOLOGY_EXPORT void Draw( void );
117 
118  virtual GLSGEN_GLSMAPSYMBOLOGY_EXPORT DisplayObject* Pick3D( const Vector& winLoc,
119  const Vector& logicalCoords,
120  float scale,
121  const Vector& directionVector,
122  Vector& collisionWinLoc /*Returned*/,
123  const OpenGLMatrices& drawnMatrices );
124 
125  virtual GLSGEN_GLSMAPSYMBOLOGY_EXPORT DisplayObject* handle( DisplayEvent* ev );
126 
127  virtual GLSGEN_GLSMAPSYMBOLOGY_EXPORT void SetValue( int spec, va_list& args );
128 
129  //////////////////////////////////////////////////
130  // GlsMapSymbology specific operations
131  //////////////////////////////////////////////////
132 
133  /** \returns pointer to the GlsMapView that the symbology will use for rendering
134  * or NULL if not found. */
136  {
137  return GetParentMapView( this );
138  }
139 
140  /** Set the MapSymbologyDataSource to use for rendering.
141  * The creator of the MapSymbologyDataSource instance is responsible for deleting it.
142  * \param database Pointer to the MapSymbologyDataSource to use
143  */
144  virtual void SetDataSource( GlsMapSymbologyDataSource* database );
145 
146  /** Returns the MapSymbologyDataSource that this object is using.
147  * This may be the default GlsMapSymbologyStdDataSource or another data source
148  * that was provided using the SetDataSource() method.
149  * \returns pointer to the MapSymbologyDataSource this GlsMapSymbology is using. */
150  inline GlsMapSymbologyDataSource* GetDataSource() { return _dataSource; }
151 
152  /** \returns pointer to the GlsMapSymbologyStdDataSource for this symbology or
153  * NULL if another type of data source is being used. */
155 
156  /** Utility method that can be called by the user from the GlsMapView event callback
157  * to determine if any symbols were picked. If the method returns true,
158  * then iconsHit and pathsHit will contain the list of icons and paths
159  * that were picked.
160  * NOTE: This method uses the generic MapSymbologyDataSource interface in it's picking
161  * algorithm. If you are using a derived DataSource class that has it's own picking
162  * method, it will probably be faster than this method.
163  * \param view The GlsMapView that was picked
164  * \param lev A LocationEvent indicating the point that was picked
165  * \param iconsHit IconIDList to receive the list of icons that were picked
166  * \param pathsHit PathIDList to receive the list of paths that were picked
167  * \returns true if an icon or path was picked */
169 
170  /** Set the default color for path lines
171  * This is only used if the MapSymbologyDataSource does not
172  * provide geometry for the paths */
173  void SetDefaultPathColor( const glsColor& value );
174  glsColor GetDefaultPathColor();
175 
176 protected:
177  GlsMapSymbologyDataSource* _dataSource;
178  GlsMapSymbologyStdDataSource* _internalDataSource;
179 
180  DisplayObject* _defaultPathGeometry;
181 };
182 
183 } // namespace disti
184 
185 // Included after GlsMapSymbology has been defined
188 
189 #endif
Definition: cull.h:49
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:436
The disti::GlsMapSymbologyStdDataSource class.
Definition: dynamic_array.h:66
The disti::Group class. Implements groups of objects.
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:471
virtual DisplayObject * CloneObject(bool generateNames=false)
The disti::MapSymbologyDataSource class.
virtual void CopyProperties(DisplayObject *src)
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
Definition: gls_map_symbology_data_source.h:58
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices)
Definition: events.h:139
virtual bool PickSymbols(GlsMapView *view, LocationEvent *lev, GlsMapSymbologyDataSource::IconIDList *iconsHit, GlsMapSymbologyDataSource::PathIDList *pathsHit)
GlsMapSymbology(bool generateInstance=false)
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler)
void SetDefaultPathColor(const glsColor &value)
GlsMapSymbologyStdDataSource * GetStdDataSource()
The disti::GlsMapSymbologyBasicDataSource class.
The standard Mouse and keyboard events and event structures.
virtual void Draw(void)
virtual void SetDataSource(GlsMapSymbologyDataSource *database)
GlsMapView * GetMapView()
Definition: gls_map_symbology.h:135
Definition: events.h:112
Definition: gls_color.h:53
virtual DisplayObject * handle(DisplayEvent *ev)
GlsMapView * GetParentMapView(DisplayObject *obj)
Definition: gls_map_view.h:290
Definition: gls_map_symbology_standard_data_source.h:190
The gls_auto_lib.
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
GlsMapSymbologyDataSource * GetDataSource()
Definition: gls_map_symbology.h:150
Definition: group.h:52
Definition: vertex.h:84
Definition: gls_map_symbology.h:86
virtual void SetAvailableAttributes(unsigned int value)
The disti::GlsMapView class.
Definition: bmpimage.h:46
virtual void SetValue(int spec, va_list &args)