|
||||||||||
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.DefaultInputListener
cz.cuni.jagrlib.testing.InteractiveProjection
public class InteractiveProjection
Computes 3D-to-2D transformation matrix from interactive mouse/keyboard events.
Field Summary | |
---|---|
protected double |
azimuth
View reference point azimuth ( 0.0 .. yz plane). |
protected static java.lang.String |
CATEGORY
Object category. |
protected double[] |
center
Point I'm always looking at.. |
protected double |
elevation
View reference point elevation angle (positive .. positive z-coordinate). |
protected double[] |
eye
Actual eye's position (aka VRP). |
static double |
EYE_DISTANCE
Standard eye -center distance. |
protected boolean |
first
Called for the first time? |
protected int |
height
Actual window height in pixels. |
protected boolean |
live
Mouse-move processing is switched on? |
static java.lang.String |
MATRIX
|
protected TrMatrix |
modelView
Actual model-view transform. |
protected TrMatrix |
proj
Actual projection matrix. |
static RegPiece |
reg
Static registration instance for this class. |
protected Render3D |
render
Accelerator: rendering object. |
protected static java.lang.String |
TEMPLATE_NAME
Object template identifier. |
protected double[] |
transl
Actual translation component. |
protected Trigger |
trigger1
Accelerator: notification object #1. |
protected Trigger |
trigger2
Accelerator: notification object #2. |
static double |
WHEEL_ZOOM
Zoom coefficient for one mouse-wheel "tick" minus 1.0. |
protected double |
wheelZoom
Zoom factor produces by the mouse-wheel. |
protected int |
width
Actual window width in pixels. |
protected double |
zoom
Actual result zoom factor. |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.InputListener |
---|
BUTTON1, BUTTON2, BUTTON3 |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
InteractiveProjection()
|
Method Summary | |
---|---|
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
void |
mouseButton(java.lang.Object sender,
long when,
int x,
int y,
int button,
boolean press,
int flags)
Mouse button was pressed/released. |
void |
mouseMove(java.lang.Object sender,
long when,
int x,
int y,
int flags)
Mouse pointer was moved. |
void |
mouseWheel(java.lang.Object sender,
long when,
int x,
int y,
int wheel,
int amount,
int flags)
Mouse wheel was rotated. |
void |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
void |
setWindowSize(java.lang.Object sender,
int width,
int height)
Change the window shape. |
protected void |
updateMatrix()
Assembles the projection matrix and triggers the "redraw" action. |
Methods inherited from class cz.cuni.jagrlib.DefaultInputListener |
---|
keyboard, mouseHover, windowClose |
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, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double WHEEL_ZOOM
public static final double EYE_DISTANCE
eye
-center
distance.
protected int width
protected int height
protected TrMatrix modelView
protected TrMatrix proj
protected double azimuth
0.0
.. yz plane).
protected double elevation
protected double zoom
protected double wheelZoom
protected boolean live
protected double[] transl
protected boolean first
protected Trigger trigger1
protected Trigger trigger2
protected Render3D render
protected double[] center
protected double[] eye
public static final java.lang.String MATRIX
protected static final java.lang.String TEMPLATE_NAME
protected static final java.lang.String CATEGORY
public static final RegPiece reg
Constructor Detail |
---|
public InteractiveProjection()
Method Detail |
---|
protected void updateMatrix()
public void setWindowSize(java.lang.Object sender, int width, int height)
setWindowSize
in interface InputListener
setWindowSize
in class DefaultInputListener
width
- Horizontal window size in pixels.height
- Vertical window size in pixels.sender
- Originator of the eventpublic void mouseButton(java.lang.Object sender, long when, int x, int y, int button, boolean press, int flags)
mouseButton
in interface InputListener
mouseButton
in class DefaultInputListener
when
- System time in milliseconds.x
- Horizontal screen position in pixels.y
- Vertical screen position in pixels.button
- Button number (InputListener.BUTTON1
, etc.).press
- Was it press or release?flags
- Input system status (key shifts/alts, ..).sender
- Originator of the eventpublic void mouseMove(java.lang.Object sender, long when, int x, int y, int flags)
mouseMove
in interface InputListener
mouseMove
in class DefaultInputListener
sender
- Originator of the eventwhen
- System time in milliseconds.x
- Horizontal screen position in pixels.y
- Vertical screen position in pixels.flags
- Input system status (key shifts/alts, ..).public void mouseWheel(java.lang.Object sender, long when, int x, int y, int wheel, int amount, int flags)
mouseWheel
in interface InputListener
mouseWheel
in class DefaultInputListener
sender
- Originator of the eventwhen
- System time in milliseconds.x
- Horizontal screen position in pixels.y
- Vertical screen position in pixels.wheel
- Wheel number (InputListener.BUTTON1
, etc.).amount
- Rotation angle (positive number means down - or towards the user).flags
- Input system status (key shifts/alts, ..).public void set(java.lang.String key, java.lang.Object value)
set
in interface Property
set
in class DefaultProperty
key
- Key string.value
- The new value.Property.commit()
public java.lang.Object get(java.lang.String key)
get
in interface Property
get
in class DefaultProperty
key
- Key string.
null
>.public static int setTemplate(Template t, int ord)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |