Key Concepts

Home
Copyright & Disclaimer
Installation
Object Hierachy
Key Concepts
Main Features
Using the Component
Upgrading

TGlobe displays geographical data (longitude, latitude coordinates) in the form of points, lines or polygons. A TGeoDataObject stores this data in one or more ordered lists or chains of long, lat points.

Each layer contains an object derived from TGlobeObjectSource. This object is where the TGeoDataObjects are stored. There are currently 4 derived objects which are used to read data from industry standard data files such as MapInfo .MIF and ESRI .SHP files as well as the TGlobe .LYR files plus a database reader which can read objects from a database table as a series of point objects.

The idea behind TGlobeObjectSource is to allow the objects to have an independence from the Layer object. This allows the same TGlobeObjectSource to be shared by two or more Layers on different Globe objects.

The TGlobeObjectSource represents a collection of Globe Objects. These Globe Objects can be sourced from a data file or a database table. Alternatively, you can create TGeoDataObjects on the fly and add them to an existing TGlobeObjectSource.

A Layer is used to display the GlobeObjects held by the TGlobeObjectSource. The Layer contains Presenters that will be used to control how the GlobeObjects are displayed. Therefore different Layers sharing the same TGlobeObjectSource can display the data in different ways.

When you create a Layer it also creates a single TGlobeObjectSource that you can immediately use to store your 'on the fly' created TGlobeObjects. These objects are just held in memory and will be destroyed when the layer is destroyed. If you want to persist the objects then you will have to save them to a .LYR file using the WriteLayerToLYRfile() function in the TGLYRMapper unit. In the future it will be possible to save the GlobeObject data to .MIF or .SHP files.

The TGlobeObjectSource descendants TGlobeMIFReader and TGlobeSHPReader work directly with the .MIF and .SHP files, they do not convert the files to .LYR format.

The TGlobeObjectSource has a certain amount of independence to the Layer. Since more than one Layer can share a TGlobeObjectSource the TGlobeObjectSource is reference counted and so only gets destroyed when the last Layer referring to it is destroyed.

To control how an object is displayed, each object has a PresenterID property. This PresenterID is used to associate a Globe Object with a Presenter object.

The Presenters control the attributes used to display the data, for example the TPointPresenter displays a TGeoDataObject as a Point object. This point can be displayed as a font character, an icon or a symbol such as a circle, triangle or square.

There are a number of lists of Presenters; each TGlobe object has a Global Presenter List and each Layer has a Presenter List. The TGlobeObjectSource also contains a Presenter List, this list holds the default Presenters for the objects in the TGlobeObjectSource. When the Layer comes to display the objects it first looks on its own Presenter List for a Presenter with a matching PresenterID. If it cannot find a matching Presenter it then checks the Global Presenter List and if a match is still not found it finally checks the TGlobeObjectSource Presenter list. If after all that there is no matching Presenter then the object is told to render itself without the aid of a Presenter.

If you create a presenter with an ID of 0 then is automatically gets assigned a unique ID when it is added to the Presenter List. You can then use this ID to update your objects.

The way a TGeoDataObject renders itself when there is no Presenter depends on the state of its Closed property and the number of points associated with the object. If only the Centroid property is set and there are no points stored in the Chains property then the object is displayed as a single point. Otherwise if the Closed property is True then the object appears as a filled polygon or as a polyline if the Closed property is false.

By default TGlobe double buffers the layer data before displaying the component image. This means that the image is first rendered to an image held in memory which is then copied or ‘blitted’ to the screen. This gives the component a smooth update as it is interacted with.

The double buffering means that there are two occasions when the application can paint extra information onto the component's surface. The first is during the OnRender event. This event occurs just after all of the data layers have been rendered to the internal buffer but before the image is blitted to the screen. The second opportunity is during the OnPaint event which happens just after the image has been copied to the screen.

TGlobe has the ability to display the data layers using different Projections. The default projection is the Spherical projection but it is easy to switch to other projections such as a Cartesian or Mercator projection. New projections can be developed and the component comes with a selection of additional projections.

The Profile mechanism has been deleted from Version 4 and replaced with an Environment file. The Environment file holds much more information about the state of the Globe object including the global presenters and the layer presenters. The Environment file is store using XML. When this file is re-loaded the Globe is returned to exactly the state it was in when the Environment was saved.

 

Email: tglobe@iname.com
Home Page: http://www.tglobe.com
Last Modified on: 01 January, 2001