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.



Variable Index

 o M
Object which contains the solid model, input parser, orientation matrix and applied fixture points.
 o MD
Object which knows how to display the model M.
 o parent
The panel which contains this ModelViewer and all of the user interface buttons.

Constructor Index

 o ModelViewer(model, ModelPanel, Color)
Constructor for an ModelViewer.

Method Index

 o action(model, String)
Called by the model to report messages.
 o action(ModelDisplay, String)
Called by the ModelDisplay to report messages.
 o change_culling(boolean)
Determines whether backface culling should be performed during rotation.
 o changeMode(boolean)
Called to change between rotation and fixel selection modes.
 o getValue(String)
Gets the x,y,z,i,j or k value for the current fixel.
 o minimumSize()
 o modifyPoint()
Remove the current fixture point.
 o 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.
 o mouseDrag(Event, int, int)
Called when mouse is being dragged across the model, represents rotation.
 o mouseMove(Event, int, int)
Called as mouse moves across the model.
 o mouseUp(Event, int, int)
Called when the mouse button has been released.
 o numPoints()
Returns the total number of fixture points.
 o paint(Graphics)
Called to paint the model.
 o preferredSize()
 o set_edge(boolean)
Determines whether edges should be drawn.
 o set_render(boolean)
Determines whether the model should be rendered

Variables

 o M
  public model M
Object which contains the solid model, input parser, orientation matrix and applied fixture points.
 o MD
  public ModelDisplay MD
Object which knows how to display the model M.
 o parent
  public ModelPanel parent
The panel which contains this ModelViewer and all of the user interface buttons.

Constructors

 o 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

Methods

 o minimumSize
  public Dimension minimumSize()
Overrides:
minimumSize in class Component
 o preferredSize
  public Dimension preferredSize()
Overrides:
preferredSize in class Component
 o 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
 o 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
 o 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?
 o set_render
  public void set_render(boolean new_value)
Determines whether the model should be rendered
Parameters:
new_value - Should the model be rendered?
 o set_edge
  public void set_edge(boolean new_value)
Determines whether edges should be drawn.
Parameters:
new_value - Should edges be drawn?
 o 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
 o 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
 o 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
 o 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
 o changeMode
  public void changeMode(boolean nextMode)
Called to change between rotation and fixel selection modes.
Parameters:
nextMode - False for fixel selection, true for rotation
 o 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
 o modifyPoint
  public void modifyPoint()
Remove the current fixture point.
 o numPoints
  public int numPoints()
Returns the total number of fixture points.
Returns:
The number of fixels.
 o 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