|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.stellarium.projector.DefaultProjector
public class DefaultProjector
Projector.
Nested Class Summary | |
---|---|
protected class |
DefaultProjector.AutoZoom
Struct used to store data for auto mov |
(package private) class |
DefaultProjector.ProjectEarthEqu
Actual class pointing to the function used as callback |
(package private) class |
DefaultProjector.ProjectJ2000
|
(package private) class |
DefaultProjector.ProjectLocal
Local projection strategy |
static class |
DefaultProjector.PROJECTOR_MASK_TYPE
|
Nested classes/interfaces inherited from interface org.stellarium.projector.Projector |
---|
Projector.ProjFunc, Projector.TYPE
|
Field Summary | |
---|---|
(package private)
javax.vecmath.Point3d |
center
Viewport center in screen pixel |
(package private) boolean |
flagAutoZoom
Define if autozoom is on or off |
(package private) double |
flip_horz
|
(package private) double |
flip_vert
|
(package private) double |
fov
Field of view in degree |
(package private) boolean |
gravityLabels
should label text align with the horizon? |
(package private)
javax.vecmath.Matrix4d |
invMatEarthEquToEye
Inverse of mat_projection*mat_earth_equ_to_eye |
(package private)
javax.vecmath.Matrix4d |
invMatHelioToEye
Inverse of mat_projection*mat_helio_to_eye |
(package private)
javax.vecmath.Matrix4d |
invMatJ2000ToEye
Inverse of mat_projection*mat_j2000_to_eye |
(package private)
javax.vecmath.Matrix4d |
invMatLocalToEye
Inverse of mat_projection*mat_local_to_eye |
(package private) DefaultProjector.PROJECTOR_MASK_TYPE |
maskType
The current projector mask |
(package private)
javax.vecmath.Matrix4d |
matEarthEquToEye
Modelview Matrix for earth equatorial projection |
(package private)
javax.vecmath.Matrix4d |
matHelioToEye
Modelview Matrix for earth equatorial projection |
(package private)
javax.vecmath.Matrix4d |
matJ2000ToEye
for precessed equ coords |
(package private)
javax.vecmath.Matrix4d |
matLocalToEye
Modelview Matrix for earth equatorial projection |
(package private)
javax.vecmath.Matrix4d |
matProjection
Projection matrix |
(package private) double |
maxFov
Maximum field of view in degree |
(package private) double |
minFov
Minimum field of view in degree |
(package private) Projector.ProjFunc
|
projectEarthEquFunc
|
(package private) Projector.ProjFunc
|
projectJ2000Func
|
(package private) Projector.ProjFunc
|
projectLocalFunc
|
(package private) Rectangle4i |
vecViewport
Viewport parameters |
(package private) double |
view_scaling_factor
|
(package private) double |
zFar
Near and far clipping planes |
(package private) double |
zNear
Near and far clipping planes |
(package private) DefaultProjector.AutoZoom
|
zoomMove
Current auto movement |
Constructor Summary | |
---|---|
protected |
DefaultProjector(Rectangle4i viewport)
|
protected |
DefaultProjector(Rectangle4i viewport,
double fov)
|
Method Summary | |
---|---|
void |
applyViewport()
Set the current openGL viewport to projector's viewport |
void |
changeFov(double deltaFov)
|
boolean |
checkInViewport(javax.vecmath.Point3d pos)
|
static DefaultProjector
|
create(Projector.TYPE type,
Rectangle4i viewport,
double fov)
|
void |
drawViewportShape()
Fill with black around the circle |
double |
getAimFov()
If is currently zooming, return the target FOV, otherwise return current FOV |
double[] |
getClippingPlanes()
|
boolean |
getFlagGravityLabels()
|
boolean |
getFlipHorz()
|
boolean |
getFlipVert()
|
double |
getFov()
Get the Field of View in degree |
DefaultProjector.PROJECTOR_MASK_TYPE |
getMaskType()
|
double |
getMaxFov()
Get the maximum Field of View in degree |
Projector.ProjFunc
|
getProjectEarthEquFunc()
|
Projector.ProjFunc
|
getProjectJ2000Func()
|
Projector.ProjFunc
|
getProjectLocalFunc()
|
double |
getRadPerPixel()
|
Projector.TYPE
|
getType()
|
Rectangle4i |
getViewport()
|
int |
getViewportHeight()
|
int |
getViewportPosX()
|
int |
getViewportPosY()
|
int |
getViewportWidth()
|
protected void |
initProjectMatrix()
Init the viewing matrix, setting the field of view, the clipping planes, and screen ratio The function is a reimplementation of gluPerspective |
static java.lang.String |
maskTypeToString(DefaultProjector.PROJECTOR_MASK_TYPE type)
|
boolean |
needGlFrontFaceCW()
|
void |
printGravity180(SFontIfc font,
double x, double y, java.lang.String ws, boolean speedOptimize, float xshift, float yshift)
|
void |
printGravity180(SFontIfc font,
double x, double y, java.lang.String ws, float xshift, float yshift)
Method with speed optimization by default |
boolean |
projectCustom(javax.vecmath.Tuple3d v,
javax.vecmath.Tuple3d win, javax.vecmath.Matrix4d mat)
|
boolean |
projectCustomCheck(javax.vecmath.Tuple3d v,
javax.vecmath.Point3d win, javax.vecmath.Matrix4d mat)
|
boolean |
projectCustomLineCheck(javax.vecmath.Point3d v1,
javax.vecmath.Point3d win1, javax.vecmath.Point3d v2, javax.vecmath.Point3d win2,
javax.vecmath.Matrix4d mat)
project two points and make sure both are in front of viewer and that at least one is on screen |
boolean |
projectEarthEqu(javax.vecmath.Point3d v,
javax.vecmath.Point3d win)
Return in vector "win" the projection on the screen of point v in earth equatorial coordinate according to the current modelview and projection matrices (reimplementation of gluProject) Return true if the z screen coordinate is < 1, ie if it isn't behind the observer except for the _check version which return true if the projected point is inside the screen |
boolean |
projectEarthEquCheck(javax.vecmath.Point3d v,
javax.vecmath.Point3d win)
|
boolean |
projectEarthEquLineCheck(javax.vecmath.Point3d v1,
javax.vecmath.Point3d win1, javax.vecmath.Point3d v2, javax.vecmath.Point3d win2)
|
boolean |
projectHelio(javax.vecmath.Tuple3d v,
javax.vecmath.Tuple3d win)
|
boolean |
projectHelioCheck(javax.vecmath.Point3d v,
javax.vecmath.Point3d win)
|
boolean |
projectHelioLineCheck(javax.vecmath.Point3d v1,
javax.vecmath.Point3d win1, javax.vecmath.Point3d v2, javax.vecmath.Point3d win2)
|
boolean |
projectJ2000(javax.vecmath.Point3d v,
javax.vecmath.Point3d win)
|
boolean |
projectJ2000Check(javax.vecmath.Tuple3d v,
javax.vecmath.Point3d win)
|
boolean |
projectJ2000LineCheck(javax.vecmath.Point3d v1,
javax.vecmath.Point3d win1, javax.vecmath.Point3d v2, javax.vecmath.Point3d win2)
|
boolean |
projectLocal(javax.vecmath.Point3d v,
javax.vecmath.Point3d win)
Same function with input vector v in local coordinate |
boolean |
projectLocalCheck(javax.vecmath.Point3d v,
javax.vecmath.Point3d win)
|
void |
resetPerspectiveProjection()
Reset the previous projection mode after a call to setOrthographicProjection() |
void |
sCylinder(double radius,
double height, int slices, int stacks, javax.vecmath.Matrix4d mat, boolean orientInside)
Reimplementation of gluCylinder : glu is overrided for non standard projection |
void |
sDisk(float radius,
int slices, int stacks, javax.vecmath.Matrix4d mat, boolean orientInside)
Draw a disk with a special texturing mode having texture center at center |
void |
setClippingPlanes(double znear,
double zfar)
|
void |
setFlagGravityLabels(boolean gravityLabels)
|
void |
setFlipHorz(boolean flip)
|
void |
setFlipVert(boolean flip)
|
void |
setFov(double f)
Set the Field of View in degree |
void |
setMaskType(DefaultProjector.PROJECTOR_MASK_TYPE maskType)
|
void |
setMaxFov(double max)
Set the maximum Field of View in degree |
void |
setModelviewMatrices(javax.vecmath.Matrix4d _matEarthEquToEye,
javax.vecmath.Matrix4d _matHelioToEye, javax.vecmath.Matrix4d _matLocalToEye, javax.vecmath.Matrix4d _matJ2000ToEye)
Set the standard modelview matrices used for projection |
void |
setOrthographicProjection()
Set the drawing mode in 2D for drawing inside the viewport only. |
void |
setViewport(int x,
int y, int w, int h)
|
(package private) void |
setViewport(Rectangle4i viewport)
|
void |
setViewportHeight(int height)
|
void |
setViewportPosX(int x)
|
void |
setViewportPosY(int y)
|
void |
setViewportWidth(int width)
|
(package private) void |
sHalfSphere(double radius,
int slices, int stacks, javax.vecmath.Matrix4d mat, boolean orientInside)
Draw a half sphere |
void |
sRing(double rMin,
double rMax, int slices, int stacks, javax.vecmath.Matrix4d mat,
boolean orientInside)
Draw a ring with a radial texturing |
void |
sSphere(double radius,
double oneMinusOblateness, int slices, int stacks, javax.vecmath.Matrix4d mat)
Method by orientInside false by default |
void |
sSphere(double radius,
double oneMinusOblateness, int slices, int stacks, javax.vecmath.Matrix4d mat, boolean orientInside)
Reimplementation of gluSphere : glu is overrided for non standard projection |
void |
sSphereMap(double radius,
int slices, int stacks, javax.vecmath.Matrix4d mat, float textureFOV, boolean orientInside)
Draw a fisheye texture in a sphere |
(package private) void |
sSphereMapTexCoordFast(double rho_div_fov,
double costheta, double sintheta)
|
static DefaultProjector.PROJECTOR_MASK_TYPE |
stringToMaskType(java.lang.String s)
|
static Projector.TYPE
|
stringToType(java.lang.String s)
|
void |
sVertex3(double x,
double y, double z, javax.vecmath.Matrix4d mat)
|
static java.lang.String |
typeToString(Projector.TYPE type)
|
(package private) void |
unproject(double x,
double y, javax.vecmath.Matrix4d m, javax.vecmath.Point3d v)
transformation from screen 2D point x,y to object. |
void |
unprojectEarthEqu(double x,
double y, javax.vecmath.Point3d v)
|
void |
unprojectHelio(double x,
double y, javax.vecmath.Point3d v)
|
void |
unprojectJ2000(double x,
double y, javax.vecmath.Point3d v)
|
void |
unprojectLocal(double x,
double y, javax.vecmath.Point3d v)
|
void |
updateAutoZoom(int deltaTime)
Update AutoZoom if activated |
(package private) void |
zoomTo(double aimFov)
Zoom to the given field of view in degree, using the default duration of 1 |
void |
zoomTo(double aimFov,
double moveDuration)
Zoom to the given field of view in degree |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
DefaultProjector.PROJECTOR_MASK_TYPE maskType
double fov
double minFov
double maxFov
double zNear
double zFar
Rectangle4i vecViewport
javax.vecmath.Matrix4d matProjection
javax.vecmath.Point3d center
double view_scaling_factor
double flip_horz
double flip_vert
javax.vecmath.Matrix4d matEarthEquToEye
javax.vecmath.Matrix4d matJ2000ToEye
javax.vecmath.Matrix4d matHelioToEye
javax.vecmath.Matrix4d matLocalToEye
javax.vecmath.Matrix4d invMatEarthEquToEye
javax.vecmath.Matrix4d invMatJ2000ToEye
javax.vecmath.Matrix4d invMatHelioToEye
javax.vecmath.Matrix4d invMatLocalToEye
DefaultProjector.AutoZoom zoomMove
boolean flagAutoZoom
boolean gravityLabels
Projector.ProjFunc projectEarthEquFunc
Projector.ProjFunc projectLocalFunc
Projector.ProjFunc projectJ2000Func
Constructor Detail |
---|
protected DefaultProjector(Rectangle4i viewport)
protected DefaultProjector(Rectangle4i viewport, double fov)
Method Detail |
---|
public static java.lang.String typeToString(Projector.TYPE type) throws StellariumException
StellariumException
public static Projector.TYPE stringToType(java.lang.String s)
public static java.lang.String maskTypeToString(DefaultProjector.PROJECTOR_MASK_TYPE type)
public static DefaultProjector.PROJECTOR_MASK_TYPE stringToMaskType(java.lang.String s)
public static DefaultProjector create(Projector.TYPE type, Rectangle4i viewport, double fov) throws StellariumException
StellariumException
protected void initProjectMatrix()
public void setViewport(int x, int y, int w, int h)
public void setFov(double f)
f
- The new field of view
public void setMaxFov(double max)
setMaxFov
in
interface Projector
max
- The new maximum field of view
public void drawViewportShape()
public void setClippingPlanes(double znear, double zfar)
public void changeFov(double deltaFov)
public void setModelviewMatrices(javax.vecmath.Matrix4d _matEarthEquToEye, javax.vecmath.Matrix4d _matHelioToEye, javax.vecmath.Matrix4d _matLocalToEye, javax.vecmath.Matrix4d _matJ2000ToEye)
_matEarthEquToEye
-
_matHelioToEye
-
_matLocalToEye
-
_matJ2000ToEye
-
public void updateAutoZoom(int deltaTime)
void zoomTo(double aimFov)
aimFov
- aimed field of view in degree
public void zoomTo(double aimFov, double moveDuration)
aimFov
- aimed field of view in degree
moveDuration
-
public void setOrthographicProjection()
setOrthographicProjection
in interface Projector
public void resetPerspectiveProjection()
resetPerspectiveProjection
in interface Projector
public void sSphere(double radius, double oneMinusOblateness, int slices, int stacks, javax.vecmath.Matrix4d mat)
sSphere
in interface Projector
public void sSphere(double radius, double oneMinusOblateness, int slices, int stacks, javax.vecmath.Matrix4d mat, boolean orientInside)
sSphere
in interface Projector
radius
-
slices
-
stacks
-
mat
-
orientInside
-
void sHalfSphere(double radius, int slices, int stacks, javax.vecmath.Matrix4d mat, boolean orientInside)
public void sDisk(float radius, int slices, int stacks, javax.vecmath.Matrix4d mat, boolean orientInside)
public final void sRing(double rMin, double rMax, int slices, int stacks, javax.vecmath.Matrix4d mat, boolean orientInside)
void sSphereMapTexCoordFast(double rho_div_fov, double costheta, double sintheta)
public final void sSphereMap(double radius, int slices, int stacks, javax.vecmath.Matrix4d mat, float textureFOV, boolean orientInside)
public void sCylinder(double radius, double height, int slices, int stacks, javax.vecmath.Matrix4d mat, boolean orientInside)
public void printGravity180(SFontIfc font, double x, double y, java.lang.String ws, float xshift, float yshift)
printGravity180
in interface Projector
font
-
x
-
y
-
ws
-
xshift
-
yshift
-
public void printGravity180(SFontIfc font, double x, double y, java.lang.String ws, boolean speedOptimize, float xshift, float yshift)
printGravity180
in interface Projector
public Projector.TYPE getType()
getType
in interface
Projector
public DefaultProjector.PROJECTOR_MASK_TYPE getMaskType()
public void setMaskType(DefaultProjector.PROJECTOR_MASK_TYPE maskType)
void setViewport(Rectangle4i viewport)
public void setViewportPosX(int x)
public void setViewportPosY(int y)
public void setViewportWidth(int width)
public void setViewportHeight(int height)
public int getViewportPosX()
getViewportPosX
in interface Projector
public int getViewportPosY()
getViewportPosY
in interface Projector
public int getViewportWidth()
getViewportWidth
in
interface Projector
public int getViewportHeight()
getViewportHeight
in
interface Projector
public final Rectangle4i getViewport()
getViewport
in
interface Projector
public void applyViewport()
public boolean getFlipHorz()
public boolean getFlipVert()
public void setFlipHorz(boolean flip)
public void setFlipVert(boolean flip)
public boolean needGlFrontFaceCW()
needGlFrontFaceCW
in
interface Projector
public double getFov()
getFov
in interface
Projector
public final double getRadPerPixel()
public double getMaxFov()
public final double getAimFov()
public double[] getClippingPlanes()
public final boolean checkInViewport(javax.vecmath.Point3d pos)
pos
-
public final boolean projectEarthEqu(javax.vecmath.Point3d v, javax.vecmath.Point3d win)
projectEarthEqu
in interface Projector
public final boolean projectEarthEquCheck(javax.vecmath.Point3d v, javax.vecmath.Point3d win)
public final boolean projectEarthEquLineCheck(javax.vecmath.Point3d v1, javax.vecmath.Point3d win1, javax.vecmath.Point3d v2, javax.vecmath.Point3d win2)
public void unprojectEarthEqu(double x, double y, javax.vecmath.Point3d v)
public final void unprojectJ2000(double x, double y, javax.vecmath.Point3d v)
public final boolean projectJ2000(javax.vecmath.Point3d v, javax.vecmath.Point3d win)
projectJ2000
in interface Projector
public final boolean projectJ2000Check(javax.vecmath.Tuple3d v, javax.vecmath.Point3d win)
projectJ2000Check
in interface Projector
public final boolean projectJ2000LineCheck(javax.vecmath.Point3d v1, javax.vecmath.Point3d win1, javax.vecmath.Point3d v2, javax.vecmath.Point3d win2)
projectJ2000LineCheck
in interface Projector
public final boolean projectHelioCheck(javax.vecmath.Point3d v, javax.vecmath.Point3d win)
public final boolean projectHelio(javax.vecmath.Tuple3d v, javax.vecmath.Tuple3d win)
public final boolean projectHelioLineCheck(javax.vecmath.Point3d v1, javax.vecmath.Point3d win1, javax.vecmath.Point3d v2, javax.vecmath.Point3d win2)
public final void unprojectHelio(double x, double y, javax.vecmath.Point3d v)
public final boolean projectLocal(javax.vecmath.Point3d v, javax.vecmath.Point3d win)
projectLocal
in interface Projector
public final boolean projectLocalCheck(javax.vecmath.Point3d v, javax.vecmath.Point3d win)
public final void unprojectLocal(double x, double y, javax.vecmath.Point3d v)
unprojectLocal
in interface Projector
public boolean projectCustom(javax.vecmath.Tuple3d v, javax.vecmath.Tuple3d win, javax.vecmath.Matrix4d mat)
public boolean projectCustomCheck(javax.vecmath.Tuple3d v, javax.vecmath.Point3d win, javax.vecmath.Matrix4d mat)
public boolean projectCustomLineCheck(javax.vecmath.Point3d v1, javax.vecmath.Point3d win1, javax.vecmath.Point3d v2, javax.vecmath.Point3d win2, javax.vecmath.Matrix4d mat)
public void sVertex3(double x, double y, double z, javax.vecmath.Matrix4d mat)
sVertex3
in interface Projector
public void setFlagGravityLabels(boolean gravityLabels)
public boolean getFlagGravityLabels()
getFlagGravityLabels
in interface Projector
void unproject(double x, double y, javax.vecmath.Matrix4d m, javax.vecmath.Point3d v)
x
- The 2D point absciss
y
- The 2D point ordonnee
m
- The already inverted full tranfo matrix
v
-
public Projector.ProjFunc getProjectEarthEquFunc()
getProjectEarthEquFunc
in interface Projector
public Projector.ProjFunc getProjectLocalFunc()
getProjectLocalFunc
in interface Projector
public Projector.ProjFunc getProjectJ2000Func()
getProjectJ2000Func
in interface Projector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |