|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGeomRep.Scene
public class Scene
Scene class that encapsulates the set of objects constituting the scene.
Scene class is a singleton, since it captures details of all the objects in the view. It contains a list of objects.
GeomObject
Field Summary | |
---|---|
private static Scene |
mInstance
Singleton instance of the class. |
private java.util.List<GeomObject> |
mObjects
List of objects comprising the scene. |
private OutputPanelInterface |
mOutPanel
|
Constructor Summary | |
---|---|
protected |
Scene()
Class constructor. |
Method Summary | |
---|---|
void |
AddObj(GeomObject obj)
Method to add object to the list of objects forming the scene. |
void |
CutAcrossLine(float[] transMatrix,
float slope,
float intercept)
|
void |
CutAcrossPlane(float[] plane_coeff)
|
boolean |
DeleteObject(java.lang.String shortFileName)
|
void |
DrawCameraImage(DrawingCanvasInterface canvas,
java.awt.Graphics g,
float[] transMatrix,
boolean onlySurface,
boolean onlyWireframe)
Draws the surface model with camera positioned at (X, Y, Z). |
void |
DrawCrinkleCut(DrawingCanvasInterface canvas,
java.awt.Graphics g,
float[] plane,
float[] transMatrix)
Draw the face of objects in the scene cut by a specified cutting plane. |
void |
DrawSurface(DrawingCanvasInterface canvas,
java.awt.Graphics g,
float[] transMatrix)
Draw the surface of objects comprising the scene. |
void |
DrawSurfaceOnly(DrawingCanvasInterface canvas,
java.awt.Graphics g,
float[] transMatrix)
Draw only the surface (no edges) of objects comprising the scene. |
void |
DrawWireFrame(DrawingCanvasInterface canvas,
java.awt.Graphics g,
float[] transMatrix)
Draw wire frame picture of the scene. |
GeomObject |
GetLastObject()
|
GeomObject |
GetObj(int indx)
Get the GeomObject corresponding to a given index number. |
GeomObject |
GetObjectFromFileName(java.lang.String shortFileName)
Get the object that was created from a specified file. |
static Scene |
Instance()
Method to get the instance (singleton) of this class. |
void |
RemoveAllObj()
Remove all objects from the scene. |
GeomObject |
RemoveObj(GeomObject obj)
Remove an object from the scene. |
GeomObject |
RemoveObj(int objIndex)
Remove an object from the scene. |
void |
SetOutputPanel(OutputPanelInterface outPanel)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.List<GeomObject> mObjects
private static Scene mInstance
private OutputPanelInterface mOutPanel
Constructor Detail |
---|
protected Scene()
Method Detail |
---|
public void SetOutputPanel(OutputPanelInterface outPanel)
public static Scene Instance()
public void AddObj(GeomObject obj)
obj
- Instance of objectGeomObject
public void RemoveAllObj()
public GeomObject RemoveObj(GeomObject obj)
obj
- Instance of the object to remove.
RemoveObj(int)
public GeomObject RemoveObj(int objIndex)
objIndex
- Index of object to remove.
RemoveObj(GeomObject)
public 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 boolean DeleteObject(java.lang.String shortFileName)
public GeomObject GetObj(int indx) throws java.lang.IndexOutOfBoundsException
indx
- Index number of a GeomObject in the object list
maintained by Scene.
java.lang.IndexOutOfBoundsException
- if the index is out of range (indx < 0 || indx >= size()).mObjects
public GeomObject GetLastObject()
public void DrawWireFrame(DrawingCanvasInterface canvas, java.awt.Graphics g, float[] transMatrix)
canvas
- Instance of DrawingCanvas object (needed for converting to screen coordinates).g
- Graphics instance onto which the drawing needs to be done.transMatrix
- Transformation matrix.DrawingCanvas
,
DrawingCanvasInterface
,
GeomObject
public void DrawSurface(DrawingCanvasInterface canvas, java.awt.Graphics g, float[] transMatrix)
canvas
- Instance of DrawingCanvas object (needed for converting to screen coordinates).g
- Graphics instance onto which the drawing needs to be done.transMatrix
- Transformation matrix.DrawingCanvas
,
DrawingCanvasInterface
,
GeomObject
public void DrawSurfaceOnly(DrawingCanvasInterface canvas, java.awt.Graphics g, float[] transMatrix)
canvas
- Instance of DrawingCanvas object (needed for converting to screen coordinates).g
- Graphics instance onto which the drawing needs to be done.transMatrix
- Transformation matrix.DrawingCanvas
,
DrawingCanvasInterface
,
GeomObject
public void DrawCameraImage(DrawingCanvasInterface canvas, java.awt.Graphics g, float[] transMatrix, boolean onlySurface, boolean onlyWireframe)
public void DrawCrinkleCut(DrawingCanvasInterface canvas, java.awt.Graphics g, float[] plane, float[] transMatrix)
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).transMatrix
- Transformation matrix.DrawingCanvas
,
DrawingCanvasInterface
,
GeomObject
public void CutAcrossPlane(float[] plane_coeff)
public void CutAcrossLine(float[] transMatrix, float slope, float intercept)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |