|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.DefaultRender3D
public abstract class DefaultRender3D
Default implementation of Render3D
.
Field Summary | |
---|---|
protected TrMatrix |
compound
Compound transform matrix (model-view + projection + viewport, modelView .. no transform). |
protected int |
depthComparison
Actual depth-test comparison function. |
protected TrMatrix |
modelView
Actual model-view matrix ( null .. no transform). |
protected boolean |
mvChanged
Dirty-flag for the model-view matrix. |
protected boolean |
prChanged
Dirty-flag for the projection matrix. |
protected TrMatrix |
projection
Actual projection matrix ( null .. no transform). |
protected int |
renderStyle
Actual rendering style. |
protected int |
vpHeight
Viewport height in pixels. |
protected boolean |
vpChanged
Dirty-flag for the viewport data. |
protected int |
vpWidth
Viewport width in pixels. |
protected int |
vpX0
Viewport origin: x-coordinate. |
protected int |
vpY0
Viewport origin: y-coordinate. |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, reg, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.Render3D |
---|
DEPTH_GEQUAL, DEPTH_GREATER, DEPTH_LEQUAL, DEPTH_LESS |
Fields inherited from interface cz.cuni.jagrlib.iface.Render |
---|
LINE_CAP, LINE_CAP_BUTT, LINE_CAP_ROUND, LINE_CAP_SQUARE, LINE_JOIN, LINE_JOIN_BEVEL, LINE_JOIN_DISJOINT, LINE_JOIN_MITER, LINE_JOIN_OVERLAP, LINE_JOIN_ROUND, LINE_WIDTH, PROJECTION, RENDER_STYLE, RENDER_STYLE_FLAT, RENDER_STYLE_GOURAUD, RENDER_STYLE_LINE, RENDER_STYLE_PHONG, RENDER_STYLE_TEXTURE |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
DefaultRender3D()
|
Method Summary | |
---|---|
boolean |
fire(int type)
Redraws the image immediately. |
void |
checkMatrix()
Asserts validity of the compound matrix. |
void |
render()
3D rendering using actual parameters. |
void |
render(TrMatrix mv,
TrMatrix proj,
int style)
3D rendering using the given projection matrix. |
void |
setDepthComparison(int comp)
Sets type of depth-test comparison. |
void |
setModelView(TrMatrix mv)
Sets actual model-view matrix. |
boolean |
setProjection(double[] view,
double[] up,
double[] lookAt,
double zoom)
Sets actual projection parameters (non-mandatory). |
void |
setProjection(TrMatrix proj)
Sets actual projection matrix. |
int |
setRenderStyle(int style)
Sets actual rendering style. |
void |
setViewport(int x0,
int y0,
int width,
int height)
Sets actual viewport size. |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplate, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, get, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit, get, set |
Methods inherited from interface cz.cuni.jagrlib.Breakable |
---|
setProgressListener, stop |
Field Detail |
---|
protected int renderStyle
protected TrMatrix modelView
null
.. no transform).
protected boolean mvChanged
protected TrMatrix projection
null
.. no transform).
protected boolean prChanged
protected int vpX0
protected int vpY0
protected int vpWidth
protected int vpHeight
protected boolean vpChanged
protected TrMatrix compound
modelView
.. no transform).
protected int depthComparison
Constructor Detail |
---|
public DefaultRender3D()
Method Detail |
---|
public void setDepthComparison(int comp)
setDepthComparison
in interface Render3D
public int setRenderStyle(int style)
setRenderStyle
in interface Render3D
style
- New rendering style.
Render.RENDER_STYLE_LINE
,
Render.RENDER_STYLE_FLAT
public void setViewport(int x0, int y0, int width, int height)
glSetViewport()
.
setViewport
in interface Render3D
x0
- Viewport origin (x-coord).y0
- Viewport origin (y-coord).width
- Viewport width in pixels.height
- Viewport height in pixels.Render3D.setProjection(cz.cuni.jagrlib.TrMatrix)
public void setModelView(TrMatrix mv)
setModelView
in interface Render3D
mv
- New model-view matrix.public void setProjection(TrMatrix proj)
setProjection
in interface Render3D
proj
- New projection matrix.Render3D.setViewport(int, int, int, int)
public boolean setProjection(double[] view, double[] up, double[] lookAt, double zoom)
setProjection
in interface Render3D
view
- Viewing vector (from camera to the scene).up
- Up vector (should always point up on the screen).lookAt
- Point in the middle of the view.zoom
- Zoom factor (camera - lookAt distance, element size on the screen, etc.).
true
if the method is implemented.public void checkMatrix()
compound
matrix.
public void render()
render
in interface Render3D
setModelView(TrMatrix)
,
setProjection(TrMatrix)
,
setRenderStyle(int)
,
render(TrMatrix,TrMatrix,int)
public void render(TrMatrix mv, TrMatrix proj, int style)
render
in interface Render3D
mv
- Local model-view matrix.proj
- Local projection matrix.style
- Local rendering style.render()
public boolean fire(int type)
fire
in interface Trigger
type
- The action type (whatever it means..).
true
if the action was successful.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |