GeomRep
Class Ellipsoid

java.lang.Object
  extended by GeomRep.Ellipsoid
All Implemented Interfaces:
GeomObject

public class Ellipsoid
extends java.lang.Object
implements GeomObject

Class ellipsoid. This object represents an ellipsoid described by the equation: (X/mA)^2 + (Y/mB)^2 + (Z/mC)^2 = 1

To get a general ellipse, use transformations, for instance, the draw functions take a transformation matrix to transform the ellipsoid.

Implements GeomObject interface.

Since:
1.0
See Also:
GeomObject

Field Summary
private  float mA
          semi major axis length along X.
private  float mB
          semi major axis length along Y.
private  float mC
          semi major axis length along Z.
private  java.awt.Color mEdgeColor
           
private  java.lang.String mFileName
           
private  OutputPanelInterface mOutPanel
           
private  java.awt.Color mSurfaceColor
           
 
Constructor Summary
Ellipsoid()
          Class constructor.
Ellipsoid(float a, float b, float c)
          Class constructor.
 
Method Summary
 void ComputeMaximumDelta()
           
 void CutAcrossLine(float[] transMatrix, float slope, float intercept)
           
 void CutAcrossPlane(float[] plane_coeff, boolean retainPositive)
           
 void DrawCameraImage(DrawingCanvasInterface canvas, java.awt.Graphics g, float[] transMatrix, boolean onlySurface)
          Draws the surface model with camera positioned at (X, Y, Z).
 void DrawCrinkleCut(DrawingCanvasInterface canvas, java.awt.Graphics g, float[] plane, float[] transMatrix)
          Draw cut plane of ellipsoid using supplied transformation.
 void DrawSurface(DrawingCanvasInterface canvas, java.awt.Graphics g, float[] transMatrix)
          Draw surface model of ellipsoid using supplied transformation.
 void DrawSurfaceOnly(DrawingCanvasInterface canvas, java.awt.Graphics g, float[] transMatrix)
          Draw only the surface model for object, without edges.
 void DrawWireFrame(DrawingCanvasInterface canvas, java.awt.Graphics g, float[] transMatrix)
          Draw wireframe model of ellipsoid using supplied transformation.
 float[] GetCentroidCoor()
           
 float GetCentroidX()
           
 float GetCentroidY()
           
 float GetCentroidZ()
           
 java.awt.Color GetEdgeColor()
           
 java.lang.String GetFileName()
           
 float GetMaxDelta()
           
 float GetMinX()
           
 float GetMinY()
           
 float GetMinZ()
           
 java.awt.Color GetSurfaceColor()
           
 void SetEdgeColor(java.awt.Color col)
           
 void SetFileName(java.lang.String fileName)
           
 void SetOutputPanel(OutputPanelInterface outPanel)
           
 void SetSurfaceColor(java.awt.Color col)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mA

private float mA
semi major axis length along X.


mB

private float mB
semi major axis length along Y.


mC

private float mC
semi major axis length along Z.


mFileName

private java.lang.String mFileName

mSurfaceColor

private java.awt.Color mSurfaceColor

mEdgeColor

private java.awt.Color mEdgeColor

mOutPanel

private OutputPanelInterface mOutPanel
Constructor Detail

Ellipsoid

Ellipsoid()
Class constructor. Makes the semi major axes to 0.


Ellipsoid

Ellipsoid(float a,
          float b,
          float c)
Class constructor.

Parameters:
a - semi major axis along X.
b - semi major axis along Y.
c - semi major axis along Z.
Method Detail

SetFileName

public void SetFileName(java.lang.String fileName)
Specified by:
SetFileName in interface GeomObject

GetFileName

public java.lang.String GetFileName()
Specified by:
GetFileName in interface GeomObject

SetSurfaceColor

public void SetSurfaceColor(java.awt.Color col)
Specified by:
SetSurfaceColor in interface GeomObject

GetSurfaceColor

public java.awt.Color GetSurfaceColor()
Specified by:
GetSurfaceColor in interface GeomObject

SetEdgeColor

public void SetEdgeColor(java.awt.Color col)
Specified by:
SetEdgeColor in interface GeomObject

GetEdgeColor

public java.awt.Color GetEdgeColor()
Specified by:
GetEdgeColor in interface GeomObject

DrawWireFrame

public void DrawWireFrame(DrawingCanvasInterface canvas,
                          java.awt.Graphics g,
                          float[] transMatrix)
Draw wireframe model of ellipsoid using supplied transformation.

Specified by:
DrawWireFrame in interface GeomObject
Parameters:
canvas - DrawingCanvasInterface
g - Graphics instance
transMatrix - A transformation matrix containing 16 elements, i.e. 4X4 matrix.
See Also:
DrawingCanvasInterface, DrawingCanvas

DrawSurface

public void DrawSurface(DrawingCanvasInterface canvas,
                        java.awt.Graphics g,
                        float[] transMatrix)
Draw surface model of ellipsoid using supplied transformation.

Specified by:
DrawSurface in interface GeomObject
Parameters:
canvas - DrawingCanvasInterface
g - Graphics instance
transMatrix - A transformation matrix containing 16 elements, i.e. 4X4 matrix.
See Also:
DrawingCanvasInterface, DrawingCanvas

DrawSurfaceOnly

public void DrawSurfaceOnly(DrawingCanvasInterface canvas,
                            java.awt.Graphics g,
                            float[] transMatrix)
Description copied from interface: GeomObject
Draw only the surface model for object, without edges. Transformation matrix captures all the transformation related information (for instance, if the view is perspective or axonometric).

Specified by:
DrawSurfaceOnly in interface GeomObject
Parameters:
canvas - Instance of DrawingCanvas (@see GridView.DrawingCanvas)
g - Graphics instance to draw to.
transMatrix - Transformation matrix
See Also:
DrawingCanvasInterface

DrawCameraImage

public void DrawCameraImage(DrawingCanvasInterface canvas,
                            java.awt.Graphics g,
                            float[] transMatrix,
                            boolean onlySurface)
Draws the surface model with camera positioned at (X, Y, Z). Camera position, perspective proj etc are all baked into transMatrix (transformation matrix)

Specified by:
DrawCameraImage in interface GeomObject

DrawCrinkleCut

public void DrawCrinkleCut(DrawingCanvasInterface canvas,
                           java.awt.Graphics g,
                           float[] plane,
                           float[] transMatrix)
Draw cut plane of ellipsoid using supplied transformation.

Specified by:
DrawCrinkleCut in interface GeomObject
Parameters:
canvas - DrawingCanvasInterface
g - Graphics instance
plane - Cutting plane. Transformation is not applied to cutting plane. Array of coefficients defining plane as:

plane[0]*X + plane[1]*Y + plane[2]*Z + plane[3] = 0

transMatrix - A transformation matrix containing 16 elements, i.e. 4X4 matrix.
See Also:
DrawingCanvasInterface, DrawingCanvas

CutAcrossPlane

public void CutAcrossPlane(float[] plane_coeff,
                           boolean retainPositive)
Specified by:
CutAcrossPlane in interface GeomObject

CutAcrossLine

public void CutAcrossLine(float[] transMatrix,
                          float slope,
                          float intercept)
Specified by:
CutAcrossLine in interface GeomObject

ComputeMaximumDelta

public void ComputeMaximumDelta()
Specified by:
ComputeMaximumDelta in interface GeomObject

GetMinX

public float GetMinX()
Specified by:
GetMinX in interface GeomObject

GetMinY

public float GetMinY()
Specified by:
GetMinY in interface GeomObject

GetMinZ

public float GetMinZ()
Specified by:
GetMinZ in interface GeomObject

GetCentroidCoor

public float[] GetCentroidCoor()
Specified by:
GetCentroidCoor in interface GeomObject

GetCentroidX

public float GetCentroidX()
Specified by:
GetCentroidX in interface GeomObject

GetCentroidY

public float GetCentroidY()
Specified by:
GetCentroidY in interface GeomObject

GetCentroidZ

public float GetCentroidZ()
Specified by:
GetCentroidZ in interface GeomObject

GetMaxDelta

public float GetMaxDelta()
Specified by:
GetMaxDelta in interface GeomObject

SetOutputPanel

public void SetOutputPanel(OutputPanelInterface outPanel)
Specified by:
SetOutputPanel in interface GeomObject