C# Класс RSSWeatherLayer3D.RSSWeatherLayer3DClass

Наследование: GlobeCustomLayerBase, IIdentify
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddItem ( long zipCode ) : bool
AddItem ( long zipCode, double lat, double lon ) : bool
Connect ( ) : void

connects to the RSS weather service

DeleteItem ( long zipCode ) : bool

delete an item from the dataset

Disconnect ( ) : void

disconnects from the RSS weather service

DrawImmediate ( IGlobeViewer pGlobeViewer ) : void

This is where the actual drawing takes place.

Flash ( long zipCode ) : void

specify the item to flash

GetCityNames ( ) : string[]

get a list of all citynames currently in the dataset.

Please note that since the unique ID is zipCode, it is possible to have a city name appearing more than once.

GetClassID ( System.Guid &pClassID ) : void
GetWeatherItem ( long zipCode ) : IPropertySet

This method searches for the record of the given zipcode and retunes the information as a PropertySet.

GetWeatherItem ( string cityName ) : IPropertySet

get a weather item given a city name.

a city might have more than one zipCode and therefore this method will return the first zipcOde found for the specified city name.

Hit ( int hitObjectID, ESRI pHit3D ) : void

Hit method is used to get items by interacting with the display (such as select by area). The mechanism used in here is OpenGL selection buffer. Each object is assigned with a unique id (zipCode) and is loaded to the selection buffer 'glLoadName'. The globe framework will return this ID and we will use it in order to select the items from the table.

Identify ( IGeometry pGeom ) : IArray

Identifying all the weather items falling within the given envelope

Load ( IStream pstm ) : void
RSSWeatherLayer3DClass ( ) : System

The class has only default CTor.

RefreshDB ( ) : void

Run the update thread

calling this method too frequently might end up in blockage of RSS service. The service will interpret the excessive calls as an offence and thus would block the service.

Select ( long zipCode, bool newSelection ) : void

select a weather item by its zipCode

UnselectAll ( ) : void

unselect all weather items

ZoomTo ( long zipCode ) : void

Zoom to weather item according to its zipcode

ZoomTo ( string cityName ) : void

Zoom to a weather item according to its city name

Защищенные методы

Метод Описание
OnHandleDestroyed ( EventArgs e ) : void

Приватные методы

Метод Описание
AddWeatherItem ( long zipCode, double Lat, double Lon ) : void

Makes a request against Yahoo! RSS Weather service and add update the layer's table

CreateDisplayLists ( ) : void

Create the display lists used by the layer

the cal to this method must be made from BeforeDraw, AfterDraw or DrawImmidiate. calling this method from anywhere else might end up in unexpected results since OpenGL state is not guaranteed

CreateGeographicSpatialReference ( ) : ISpatialReference

create a WGS1984 geographic coordinate system. In this case, the underlying data is in WGS1984 as well as the input required by the globe. for that reason, there is no need to reproject the data.

CreateTexture ( Bitmap bitmap ) : uint

Given a bitmap (GDI+), create for it an OpenGL texture and return its ID

in order to allow hardware acceleration, texture size must be power of two.

DrawItem ( DataRow r, double dMagnitude ) : void

draw an item on the globe's surface

the magnitude determine whether to draw the item as a dot or with the icon symbol. The determination of the magnitude threshold is empirically.

GetLayerExtent ( ) : IEnvelope

get the overall extent of the items in the layer

InitializeLocations ( ) : void

Initialize the location table. Gets the location from a featureclass

InitializeTables ( ) : void

initialize the main table used by the layer as well as the texture table. The base class calls new on the table and adds a default ID field.

InsideViewport ( double x, double y, double z, double clipNear, uint mode ) : bool

Test whether an item is inside the current viewport

given geocentric coordinate, convert it into window coordinate and then test whether it is within the current viewport

OnRedrawEventHandler ( ) : void

Globe redraw event handler.

since this method is the delegate method of an 'Invoke' call it is guaranteed to run on the main thread and therefore does not end up in making cross apartment COM calls

OnRedrawUpdateTimer ( object sender, System.Timers.ElapsedEventArgs e ) : void

Globe redraw timer event

OnUpdateTimer ( object sender, System.Timers.ElapsedEventArgs e ) : void

run the thread that does the update of the weather data

OrientBillboard ( ) : void

orient the weather icons so that it'll face the camera

PopulateLocationsTableProc ( ) : void

Load the information from the MajorCities featureclass to the locations table

ThreadProc ( ) : void

the main update thread for the layer.

Sine the layer gets the weather information from a web service which might take a while to respond, it is not logical to let the application hand while waiting for respond. Therefore, running the request on a different thread frees the application to continue working while waiting for a response. Please note that in this case, synchronization of shared resources must be addressed, otherwise you might end up getting unexpected results.

Описание методов

AddItem() публичный Метод

public AddItem ( long zipCode ) : bool
zipCode long
Результат bool

AddItem() публичный Метод

public AddItem ( long zipCode, double lat, double lon ) : bool
zipCode long
lat double
lon double
Результат bool

Connect() публичный Метод

connects to the RSS weather service
public Connect ( ) : void
Результат void

DeleteItem() публичный Метод

delete an item from the dataset
public DeleteItem ( long zipCode ) : bool
zipCode long
Результат bool

Disconnect() публичный Метод

disconnects from the RSS weather service
public Disconnect ( ) : void
Результат void

DrawImmediate() публичный Метод

This is where the actual drawing takes place.
public DrawImmediate ( IGlobeViewer pGlobeViewer ) : void
pGlobeViewer IGlobeViewer
Результат void

Flash() публичный Метод

specify the item to flash
public Flash ( long zipCode ) : void
zipCode long
Результат void

GetCityNames() публичный Метод

get a list of all citynames currently in the dataset.
Please note that since the unique ID is zipCode, it is possible to have a city name appearing more than once.
public GetCityNames ( ) : string[]
Результат string[]

GetClassID() публичный Метод

public GetClassID ( System.Guid &pClassID ) : void
pClassID System.Guid
Результат void

GetWeatherItem() публичный Метод

This method searches for the record of the given zipcode and retunes the information as a PropertySet.
public GetWeatherItem ( long zipCode ) : IPropertySet
zipCode long
Результат IPropertySet

GetWeatherItem() публичный Метод

get a weather item given a city name.
a city might have more than one zipCode and therefore this method will return the first zipcOde found for the specified city name.
public GetWeatherItem ( string cityName ) : IPropertySet
cityName string
Результат IPropertySet

Hit() публичный Метод

Hit method is used to get items by interacting with the display (such as select by area). The mechanism used in here is OpenGL selection buffer. Each object is assigned with a unique id (zipCode) and is loaded to the selection buffer 'glLoadName'. The globe framework will return this ID and we will use it in order to select the items from the table.
public Hit ( int hitObjectID, ESRI pHit3D ) : void
hitObjectID int
pHit3D ESRI
Результат void

Identify() публичный Метод

Identifying all the weather items falling within the given envelope
public Identify ( IGeometry pGeom ) : IArray
pGeom IGeometry
Результат IArray

Load() публичный Метод

public Load ( IStream pstm ) : void
pstm IStream
Результат void

OnHandleDestroyed() защищенный Метод

protected OnHandleDestroyed ( EventArgs e ) : void
e System.EventArgs
Результат void

RSSWeatherLayer3DClass() публичный Метод

The class has only default CTor.
public RSSWeatherLayer3DClass ( ) : System
Результат System

RefreshDB() публичный Метод

Run the update thread
calling this method too frequently might end up in blockage of RSS service. The service will interpret the excessive calls as an offence and thus would block the service.
public RefreshDB ( ) : void
Результат void

Select() публичный Метод

select a weather item by its zipCode
public Select ( long zipCode, bool newSelection ) : void
zipCode long
newSelection bool
Результат void

UnselectAll() публичный Метод

unselect all weather items
public UnselectAll ( ) : void
Результат void

ZoomTo() публичный Метод

Zoom to weather item according to its zipcode
public ZoomTo ( long zipCode ) : void
zipCode long
Результат void

ZoomTo() публичный Метод

Zoom to a weather item according to its city name
public ZoomTo ( string cityName ) : void
cityName string
Результат void