Class FDATI.ModelViewer
All Packages Class Hierarchy This Package Previous Next Index
Class FDATI.ModelViewer
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----FDATI.ModelViewer
- public class ModelViewer
- extends Canvas
A Canvas for displaying a 3D polyhedral. This component
contains the model object and controls mouse events and painting.
Portions of this are based on code by James Gosling.
Copyright (c) 1995, H. Robert Frost, Stanford University.
All rights reserved.
Copyright (c) 1996, H. Robert Frost, Enterprise Integration Technologies,
Inc. All rights reserved.
RESTRICTED RIGHTS LEGEND: Use, duplication or disclosure by the
Government is subject to restrictions as set forth in
subparagraph(c)(1)(ii) of the Rights in Technical Data and Computer
Software clause at DFARS 252.227-7013 and in similar clauses in the
FAR and NASA FAR supplement.
This software is bound by the terms and conditions listed in the
attached LICENSE file.
-
M
- Object which contains the solid model, input parser, orientation matrix
and applied fixture points.
-
MD
- Object which knows how to display the model M.
-
parent
- The panel which contains this ModelViewer and all of the user interface
buttons.
-
ModelViewer(model, ModelPanel, Color)
- Constructor for an ModelViewer.
-
action(model, String)
- Called by the model to report messages.
-
action(ModelDisplay, String)
- Called by the ModelDisplay to report messages.
-
change_culling(boolean)
- Determines whether backface culling should be performed during
rotation.
-
changeMode(boolean)
- Called to change between rotation and fixel selection modes.
-
getValue(String)
- Gets the x,y,z,i,j or k value for the current fixel.
-
minimumSize()
-
-
modifyPoint()
- Remove the current fixture point.
-
mouseDown(Event, int, int)
- Called when the mouse button is clicked, represents either an attempt to
add a fixture point or the start of a mouse drag.
-
mouseDrag(Event, int, int)
- Called when mouse is being dragged across the model, represents rotation.
-
mouseMove(Event, int, int)
- Called as mouse moves across the model.
-
mouseUp(Event, int, int)
- Called when the mouse button has been released.
-
numPoints()
- Returns the total number of fixture points.
-
paint(Graphics)
- Called to paint the model.
-
preferredSize()
-
-
set_edge(boolean)
- Determines whether edges should be drawn.
-
set_render(boolean)
- Determines whether the model should be rendered
M
public model M
- Object which contains the solid model, input parser, orientation matrix
and applied fixture points.
MD
public ModelDisplay MD
- Object which knows how to display the model M.
parent
public ModelPanel parent
- The panel which contains this ModelViewer and all of the user interface
buttons.
ModelViewer
public ModelViewer(model m,
ModelPanel mp,
Color bg_color)
- Constructor for an ModelViewer.
- Parameters:
- m - Model to display
- mp - The ModelPanel in which the ModelViewer is contained
minimumSize
public Dimension minimumSize()
- Overrides:
- minimumSize in class Component
preferredSize
public Dimension preferredSize()
- Overrides:
- preferredSize in class Component
action
public void action(model m,
String message)
- Called by the model to report messages.
- Parameters:
- m - Model which called the action method
- message - Message which the model is sending
action
public void action(ModelDisplay md,
String message)
- Called by the ModelDisplay to report messages.
- Parameters:
- md - ModelDislplay which called the action method
- message - Message which the ModelDisplay is sending
change_culling
public void change_culling(boolean new_value)
- Determines whether backface culling should be performed during
rotation.
- Parameters:
- new_value - Should backface culling be done?
set_render
public void set_render(boolean new_value)
- Determines whether the model should be rendered
- Parameters:
- new_value - Should the model be rendered?
set_edge
public void set_edge(boolean new_value)
- Determines whether edges should be drawn.
- Parameters:
- new_value - Should edges be drawn?
mouseDown
public boolean mouseDown(Event evt,
int x,
int y)
- Called when the mouse button is clicked, represents either an attempt to
add a fixture point or the start of a mouse drag.
- Parameters:
- evt - Event which called the method
- x - Current x position
- y - Current y position
- Overrides:
- mouseDown in class Component
mouseUp
public boolean mouseUp(Event evt,
int x,
int y)
- Called when the mouse button has been released. This occurs after
rotation or after a fixture point has been added.
- Parameters:
- evt - Event which called the method
- x - Current x position
- y - Current y position
- Overrides:
- mouseUp in class Component
mouseDrag
public boolean mouseDrag(Event evt,
int x,
int y)
- Called when mouse is being dragged across the model, represents rotation.
- Parameters:
- evt - Event which called the method
- x - Current x position
- y - Current y position
- Overrides:
- mouseDrag in class Component
mouseMove
public boolean mouseMove(Event evt,
int x,
int y)
- Called as mouse moves across the model. Does nothing now.
- Parameters:
- evt - Event which called the method
- x - Current x position
- y - Current y position
- Overrides:
- mouseMove in class Component
changeMode
public void changeMode(boolean nextMode)
- Called to change between rotation and fixel selection modes.
- Parameters:
- nextMode - False for fixel selection, true for rotation
paint
public void paint(Graphics g)
- Called to paint the model.
- Parameters:
- g - Graphics context to which the model should be painted.
- Overrides:
- paint in class Canvas
modifyPoint
public void modifyPoint()
- Remove the current fixture point.
numPoints
public int numPoints()
- Returns the total number of fixture points.
- Returns:
- The number of fixels.
getValue
public float getValue(String value)
- Gets the x,y,z,i,j or k value for the current fixel.
- Parameters:
- value - One of either "x", "y", "z", "i", "j" or "k"
- Returns:
- The floating point value of the specified parameter.
All Packages Class Hierarchy This Package Previous Next Index