|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.inria.zvtm.engine.Camera
public class Camera
a Camera is used to observe the virtual space which owns it - all cameras have unique IDs, as glyph - (x,y) coordinates, observation altitude and focal distance can be changed
| Field Summary | |
|---|---|
double |
altitude
Altitude of observation (controls zoom factor). |
static float |
DEFAULT_FOCAL
|
protected double |
dx
|
protected double |
dy
|
protected double |
dz
|
double |
focal
Focal distance. |
double |
vx
Coordinates in virtual space. |
double |
vy
Coordinates in virtual space. |
protected boolean |
zile
|
protected double |
zilX
|
protected double |
zilY
|
| Method Summary | |
|---|---|
void |
addListener(CameraListener listener)
Registers a CameraListener for this Camera |
void |
altitudeOffset(double a)
Set camera altitude (relative value). |
void |
altitudeOffset(double a,
boolean repaint)
Set camera altitude (relative value). |
void |
enableCustomZoomInvariantLocation(boolean b)
Use a specific zoom-invariant point or use the camera's (x,y) coords are used (default). |
double |
getAltitude()
get camera altitude |
double[] |
getBounds()
Gets the horizontal bounds for this Camera. |
double |
getFocal()
get camera focal distance |
int |
getIndex()
get camera index (w.r.t owning virtual space) |
boolean |
getLaziness()
get camera repaint mode (eager or lazy) |
Location |
getLocation()
get camera location |
VirtualSpace |
getOwningSpace()
get virtual space owning this camera |
View |
getOwningView()
get view owning this camera |
Camera[] |
getStickedCameraArray()
return the list of cameras sticked to this camera (null if none) |
Glyph[] |
getStickedGlyphArray()
return the list of glyphs sticked to this camera (null if none) |
double |
getXspeed()
Get the camera's horizontal speed |
double |
getYspeed()
Get the camera's vertical speed |
double |
getZilX()
Get zoom-invariant point's x-coordinate in virtual space. |
double |
getZilY()
Get zoom-invariant point's y-coordinate in virtual space. |
double |
getZoomCeiling()
Get the zoom-out limit/minimum magnification (like a ceiling the camera cannot go through). |
double |
getZoomFloor()
get the zoom-in limit/maximum magnification (like a floor the camera cannot go through) default value 0 means that, at maximum magnification, the size of observed glyphs corresponds to their real size (e.g. |
double |
getZspeed()
Get the camera's zooming speed |
boolean |
isCustomZoomInvariantLocationEnabled()
Tells whether a specific zoom-invariant point is being used or if the camera's (x,y) coords are used (default). |
boolean |
isEnabled()
Tells whether the camera is enabled or disabled. |
void |
move(double x,
double y)
relative translation (offset) - will trigger a repaint, whereas directly assigning values to vx, vy will not |
void |
moveTo(double x,
double y)
absolute translation - will trigger a repaint, whereas directly assigning values to vx, vy will not |
protected void |
notifyMoved()
Sends a notification to camera listeners currently observing this Camera instance of a camera movement |
void |
propagateAltitudeChange(double alt)
Propagate this camera's altitude change to all cameras attached to it. |
void |
propagateMove(double x,
double y)
Propagate this camera's movement to all glyphs and cameras attached to it. |
void |
removeListener(CameraListener listener)
Un-registers a CameraListener for this Camera |
void |
repaint()
the content seen through this camera will be repainted in the next owning view's paint loop |
void |
setAltitude(double a)
Set camera altitude (absolute value). |
void |
setAltitude(double a,
boolean repaint)
Set camera altitude (absolute value). |
void |
setBounds(double[] wnes)
Sets the horizontal bounds for this Camera. |
void |
setEnabled(boolean b)
Enable or disable camera. |
void |
setFocal(double f)
set camera focal distance (absolute value) |
void |
setLaziness(boolean b)
set eager or lazy mode |
void |
setLocation(Location l)
Set camera location |
protected void |
setOwningSpace(VirtualSpace vs)
set virtual space owning this camera |
void |
setOwningView(View vi)
set view owning this camera. |
void |
setXspeed(double dx)
Sets the camera's horizontal speed |
void |
setYspeed(double dy)
Sets the camera's vertical speed |
void |
setZoomCeiling(double a)
Set a zoom-out limit/minimum magnification (like a ceiling the camera cannot go through) . |
void |
setZoomFloor(double a)
set a zoom-in limit/maximum magnification (like a floor the camera cannot go through) value 0 means that, at maximum magnification, the size of observed glyphs corresponds to their real size (e.g. |
void |
setZoomInvariantLocation(double x,
double y)
Set zoom-invariant point's coordinates in virtual space. |
void |
setZspeed(double dz)
Sets the camera's zooming speed |
protected boolean |
shouldRepaint()
|
void |
stick(Camera c)
Attach a camera to this camera. |
void |
stick(Camera c,
boolean stickAlt)
Attach a camera to this camera. |
void |
stick(Glyph g)
attach glyph to this camera |
static void |
stickToCamera(Glyph g,
Camera c)
Stick glyph g to camera c. |
String |
toString()
returns a String with ID, position, altitude and focal distance |
void |
unstick(Camera c)
detach camera from this camera |
void |
unstick(Glyph g)
detach glyph from this camera |
void |
unstickAllCameras()
detach all cameras attached to this camera |
void |
unstickAllGlyphs()
detach all glyphs attached to this camera |
static void |
unstickAllGlyphs(Camera c)
Unstick all glyphs sticked to Camera c. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final float DEFAULT_FOCAL
public double vx
public double vy
public double altitude
public double focal
protected volatile double dx
protected volatile double dy
protected volatile double dz
protected volatile boolean zile
protected volatile double zilX
protected volatile double zilY
| Method Detail |
|---|
public void setZoomFloor(double a)
a - the altitude of the floor - the default value is 0 (put a negative value if you want to be able to magnify objects beyond their normal size)public double getZoomFloor()
public void setZoomCeiling(double a)
a - the altitude of the ceiling - the default value is Double.MAX_VALUEpublic double getZoomCeiling()
public void setBounds(double[] wnes)
public double[] getBounds()
public void move(double x,
double y)
public void moveTo(double x,
double y)
public void setAltitude(double a)
a - new altitude valuepublic void altitudeOffset(double a)
a - offset value
public void setAltitude(double a,
boolean repaint)
a - new altitude valuerepaint - refresh the associated view or not
public void altitudeOffset(double a,
boolean repaint)
a - offset valuerepaint - refresh the associated view or notpublic double getAltitude()
public void setLocation(Location l)
public Location getLocation()
public void setXspeed(double dx)
dx - camera's x-axis speedsetYspeed(double dy),
setZspeed(double dz),
getXspeed(),
getYspeed(),
getZspeed()public void setYspeed(double dy)
dy - camera's y-axis speedsetXspeed(double dx),
setZspeed(double dz),
getXspeed(),
getYspeed(),
getZspeed()public void setZspeed(double dz)
dz - camera's z-axis speedsetXspeed(double dx),
setYspeed(double dy),
getXspeed(),
getYspeed(),
getZspeed()
public void setZoomInvariantLocation(double x,
double y)
enableCustomZoomInvariantLocation(boolean b),
isCustomZoomInvariantLocationEnabled(),
getZilX(),
getZilY()public void enableCustomZoomInvariantLocation(boolean b)
setZoomInvariantLocation(double x, double y),
isCustomZoomInvariantLocationEnabled(),
getZilX(),
getZilY()public double getZilX()
setZoomInvariantLocation(double x, double y),
enableCustomZoomInvariantLocation(boolean b),
isCustomZoomInvariantLocationEnabled(),
getZilY()public double getZilY()
setZoomInvariantLocation(double x, double y),
enableCustomZoomInvariantLocation(boolean b),
isCustomZoomInvariantLocationEnabled(),
getZilX()public boolean isCustomZoomInvariantLocationEnabled()
setZoomInvariantLocation(double x, double y),
enableCustomZoomInvariantLocation(boolean b),
getZilX(),
getZilY()public double getXspeed()
setXspeed(double dx),
setYspeed(double dy),
setZspeed(double dz),
getYspeed(),
getZspeed()public double getYspeed()
setXspeed(double dx),
setYspeed(double dy),
setZspeed(double dz),
getXspeed(),
getZspeed()public double getZspeed()
setXspeed(double dx),
setYspeed(double dy),
setZspeed(double dz),
getXspeed(),
getYspeed()public void addListener(CameraListener listener)
public void removeListener(CameraListener listener)
protected void notifyMoved()
public void setFocal(double f)
public double getFocal()
public void propagateMove(double x,
double y)
public void propagateAltitudeChange(double alt)
public int getIndex()
protected void setOwningSpace(VirtualSpace vs)
public VirtualSpace getOwningSpace()
public void setOwningView(View vi)
public View getOwningView()
public void stick(Glyph g)
g - glyph to be attached to this cameraunstick(Glyph g),
unstickAllGlyphs()public void unstick(Glyph g)
g - glyph to be detachedstick(Glyph g),
unstickAllGlyphs()public void unstickAllGlyphs()
unstick(Glyph g),
stick(Glyph g)public Glyph[] getStickedGlyphArray()
public void stick(Camera c)
c - camera to be attached to this cameraunstick(Camera c),
unstickAllCameras()
public void stick(Camera c,
boolean stickAlt)
c - camera to be attached to this camera.stickAlt - also propagate altitude changes, in addition to translations.unstick(Camera c),
unstickAllCameras()public void unstick(Camera c)
c - camera to be detachedstick(Camera c),
unstickAllCameras()public void unstickAllCameras()
unstick(Camera c),
stick(Camera c)public Camera[] getStickedCameraArray()
public void setEnabled(boolean b)
isEnabled()public boolean isEnabled()
setEnabled(boolean b)public void setLaziness(boolean b)
b - true=lazy, false=eagerpublic boolean getLaziness()
public void repaint()
protected boolean shouldRepaint()
public String toString()
toString in class Object
public static void stickToCamera(Glyph g,
Camera c)
public static void unstickAllGlyphs(Camera c)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||