C# 클래스 RSSWeatherLayer3D.RSSWeatherLayer3DClass

상속: GlobeCustomLayerBase, IIdentify
파일 보기 프로젝트 열기: Esri/arcobjects-sdk-community-samples 1 사용 예제들

공개 메소드들

메소드 설명
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