|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectGridView.Controller
public class Controller
Controller class. This class is the glue between viewer and model (data manager).
GeomDataManager,
Viewer| Field Summary | |
|---|---|
private boolean |
bFileSpecified
Has the file defining the scene been specified? |
private GeomDataManager |
mDataManager
Model instance (manages the data stored). |
private OutputPanel |
mOutPanel
|
| Constructor Summary | |
|---|---|
Controller()
Class constructor. |
|
| Method Summary | |
|---|---|
void |
ApplyTransform(float[] coord,
float[] outputCoord)
Transform a point using the current transformation matrix. |
void |
ConstructArbitRotMatrix(float[] axisDirCosine,
float thetaRadian)
Constructs rotation transformation matrix about an arbitrary axis (using Rodrigues formula) and appends it to the current transformation matrix. |
void |
ConstructArbitRotMatrix(float[] axisDirCosine,
float sine,
float cosine)
Constructs rotation transformation matrix about an arbitrary axis (using Rodrigues formula) and appends it to the current transformation matrix. |
void |
ConstructOnePtPerspMatrix(float centerProj)
Constructs a one point perspective transformation matrix from the current transformation matrix. |
void |
ConstructRotMatrix(Defs.Axis ax,
float sine,
float cosine)
Constructs rotation matrix by rotating one of X, Y, or X axes by a given angle. |
void |
ConstructThreePtPerspMatrix(float center1,
float center2,
float center3)
Constructs a three point perspective transformation matrix from the current transformation matrix. |
void |
ConstructTwoPtPerspMatrix(Defs.Axis ax1,
Defs.Axis ax2,
float center1,
float center2)
Constructs a two point perspective transformation matrix from the current transformation matrix. |
void |
CutObject(int x1,
int y1,
int x2,
int y2)
Cut an object across a cut plane whose physical coordinates have ben specified. |
void |
DecreaseZoom()
Decreases the zoom level by a factor of 2. |
boolean |
DeleteObject(java.lang.String shortFileName)
Delete the object that was loaded from a specified file. |
void |
DrawCameraImage(DrawingCanvas canvas,
java.awt.Graphics g,
float[] camera_coor,
float[] center_proj,
boolean onlySurface,
boolean onlyWireframe)
Draws the surface model with camera positioned at (X, Y, Z). |
void |
DrawCrinkleCut(DrawingCanvas canvas,
java.awt.Graphics g,
float[] plane)
Draw the face of objects in the scene cut by a specified cutting plane. |
void |
DrawSurface(DrawingCanvas canvas,
java.awt.Graphics g)
Draw the surface of objects comprising the scene. |
void |
DrawSurfaceOnly(DrawingCanvas canvas,
java.awt.Graphics g)
Draw only the surface of objects comprising the scene (no edges). |
void |
DrawWireFrame(DrawingCanvas canvas,
java.awt.Graphics g)
Draw wire frame picture of the scene. |
GeomObject |
GetCurrZoomedObject()
Get the object that is currently focused on the screen (was zoomed to most recently). |
GeomDataManager |
GetGeomDataManager()
Get the instance of GeomDataManager. |
GeomObject |
GetObjectFromFileName(java.lang.String shortFileName)
Get the object that was created from a specified file. |
void |
IncreaseZoom()
Increases the zoom level by a factor of 2. |
float |
MeasureDistance(int x1,
int y1,
int x2,
int y2)
Measure the distance in physical coordinates between two points whose screen coordinates are known. |
void |
PanDown(float dist)
Pan down relative to the current (drawn) image. |
void |
PanLeft(float dist)
Pan to left of the currently (drawn) image. |
void |
PanRight(float dist)
Pan to right of the currently (drawn) image. |
void |
PanUp(float dist)
Pan up relative to the current (drawn) image. |
PlotData<java.lang.Float> |
PriceOpenFFT(PlotData<java.lang.Float> data)
|
boolean |
Read2DPlotFile(java.lang.String fileName,
TwoDPlotter<java.lang.Float> plotter,
boolean isHistogram)
|
boolean |
ReadFinanceDataFile(java.lang.String fileName,
TwoDPlotter<java.lang.Float> plotter)
|
boolean |
ReadFromDataFile(java.lang.String fileName)
Read the data from specified file, The format of the file needs to be specified. |
void |
RegisterProgressBar(javax.swing.JProgressBar progBar)
Register the progress bar with data manager. |
void |
RequestZoomToHome()
Request the view to zoom to original focus for the last loaded object. |
void |
ResetJavaCoordUserMatrix()
Resets the java coordinate user-specified transformation matrix. |
void |
ResetUserDefinedTransMatrix()
Resets the transformation matrix to unity. |
void |
ResetViewMatrix()
Resets the view matrix to identity matrix. |
void |
SetOutputPanel(OutputPanel outPanel)
Record the output panel instance, so that error info etc can be dumped onto the panel. |
void |
TranslateMatrix(float[] moveToPos)
Constructs transformation matrix by moving the origin to moveToPos and appends it to the current transformation matrix. |
void |
ZoomInROI(float roiLen,
float screenLen,
float x0,
float y0)
Zoom into a drawn region of interest (ROI) on the screen. |
void |
ZoomOutROI(float roiLen,
float screenLen,
float x0,
float y0)
Zoom out of a drawn region of interest (ROI) on the screen. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private GeomDataManager mDataManager
private boolean bFileSpecified
private OutputPanel mOutPanel
| Constructor Detail |
|---|
public Controller()
| Method Detail |
|---|
public void IncreaseZoom()
public void DecreaseZoom()
public void RegisterProgressBar(javax.swing.JProgressBar progBar)
progBar - Progress bar instance.public GeomDataManager GetGeomDataManager()
GeomDataManagerpublic void SetOutputPanel(OutputPanel outPanel)
outPanel - Instance of OutputPanel used on the main viewer.OutputPanel
public void DrawWireFrame(DrawingCanvas canvas,
java.awt.Graphics g)
canvas - Instance of DrawingCanvas object (needed for converting to screen coordinates).g - Graphics instance onto which the drawing needs to be done.DrawingCanvas
public void DrawSurface(DrawingCanvas canvas,
java.awt.Graphics g)
canvas - Instance of DrawingCanvas object (needed for converting to screen coordinates).g - Graphics instance onto which the drawing needs to be done.DrawingCanvas
public void DrawSurfaceOnly(DrawingCanvas canvas,
java.awt.Graphics g)
canvas - Instance of DrawingCanvas object (needed for converting to screen coordinates).g - Graphics instance onto which the drawing needs to be done.DrawingCanvas
public void DrawCrinkleCut(DrawingCanvas canvas,
java.awt.Graphics g,
float[] plane)
canvas - Instance of DrawingCanvas object (needed for converting to screen coordinates).g - Graphics instance onto which the drawing needs to be done.plane - Coefficients in plane equation (Ax+By+Cz+D=0).DrawingCanvaspublic boolean ReadFromDataFile(java.lang.String fileName)
fileName - Name of the file containing object definition.
public void RequestZoomToHome()
DrawingCanvas.RegenerateImage(),
DrawingCanvas.paintComponent(java.awt.Graphics)
public boolean Read2DPlotFile(java.lang.String fileName,
TwoDPlotter<java.lang.Float> plotter,
boolean isHistogram)
public boolean ReadFinanceDataFile(java.lang.String fileName,
TwoDPlotter<java.lang.Float> plotter)
public PlotData<java.lang.Float> PriceOpenFFT(PlotData<java.lang.Float> data)
public void ResetUserDefinedTransMatrix()
GeomDataManager.ResetUserDefinedTransMatrix()public void ResetViewMatrix()
GeomDataManager.mViewMatrixpublic void ResetJavaCoordUserMatrix()
GeomDataManager.mJavaCoordUserMatrix
public void ZoomInROI(float roiLen,
float screenLen,
float x0,
float y0)
roiLen - Length of region of interest (square)screenLen - Length of screenx0 - X Coordinate of upper left corner of ROIy0 - Y Coordinate of upper left corner of ROI (region of
interest).
public void ZoomOutROI(float roiLen,
float screenLen,
float x0,
float y0)
roiLen - Length of region of interest (square,
so width = length)screenLen - Length of screenx0 - X Coordinate of upper left corner of ROIy0 - Y Coordinate of upper left corner of ROI (region of
interest).public void PanRight(float dist)
dist - Distance by which to transpose.public void PanLeft(float dist)
dist - Distance by which to transpose.public void PanDown(float dist)
dist - Distance by which to transpose.public void PanUp(float dist)
dist - Distance by which to transpose.public GeomObject GetCurrZoomedObject()
GeomObjectpublic GeomObject GetObjectFromFileName(java.lang.String shortFileName)
shortFileName - Last part of file name, eg: /path/file.gts
will have a short file name of file.gts
GeomObject
public void ApplyTransform(float[] coord,
float[] outputCoord)
coord - A 3 element array having X, Y, Z coordinates.outputCoord - A 3 element array containing output
transformed coordinates.GeomDataManager.mTransMatrixpublic void TranslateMatrix(float[] moveToPos)
moveToPos - X, Y, Z coordinates of the point to translate the origin to.GeomDataManager.TranslateMatrix(float[])
public float MeasureDistance(int x1,
int y1,
int x2,
int y2)
x1 - x coordinate of point 1 (in screen units, i.e. pixels)y1 - y coordinate of point 1 (in screen units, i.e. pixels)x2 - x coordinate of point 2 (in screen units, i.e. pixels)y2 - y coordinate of point 2 (in screen units, i.e. pixels)
public void ConstructRotMatrix(Defs.Axis ax,
float sine,
float cosine)
ax - Axis about which rotation is performed.sine - sin() of the rotation angle.cosine - cos of the rotation angle.GeomDataManager.ConstructRotMatrix(Defs.Axis, float, float),
Defs.Axis
public void ConstructArbitRotMatrix(float[] axisDirCosine,
float thetaRadian)
axisDirCosine - Direction cosines of the rotation axis.thetaRadian - Rotation angle in radians.GeomDataManager.ConstructArbitRotMatrix(float[], float, float)
public void ConstructArbitRotMatrix(float[] axisDirCosine,
float sine,
float cosine)
axisDirCosine - Direction cosines of the rotation axis.sine - sin() of the rotation angle.cosine - cos() of the rotation angle.GeomDataManager.ConstructArbitRotMatrix(float[], float)public void ConstructOnePtPerspMatrix(float centerProj)
The vanishing point is X=0, Y=0, Z=-centerProj. Hence r = -1/centerProj.
centerProj - Center of projection (observer's eye) along the negative Z axis. centerProj is given as a signed quantity.
Relays the request to GeomDataManager.GeomDataManager.ConstructOnePtPerspMatrix(float)
public void ConstructTwoPtPerspMatrix(Defs.Axis ax1,
Defs.Axis ax2,
float center1,
float center2)
ax1 - Axis for center of projection 1 (@see Common.Defs.Axis)ax2 - Axis for center of projection 2 (@see Common.Defs.Axis)center1 - Center of projection along ax1.center2 - Center of projection along ax2.
Relays the request to GeomDataManager.GeomDataManager.ConstructTwoPtPerspMatrix(Defs.Axis, Defs.Axis, float, float)
public void ConstructThreePtPerspMatrix(float center1,
float center2,
float center3)
center1 - Center of projection along the X axis.center2 - Center of projection along the Y axis.center3 - Center of projection along the Z axis.
Relays the request to GeomDataManager.GeomDataManager.ConstructThreePtPerspMatrix(float, float, float)
public void DrawCameraImage(DrawingCanvas canvas,
java.awt.Graphics g,
float[] camera_coor,
float[] center_proj,
boolean onlySurface,
boolean onlyWireframe)
public boolean DeleteObject(java.lang.String shortFileName)
shortFileName - Short name of the file (no path)
public void CutObject(int x1,
int y1,
int x2,
int y2)
x1 - x coordinate of point 1 (in screen units, i.e. pixels)y1 - y coordinate of point 1 (in screen units, i.e. pixels)x2 - x coordinate of point 2 (in screen units, i.e. pixels)y2 - y coordinate of point 2 (in screen units, i.e. pixels)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||