|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.pipeline.graphics.StateSortComparator
public class StateSortComparator
A comparator that provides the mechanics for state sorting, given configurable priority listing.
Since this is a comparator, the basic sorting algorithm will be capped at O(n log n) as given by the lower bounds for any comparison-based sort.
The following rules are used for comparing objects of the same type:
Bias towards objects with state first over objects with no state. Thus given two objects a and b. If b is null, a is greater than b and return +1. If a is null and b is non null, return -1.
Where no explicit test is defined, use a per-object test with it's
appropriate compareTo()
method. If the method returns 0 then
continue on with the next in the priority order, otherwise exit with the
appropriate state set.
Field Summary | |
---|---|
static int |
BLEND_ATTRIBS
Priority state is checking blend attributes. |
static int |
CLIP_PLANES
Priority state is checking clip planes |
static int |
DEPTH_ATTRIBS
Priority state is checking depth buffer attributes |
static int |
FRAGMENT_SHADERS
Priority state is fragment shaders |
static int |
LIGHTS
Priority state is lights |
static int |
LINE_ATTRIBS
Priority state is checking line attributes |
static int |
LOCAL_FOG
Priority state is checking local fog |
static int |
MATERIALS
Priority state is material values |
static int |
POINT_ATTRIBS
Priority state is checking point attributes |
static int |
POLYGON_ATTRIBS
Priority state is checking polygon attributes |
static int |
SHADER_OBJECTS
Priority state is shader objects (ie GL 1.5/2.0) |
static int |
STENCIL_ATTRIBS
Priority state is checking stencil buffer attributes |
static int |
TEXTURE_UNIT_0
Priority state is texture unit 0 |
static int |
TEXTURE_UNIT_1
Priority state is texture unit 1 |
static int |
TEXTURE_UNIT_2
Priority state is texture unit 2 |
static int |
TEXTURE_UNIT_3
Priority state is texture unit 3 |
static int |
VERTEX_SHADERS
Priority state is vertex shaders |
Constructor Summary | |
---|---|
StateSortComparator()
Construct an instance of this comparator using the default priority settings. |
|
StateSortComparator(int[] priList)
Construct an instance of this comparator given the listed set of priorities. |
Method Summary | |
---|---|
int |
compare(GraphicsCullOutputDetails cd1,
GraphicsCullOutputDetails cd2)
Compares its two arguments for order. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this Comparator by checking to see if it is the same class instance, and then if the priority listing between the two is the same. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LIGHTS
public static final int MATERIALS
public static final int FRAGMENT_SHADERS
public static final int VERTEX_SHADERS
public static final int SHADER_OBJECTS
public static final int POLYGON_ATTRIBS
public static final int LINE_ATTRIBS
public static final int POINT_ATTRIBS
public static final int BLEND_ATTRIBS
public static final int CLIP_PLANES
public static final int LOCAL_FOG
public static final int DEPTH_ATTRIBS
public static final int STENCIL_ATTRIBS
public static final int TEXTURE_UNIT_0
public static final int TEXTURE_UNIT_1
public static final int TEXTURE_UNIT_2
public static final int TEXTURE_UNIT_3
Constructor Detail |
---|
public StateSortComparator()
public StateSortComparator(int[] priList)
priList
- The listing of priorities to useMethod Detail |
---|
public int compare(GraphicsCullOutputDetails cd1, GraphicsCullOutputDetails cd2)
compare
in interface java.util.Comparator<GraphicsCullOutputDetails>
cd1
- The first object to be comparedcd2
- The second object to be compared
java.lang.ClassCastException
- Can't be compared as the types are wrongpublic boolean equals(java.lang.Object obj)
equals
in interface java.util.Comparator<GraphicsCullOutputDetails>
equals
in class java.lang.Object
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |