40 #ifndef INCLUDED_GLS_MAP_SYMBOLOGY_BASIC_DATA_SOURCE_H_
41 #define INCLUDED_GLS_MAP_SYMBOLOGY_BASIC_DATA_SOURCE_H_
69 inline void SetType(
int value ) { _type = value; }
90 _points.Count( value );
91 InvalidateBoundingRect();
103 _points[ point ] = location;
104 InvalidateBoundingRect();
112 inline void SetType(
int value ) { _type = value; }
120 if( !_boundingRectIsValid )
122 CalculateBoundingRect();
124 return _boundingRect;
127 inline void InvalidateBoundingRect() { _boundingRectIsValid =
false; }
129 GlsMapSymbologyBasicPath()
131 , _boundingRectIsValid( false )
135 inline void CalculateBoundingRect()
138 for(
unsigned int i = 0; i < _points.Count(); i++ )
144 DynamicArray<GeoCoord, false> _points;
146 bool _boundingRectIsValid;
147 GeoRect _boundingRect;
160 template<
class IconT,
class PathT>
180 for(
unsigned int iconIdx = 0; iconIdx < iconCount; iconIdx++ )
182 iconID = _iconIDArray[ iconIdx ];
197 for(
unsigned int pathIdx = 0; pathIdx < pathCount; pathIdx++ )
199 pathID = _pathIDArray[ pathIdx ];
214 IconT* icon =
GetIcon( iconID );
217 int geomIndex = icon->GetType();
218 if( symbology && geomIndex > -1 && ( (
unsigned int)geomIndex ) < symbology->
Count() )
220 return symbology->
Item( geomIndex );
230 IconT* icon =
GetIcon( iconID );
233 location = icon->GetLocation();
242 PathT* path =
GetPath( pathID );
245 int geomIndex = path->GetType();
246 if( geomIndex > -1 && symbology && ( (
unsigned int)geomIndex ) < symbology->
Count() )
248 return symbology->
Item( geomIndex );
258 PathT* path =
GetPath( pathID );
260 return path->GetPointCount();
268 PathT* path =
GetPath( pathID );
271 locationOut = path->GetPointLocation( point );
319 icon.SetLocation( location );
320 icon.SetType( geometryIndex );
322 IconID
id = GetNextIconID();
333 int idx = FindIconByID( iconID );
337 return &( _iconArray[ idx ] );
343 return _iconArray.
Count();
351 IconT* icon =
GetIcon( iconID );
354 icon->SetLocation( location );
364 IconT* icon =
GetIcon( iconID );
367 icon->SetLocation( location );
368 icon->SetType( geometryIndex );
381 PathID
id = GetNextPathID();
392 int idx = FindPathByID( pathID );
396 return &( _pathArray[ idx ] );
402 return _pathArray.
Count();
408 int idx = FindIconByID( iconID );
419 int idx = FindPathByID( pathID );
430 _iconArray.
Count( 0 );
431 _iconIDArray.
Count( 0 );
437 _pathArray.
Count( 0 );
438 _pathIDArray.
Count( 0 );
447 virtual ~GlsMapSymbologyBasicDataSource()
454 DynamicArray<IconT, false> _iconArray;
455 DynamicArray<IconID> _iconIDArray;
457 IconID GetNextIconID() {
return _nextIconID++; }
459 int FindIconByID( IconID
id )
461 for(
unsigned int i = 0; i < _iconIDArray.Count(); i++ )
462 if( _iconIDArray[ i ] ==
id )
468 DynamicArray<PathT, false> _pathArray;
469 DynamicArray<PathID> _pathIDArray;
471 PathID GetNextPathID() {
return _nextPathID++; }
473 int FindPathByID( PathID
id )
475 for(
unsigned int i = 0; i < _pathIDArray.Count(); i++ )
476 if( _pathIDArray[ i ] ==
id )
bool Intersects(const GeoRect &other) const
Definition: gls_map_util.h:522
unsigned int Count(void) const
Definition: group.h:173
virtual unsigned int GetIconCount()
Definition: gls_map_symbology_basic_data_source.h:341
virtual void UpdateIcon(IconID iconID, GeoCoord &location)
Definition: gls_map_symbology_basic_data_source.h:349
virtual void RemoveAllPaths()
Remove all paths from the data source.
Definition: gls_map_symbology_basic_data_source.h:435
unsigned Count() const
Definition: dynamic_array.h:204
The disti::Group class. Implements groups of objects.
The disti::MapSymbologyDataSource class.
Definition: gls_map_util.h:414
Basic icon data storage that may be used with the GlsMapSymbologyBasicDataSource class.
Definition: gls_map_symbology_basic_data_source.h:61
unsigned int GetPointCount()
Definition: gls_map_symbology_basic_data_source.h:95
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 IconT * GetIcon(IconID iconID)
Definition: gls_map_symbology_basic_data_source.h:331
DisplayObject * Item(unsigned int index)
virtual void SetupIconForRendering(GlsMapSymbology *, IconID iconID, DisplayObject *iconGeometry)
See base class.
Definition: gls_map_symbology_basic_data_source.h:276
Definition: gls_map_util.h:67
virtual void GetIconLocation(IconID iconID, GeoCoord &location)
See base class.
Definition: gls_map_symbology_basic_data_source.h:228
bool ContainsPoint(const GeoCoord &point) const
Definition: gls_map_util.h:448
Definition: gls_map_symbology_data_source.h:58
void SetToNull()
Definition: gls_map_util.h:462
Basic path data storage that may be used with the GlsMapSymbologyBasicDataSource class.
Definition: gls_map_symbology_basic_data_source.h:83
void SetLocation(const GeoCoord &value)
Set the icon location.
Definition: gls_map_symbology_basic_data_source.h:65
const GeoRect & GetBoundingRect()
return the bounding rectangle for the given path
Definition: gls_map_symbology_basic_data_source.h:118
virtual void RemovePath(PathID pathID)
Remove a path from the data source.
Definition: gls_map_symbology_basic_data_source.h:417
Definition: gls_map_symbology_basic_data_source.h:161
virtual void RemoveIcon(IconID iconID)
Remove a icon from the data source.
Definition: gls_map_symbology_basic_data_source.h:406
The disti::GlsMapSymbology class.
The standard Mouse and keyboard events and event structures.
virtual bool PathIsVisible(PathT *path)
Definition: gls_map_symbology_basic_data_source.h:306
virtual void UpdateIcon(IconID iconID, GeoCoord &location, int geometryIndex)
Definition: gls_map_symbology_basic_data_source.h:362
virtual IconID AddIcon(const GeoCoord &location, int geometryIndex)
Definition: gls_map_symbology_basic_data_source.h:315
const GeoCoord & GetLocation()
Get the icon location.
Definition: gls_map_symbology_basic_data_source.h:67
int GetType()
Get the path type (geometry index)
Definition: gls_map_symbology_basic_data_source.h:115
virtual PathT * GetPath(PathID pathID)
Definition: gls_map_symbology_basic_data_source.h:390
const GeoCoord & GetPointLocation(int point)
Definition: gls_map_symbology_basic_data_source.h:108
virtual void SetupPathForRendering(GlsMapSymbology *, PathID pathID, DisplayObject *iconGeometry)
See base class.
Definition: gls_map_symbology_basic_data_source.h:282
virtual DisplayObject * GetPathGeometry(PathID pathID, GlsMapSymbology *symbology)
See base class.
Definition: gls_map_symbology_basic_data_source.h:238
virtual void RemoveAllIcons()
Remove all icons from the data source.
Definition: gls_map_symbology_basic_data_source.h:428
virtual PathID AddPath()
Definition: gls_map_symbology_basic_data_source.h:377
virtual bool IconIsVisible(IconT *icon)
Definition: gls_map_symbology_basic_data_source.h:299
void SetPointCount(unsigned int value)
Definition: gls_map_symbology_basic_data_source.h:88
virtual void GetPathPointLocation(PathID pathID, long point, GeoCoord &locationOut)
See base class.
Definition: gls_map_symbology_basic_data_source.h:266
unsigned PushBack(const T &object)
Definition: dynamic_array.h:325
Definition: gls_map_symbology.h:86
bool EraseAt(const unsigned index)
Definition: dynamic_array.h:409
virtual long GetPathPointCount(PathID pathID)
See base class.
Definition: gls_map_symbology_basic_data_source.h:256
virtual unsigned int GetPathCount()
Definition: gls_map_symbology_basic_data_source.h:400
void GrowToContainPoint(const GeoCoord &point)
Definition: gls_map_util.h:493
void SetPointLocation(int point, const GeoCoord &location)
Definition: gls_map_symbology_basic_data_source.h:101
virtual void GetSymbolsInRegion(GlsMapSymbology *symbology, const GeoRect ®ion, IconIDList &icons, PathIDList &paths)
See base class.
Definition: gls_map_symbology_basic_data_source.h:169
void SetType(int value)
Set the icon type (geometry index)
Definition: gls_map_symbology_basic_data_source.h:69
Definition: bmpimage.h:46
virtual void PostDraw(disti::GlsMapView *view, disti::GlsMapSymbology *symbology)
See base class.
Definition: gls_map_symbology_basic_data_source.h:288
int GetType()
Get the icon type (geometry index)
Definition: gls_map_symbology_basic_data_source.h:71
virtual DisplayObject * GetIconGeometry(IconID iconID, GlsMapSymbology *symbology)
See base class.
Definition: gls_map_symbology_basic_data_source.h:210
void SetType(int value)
Definition: gls_map_symbology_basic_data_source.h:112