Click or drag to resize
Ab4d.SharpEngine logo

SortedRenderingLayer Class

SortedRenderingLayer is an abstract class derived from RenderingLayer and provides base functionality for sorting items in RenderingLayers. For performance reasons the original list of RenderingItems (renderingItems) is not sorted. Instead the order of sorted objects is defined in the sortedIndexes array. Derived methods must override the and SortingType.
Inheritance Hierarchy

Namespace: Ab4d.SharpEngine.RenderingLayers
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public abstract class SortedRenderingLayer : RenderingLayer, 
	ISortedRenderingLayer

The SortedRenderingLayer type exposes the following members.

Constructors
 NameDescription
Protected methodSortedRenderingLayer Constructor
Top
Properties
 NameDescription
Public propertyIsSortingEnabled If true than sortable RenderLayers will be sorted.
Public propertyIsSortOrderDirty Gets a Boolean that specified if sort order of RenderingItems is not correct and the Sort(RenderingContext, ICamera, Boolean) method needs to be called before getting the RenderingItems.
Public propertyItem Gets a RenderingItem with the specified index
(Overrides RenderingLayerItemInt32)
Public propertySortingType Gets a RenderingLayerSortTypes that specifies when the RenderingLayer needs to be resorted.
Top
Methods
 NameDescription
Protected methodDispose Dispose
(Overrides RenderingLayerDispose(Boolean))
Protected methodDisposeSortRelatedData DisposeSortRelatedData disposes all data that is used to store and cache sort related data. This method is called when Disposing or when IsSortingEnabled is set to false.
Public methodGetEnumerator Returns an enumerator that iterates through the collection.
(Overrides RenderingLayerGetEnumerator)
Public methodGetUnsortedItems Returns a ReadOnlyCollection that is a copy of the unsorted renderingItems.
Protected methodOnRenderingLayerSortingCompleted OnRenderingLayerSortingCompleted
Public methodSort Sort items in this rendering layer.
Protected methodSortSortedIndexes Sort items in this rendering layer by setting the sortedIndexes array.
Top
Events
 NameDescription
Public eventSortingCompleted RenderingLayerSortingCompleted event is called after this RenderingLayer is sorted. It allows the code in the event handler to change the order in which objects are rendered by changing the values in the provided SortedIndexes array (note: use renderingItems.Count to get number of items because SortedIndexes.Length may be to big).
Top
Fields
 NameDescription
Protected fieldsortedIndexes When sortedIndexes is set, it represents an array of indexes that point to a sorted collection of the RenderingItems.
Top
See Also