C# 클래스 SurfaceToTUIO.App1

This is the main type for your application.
상속: Microsoft.Xna.Framework.Game
파일 보기 프로젝트 열기: touchcoder/SurfaceToTUIO 1 사용 예제들

Private Properties

프로퍼티 타입 설명
InitializeSurfaceInput void
OnAffine2DDelta void
OnAffine2DManipulationCompleted void
OnAffine2DManipulationStarted void
OnApplicationActivated void
OnApplicationDeactivated void
OnApplicationPreviewed void
SetWindowOnSurface void

공개 메소드들

메소드 설명
App1 ( ) : System

Default constructor.

addManipulationProcessor ( Contact c ) : void

Each Contact gets its own ManipulationProcessor assigned This way we can use the Manipulator data even if there are multiple Contacts

cleanHistory ( int id ) : void

Removes all unnecessary entries from the history Dictionaries

cleanManipulationProcessorList ( List removedContacts ) : void

Removes ManipulationProcessor assigned to removed Contacts

computeAngularVelocity ( Contact currentContact, Contact previousContact, float &angularVelocity, float &angularAcceleration ) : void

Computes the angular velocity and the angular acceleration of a Contact The unit for the velocity is: Rotations / Seconds The unit for the acceleration is: Rotations / Seconds^2

getMotionAcceleration ( int id, float &acceleration, long frameTimestamp ) : void

If possible, computes the motion acceleration This is done by subtracting the preceding Contact velocity from the current contact velocity, devided by the time delta The unit is acceleration is: Screen Dimesion / Seconds^2

getVelocity ( int id, float &velocityX, float &velocityY, InteractiveSurface surface ) : void

Retrieve the movement velocity of a Contact The data is taken from a ManipulationProcessor linked to the Contact The final unit is: SurfaceDimension / Seconds

processContactManipulator ( Contact c, ReadOnlyContactCollection currentContacts, ReadOnlyContactCollection previousContacts ) : void
sendTUIO_2DBlb ( List contacts, ReadOnlyContactCollection previousContacts ) : void

Sends a /tuio/2Dblb message The remote Host is specified in the appConfig The message is built according to TUIO 1.1 specifications (see http://www.tuio.org/?specification)

sendTUIO_2DCur ( List contacts, ReadOnlyContactCollection previousContacts ) : void

Sends a /tuio/2Dcur message The remote Host is specified in the appConfig The message is built according to TUIO 1.1 specifications (see http://www.tuio.org/?specification)

sendTUIO_2DObj ( List contacts, ReadOnlyContactCollection previousContacts ) : void

Sends a /tuio/2Dobj message The remote Host is specified in the appConfig The message is built according to TUIO 1.1 specifications (see http://www.tuio.org/?specification)

updateHistoryData ( int id, long frameTimestamp ) : void

Updates the history data needed for computing Contact velocities

보호된 메소드들

메소드 설명
Draw ( GameTime gameTime ) : void

This is called when the app should draw itself.

Initialize ( ) : void

Allows the app to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well.

LoadContent ( ) : void

Load your graphics content.

UnloadContent ( ) : void

Unload your graphics content.

Update ( GameTime gameTime ) : void

Main application Logic We retrieve the current Contacts and send TUIO messages accordingly You can specify via appConfig if you want a Finger Contact to be sent as /tuio/2Dcur or /tuio/2Dblb Sending it as /tuio/2Dblb conserves the Contact size, rotation, angular velocity and angular acceleration

비공개 메소드들

메소드 설명
InitializeSurfaceInput ( ) : void

Initializes the surface input system. This should be called after any window initialization is done, and should only be called once.

OnAffine2DDelta ( object sender, Affine2DOperationDeltaEventArgs e ) : void

Extract the Manipulation Data and write it into our Dictionary

OnAffine2DManipulationCompleted ( object sender, Affine2DOperationCompletedEventArgs e ) : void

Unused

OnAffine2DManipulationStarted ( object sender, Affine2DOperationStartedEventArgs e ) : void

Unused

OnApplicationActivated ( object sender, EventArgs e ) : void

This is called when application has been activated.

OnApplicationDeactivated ( object sender, EventArgs e ) : void

This is called when application has been deactivated.

OnApplicationPreviewed ( object sender, EventArgs e ) : void

This is called when application is in preview mode.

SetWindowOnSurface ( ) : void

Moves and sizes the window to cover the input surface.

메소드 상세

App1() 공개 메소드

Default constructor.
public App1 ( ) : System
리턴 System

Draw() 보호된 메소드

This is called when the app should draw itself.
protected Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Provides a snapshot of timing values.
리턴 void

Initialize() 보호된 메소드

Allows the app to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well.
protected Initialize ( ) : void
리턴 void

LoadContent() 보호된 메소드

Load your graphics content.
protected LoadContent ( ) : void
리턴 void

UnloadContent() 보호된 메소드

Unload your graphics content.
protected UnloadContent ( ) : void
리턴 void

Update() 보호된 메소드

Main application Logic We retrieve the current Contacts and send TUIO messages accordingly You can specify via appConfig if you want a Finger Contact to be sent as /tuio/2Dcur or /tuio/2Dblb Sending it as /tuio/2Dblb conserves the Contact size, rotation, angular velocity and angular acceleration
protected Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
리턴 void

addManipulationProcessor() 공개 메소드

Each Contact gets its own ManipulationProcessor assigned This way we can use the Manipulator data even if there are multiple Contacts
public addManipulationProcessor ( Contact c ) : void
c Contact Contact to add the Manipulator to
리턴 void

cleanHistory() 공개 메소드

Removes all unnecessary entries from the history Dictionaries
public cleanHistory ( int id ) : void
id int Contact Id that is no longer active
리턴 void

cleanManipulationProcessorList() 공개 메소드

Removes ManipulationProcessor assigned to removed Contacts
public cleanManipulationProcessorList ( List removedContacts ) : void
removedContacts List
리턴 void

computeAngularVelocity() 공개 메소드

Computes the angular velocity and the angular acceleration of a Contact The unit for the velocity is: Rotations / Seconds The unit for the acceleration is: Rotations / Seconds^2
public computeAngularVelocity ( Contact currentContact, Contact previousContact, float &angularVelocity, float &angularAcceleration ) : void
currentContact Contact
previousContact Contact
angularVelocity float Output parameter for the angular velocity
angularAcceleration float Output parameter for the angular acceleration
리턴 void

getMotionAcceleration() 공개 메소드

If possible, computes the motion acceleration This is done by subtracting the preceding Contact velocity from the current contact velocity, devided by the time delta The unit is acceleration is: Screen Dimesion / Seconds^2
public getMotionAcceleration ( int id, float &acceleration, long frameTimestamp ) : void
id int Contact ID
acceleration float Output parameter
frameTimestamp long Timestamp of the current Contact
리턴 void

getVelocity() 공개 메소드

Retrieve the movement velocity of a Contact The data is taken from a ManipulationProcessor linked to the Contact The final unit is: SurfaceDimension / Seconds
public getVelocity ( int id, float &velocityX, float &velocityY, InteractiveSurface surface ) : void
id int Contact Id
velocityX float Output parameter
velocityY float Output parameter
surface InteractiveSurface Object representing the Surface
리턴 void

processContactManipulator() 공개 메소드

public processContactManipulator ( Contact c, ReadOnlyContactCollection currentContacts, ReadOnlyContactCollection previousContacts ) : void
c Contact
currentContacts ReadOnlyContactCollection
previousContacts ReadOnlyContactCollection
리턴 void

sendTUIO_2DBlb() 공개 메소드

Sends a /tuio/2Dblb message The remote Host is specified in the appConfig The message is built according to TUIO 1.1 specifications (see http://www.tuio.org/?specification)
public sendTUIO_2DBlb ( List contacts, ReadOnlyContactCollection previousContacts ) : void
contacts List Current active contacts
previousContacts ReadOnlyContactCollection Contacts from the previous frame
리턴 void

sendTUIO_2DCur() 공개 메소드

Sends a /tuio/2Dcur message The remote Host is specified in the appConfig The message is built according to TUIO 1.1 specifications (see http://www.tuio.org/?specification)
public sendTUIO_2DCur ( List contacts, ReadOnlyContactCollection previousContacts ) : void
contacts List Current active contacts
previousContacts ReadOnlyContactCollection Contacts from the previous frame
리턴 void

sendTUIO_2DObj() 공개 메소드

Sends a /tuio/2Dobj message The remote Host is specified in the appConfig The message is built according to TUIO 1.1 specifications (see http://www.tuio.org/?specification)
public sendTUIO_2DObj ( List contacts, ReadOnlyContactCollection previousContacts ) : void
contacts List Current acitve Contacts
previousContacts ReadOnlyContactCollection Contacts from the previous frame
리턴 void

updateHistoryData() 공개 메소드

Updates the history data needed for computing Contact velocities
public updateHistoryData ( int id, long frameTimestamp ) : void
id int Contact Id
frameTimestamp long Contact Frame Timestamp
리턴 void