GL Studio C++ Runtime API
gls_map_symbology_data_source.h
Go to the documentation of this file.
1 /*! \file
2  \brief The disti::MapSymbologyDataSource 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_GLSMAPSYMBOLOGYDATASOURCE_H
41 #define INCLUDED_GLSMAPSYMBOLOGYDATASOURCE_H
42 
43 #include "dynamic_array.h"
44 #include "gls_cpp_lang_support.h"
45 #include "gls_map_util.h"
46 
47 namespace disti
48 {
49 class DisplayObject;
50 class GlsMapView;
51 class GlsMapSymbology;
52 
53 /** abstract interface to the symbology data
54  * This interface allows the user to define a new data source to
55  * substitute their data for the standard symbology data source.
56  * More than one GlsMapSymbology may reference a single MapSymbologyDataSource
57  */
59 {
60 public:
61  typedef long IconID;
62  typedef long PathID;
63 
66 
67  /// Constructor
68  GlsMapSymbologyDataSource() {} // = default
69 
70  /// Destructor
71  virtual ~GlsMapSymbologyDataSource() {} // = default
72 
73  /// Returns the list of symbols (icons and paths) that are visible in the given region.
74  virtual void GetSymbolsInRegion( disti::GlsMapSymbology* symbology, const disti::GeoRect& region, IconIDList& icons, PathIDList& paths ) = 0;
75 
76  /// Returns the DisplayObject to use for rendering the given icon or NULL if no icon should be drawn
77  /// \param iconID Must be a valid icon ID (obtained from GetSymbolsInRegion())
78  /// \param symbology symbology group that contains the DisplayObject that will be used to draw the given icon.
79  virtual disti::DisplayObject* GetIconGeometry( IconID iconID, disti::GlsMapSymbology* symbology ) = 0;
80 
81  /// Get the location of the given point
82  /// \param iconID Must be a valid icon ID (obtained from GetSymbolsInRegion())
83  /// \param locationOut Will contain the location of the icon after the method returns
84  virtual void GetIconLocation( IconID iconID, disti::GeoCoord& locationOut ) = 0;
85 
86  /// Returns the DisplayObject to use for rendering the path or NULL
87  /// to use the default path rendering
88  virtual disti::DisplayObject* GetPathGeometry( PathID pathID, disti::GlsMapSymbology* symbology ) = 0;
89 
90  /// Returns the number of points that make up the path
91  virtual long GetPathPointCount( PathID pathID ) = 0;
92 
93  /// Returns the location of the given point in the path
94  virtual void GetPathPointLocation( PathID pathID, long pointNum, disti::GeoCoord& locationOut ) = 0;
95 
96  /// Called immediately before each icon is drawn to allow the data source to make changes to the geometry if desired
97  virtual void SetupIconForRendering( disti::GlsMapSymbology* symbology, IconID iconID, disti::DisplayObject* iconGeometry ) = 0;
98 
99  /// Called immediately before each path is drawn to allow the data source to make changes to the geometry if desired
100  virtual void SetupPathForRendering( disti::GlsMapSymbology* symbology, PathID pathID, disti::DisplayObject* pathGeometry ) = 0;
101 
102  /// Called after all the symbols have been drawn to allow the
103  /// data source to perform additional rendering if needed.
104  virtual void PostDraw( disti::GlsMapView* view, disti::GlsMapSymbology* symbology ) = 0;
105 
106 private:
107  // Disable copying/moving for polymorphic base class
108  GlsMapSymbologyDataSource( const GlsMapSymbologyDataSource& ) DISTI_SPECIAL_MEM_FUN_DELETE;
109  void operator=( const GlsMapSymbologyDataSource& ) DISTI_SPECIAL_MEM_FUN_DELETE;
110 };
111 } // namespace disti
112 
113 #endif
The disti::DynamicArray class. A templated array of objects capable of dynamically growing...
Definition: gls_map_util.h:414
virtual long GetPathPointCount(PathID pathID)=0
Returns the number of points that make up the path.
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
virtual void GetIconLocation(IconID iconID, disti::GeoCoord &locationOut)=0
Definition: gls_map_util.h:67
GlsMapSymbologyDataSource()
Constructor.
Definition: gls_map_symbology_data_source.h:68
Utility classes for GL Studio Map toolkit.
virtual void GetSymbolsInRegion(disti::GlsMapSymbology *symbology, const disti::GeoRect &region, IconIDList &icons, PathIDList &paths)=0
Returns the list of symbols (icons and paths) that are visible in the given region.
Definition: gls_map_symbology_data_source.h:58
virtual void SetupPathForRendering(disti::GlsMapSymbology *symbology, PathID pathID, disti::DisplayObject *pathGeometry)=0
Called immediately before each path is drawn to allow the data source to make changes to the geometry...
virtual void GetPathPointLocation(PathID pathID, long pointNum, disti::GeoCoord &locationOut)=0
Returns the location of the given point in the path.
virtual ~GlsMapSymbologyDataSource()
Destructor.
Definition: gls_map_symbology_data_source.h:71
virtual disti::DisplayObject * GetIconGeometry(IconID iconID, disti::GlsMapSymbology *symbology)=0
virtual void PostDraw(disti::GlsMapView *view, disti::GlsMapSymbology *symbology)=0
Definition: gls_map_symbology.h:86
Macros and helper code to determine what subset of C++11/14/17 is available.
Definition: bmpimage.h:46
virtual disti::DisplayObject * GetPathGeometry(PathID pathID, disti::GlsMapSymbology *symbology)=0
virtual void SetupIconForRendering(disti::GlsMapSymbology *symbology, IconID iconID, disti::DisplayObject *iconGeometry)=0
Called immediately before each icon is drawn to allow the data source to make changes to the geometry...