C# Class CSharpGL.Scene

Show file Open project: bitzhuwei/CSharpGL Class Usage Examples

Private Properties

Property Type Description
ColorCodedPicking PickedGeometry>>.List
Dispose void
DisposeObject void
DisposeUI void
GetPickGeometry PickedGeometry
ReadPixels uint>>.List
Render4Picking List
RenderPickableObject void
RenderViewPort void
Tick void
UpdateObject void

Public Methods

Method Description
Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Pick ( Point mousePosition, PickingGeometryType pickingGeometryType ) : PickedGeometry>>.List

Get geometry at specified mousePosition with specified pickingGeometryType.

Returns null when mousePosition is out of this scene's area or there's no active(visible and enabled) viewport.

Render ( PickingGeometryType pickingGeometryType = PickingGeometryType.None ) : void

Render this scene.

Resize ( object sender, EventArgs e ) : void

Please bind this method to Control.Resize event.

Scene ( ICamera camera, ICanvas canvas ) : System

Manages a scene to be rendered and updated.

Start ( int maxCycle ) : void

start running scripts.

Stop ( ) : void

stop running scripts.

ToString ( ) : string

UpdateOnce ( ) : void

update once.

Private Methods

Method Description
ColorCodedPicking ( ViewPort viewPort, Rectangle pickingRect, Rectangle clientRectangle, PickingGeometryType pickingGeometryType ) : PickedGeometry>>.List

Pick primitives in specified viewPort.

Dispose ( bool disposing ) : void

Dispose managed and unmanaged resources of this instance.

DisposeObject ( SceneObject sceneObject ) : void
DisposeUI ( UIRenderer uiRenderer ) : void
GetPickGeometry ( RenderEventArgs arg, int x, int y, uint stageVertexId, List pickableRendererList ) : PickedGeometry

get picked geometry.

ReadPixels ( Rectangle target ) : uint>>.List

Read pixels in specified rect and get the VertexIds they represent.

Render4Picking ( RenderEventArgs arg ) : List

Maybe something is picked because depth buffer is valid.

Render all PickableRenderers for color-coded picking.

RenderPickableObject ( SceneObject sceneObject, RenderEventArgs arg, uint &renderedVertexCount, List pickedRendererList ) : void
RenderViewPort ( ViewPort viewPort, Rectangle clientRectangle, PickingGeometryType pickingGeometryType ) : void

render scene in every view port.

Tick ( object sender, System e ) : void
UpdateObject ( SceneObject sceneObject ) : void

Method Details

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

Pick() public method

Get geometry at specified mousePosition with specified pickingGeometryType.

Returns null when mousePosition is out of this scene's area or there's no active(visible and enabled) viewport.

public Pick ( Point mousePosition, PickingGeometryType pickingGeometryType ) : PickedGeometry>>.List
mousePosition Point mouse position in Windows coordinate system.(Left Up is (0, 0))
pickingGeometryType PickingGeometryType target's geometry type.
return PickedGeometry>>.List

Render() public method

Render this scene.
public Render ( PickingGeometryType pickingGeometryType = PickingGeometryType.None ) : void
pickingGeometryType PickingGeometryType Specify type of primitive you want to pick or nothing to pick.
return void

Resize() public method

Please bind this method to Control.Resize event.
public Resize ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void

Scene() public method

Manages a scene to be rendered and updated.
public Scene ( ICamera camera, ICanvas canvas ) : System
camera ICamera Camera of the scene
canvas ICanvas Canvas that this scene binds to.
return System

Start() public method

start running scripts.
public Start ( int maxCycle ) : void
maxCycle int /// how many times should this engine run? /// 0 means endless.
return void

Stop() public method

stop running scripts.
public Stop ( ) : void
return void

ToString() public method

public ToString ( ) : string
return string

UpdateOnce() public method

update once.
public UpdateOnce ( ) : void
return void