All Packages  This Package  Class Hierarchy  Class Search  Index

Class jkp.geometry.mesh.awt.MeshDisplayPanel
java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----jkp.geometry.mesh.awt.MeshDisplayPanel

  Summary

public class  MeshDisplayPanel
     extends java.awt.Canvas
     implements jkp.geometry.mesh.MeshProcessable
{
          // Fields 5
     private static double DEFAULTMESHTOLERANCE;
     private Mesh displaymesh;
     private Mesh mesh;
     private int mode;
     private int tricount;

          // Constructors 4
     public MeshDisplayPanel();
     public MeshDisplayPanel(Grid);
     public MeshDisplayPanel(Grid, double);
     public MeshDisplayPanel(Mesh);

          // Methods 14
     private void debugTriangle(GridPoint[], int[], int[]);
     public Grid getGrid();
     public Mesh getMesh();
     public void paint(Graphics);
     private int paintMesh(Graphics);
     private void paintMeshSelection(Mesh);
     private void paintOneTriangle(Graphics, Grid, BasicMesh, BasicMesh, BasicMesh);
     private void paintReference(Graphics);
     private void printPlotPoints(int[], int[]);
     public int processMeshNode(BasicMesh, Object);
     public int processMeshNode(BuildableMesh, Object);
     public void setMesh(Mesh);
     public void setMode(int);
     public void updateMeshSelection(Mesh);
}

Canvas that displays a mesh.

Version:
0.001a 4 Jul 1998
Author:
Jack Perdue j-perdue@tamu.edu si_slick@cy-net.net




  Fields

· DEFAULTMESHTOLERANCE

Summary  |  Top

   private static double DEFAULTMESHTOLERANCE

Default terrain deviation tolerance.


· displaymesh

Summary  |  Top
   private Mesh displaymesh

The currently select submesh.


· mesh

Summary  |  Top
   private Mesh mesh

The master mesh -- that is, the root node of the whole mesh.


· mode

Summary  |  Top
   private int mode

Current mode (Mandelbrot set or 5-minute elevation data)


· tricount

Summary  |  Top
   private int tricount

Number of triangles in mesh.


  Constructors

· MeshDisplayPanel

Summary  |  Top

   public MeshDisplayPanel() 

Constructs a MeshDisplayPanel with no mesh.



· MeshDisplayPanel

Summary  |  Top
   public MeshDisplayPanel(Grid grid) 

Constructs a MeshDisplayPanel using the given grid to construct a mesh with the default terrain deviation tolerance.

Parameter Description
grid The input grid.



· MeshDisplayPanel

Summary  |  Top
   public MeshDisplayPanel(Grid grid, 
                           double tolerance) 

Constructs a MeshDisplayPanel using the given grid to construct a mesh with the given terrain deviation tolerance.

Parameter Description
grid The input grid.
tolerance The terrain deviation tolerance.



· MeshDisplayPanel

Summary  |  Top
   public MeshDisplayPanel(Mesh mesh) 

Construct a MeshDisplayPanel with the given mesh.

Parameter Description
mesh The mesh to display.



  Methods

· debugTriangle

Summary  |  Top
   private void debugTriangle(GridPoint[] p, 
                              int[] x, 
                              int[] y) 

Top secret

Parameter Description
p +XX+
x +XX+
y +XX+



· getGrid

Summary  |  Top
   public Grid getGrid() 

Retrives the grid which is the basis for the master mesh.

Returns:
The grid.


· getMesh

Summary  |  Top
   public Mesh getMesh() 

Retrieves the current master mesh.

Returns:
The master mesh.


· paint

Summary  |  Top
   public void paint(Graphics g) 

Paint the MeshDisplayPanel. Paints the grid, the mesh, reference marks and the current selected mesh.

Parameter Description
g The graphics context.

Overrides:
paint in class Canvas


· paintMesh

Summary  |  Top
   private int paintMesh(Graphics g) 

Paint the entire master mesh on the canvas.

Parameter Description
g The graphics context to paint to.

Returns:
The number of triangles painted.


· paintMeshSelection

Summary  |  Top
   private void paintMeshSelection(Mesh mesh) 

Paint the currently selected mesh.

Parameter Description
mesh The selected mesh.



· paintOneTriangle

Summary  |  Top
   private void paintOneTriangle(Graphics g, 
                                 Grid grid, 
                                 BasicMesh m0, 
                                 BasicMesh m1, 
                                 BasicMesh m2) 

Paints one triangle of a mesh node on the canvas/panel.

Parameter Description
g The graphics context.
grid The underlying grid
m0 First point.
m1 Second point.
m2 Third point.



· paintReference

Summary  |  Top
   private void paintReference(Graphics g) 

Paint reference lines (first two submesh divisions) on canvas.

Parameter Description
g The graphics context to paint to.



· printPlotPoints

Summary  |  Top
   private void printPlotPoints(int[] x, 
                                int[] y) 

Debug

Parameter Description
x +XX+
y +XX+



· processMeshNode

Summary  |  Top
   public int processMeshNode(BasicMesh m, 
                              Object o) 

Process a single mesh node while traversing the mesh. As implemented by this class, write a triangle to the output file.

Parameter Description
m The current submesh being traversed.
o Parameter to this routine (OutputStream in this case)

Returns:
The number of triangles in the mesh.


· processMeshNode

Summary  |  Top
   public int processMeshNode(BuildableMesh m, 
                              Object o) 

Paints a mesh nodes triangles.

Parameter Description
m The mesh node to paint.
o The graphics context to paint to.

Returns:
The number of triangles painted.
Implements:
processMeshNode in interface MeshProcessable


· setMesh

Summary  |  Top
   public void setMesh(Mesh mesh) 

Sets the master mesh to be displayed.

Parameter Description
mesh The master mesh.



· setMode

Summary  |  Top
   public void setMode(int mode) 

Set the current mesh mode -- terrain or Mandelbrot set.

Parameter Description
mode The new mode.



· updateMeshSelection

Summary  |  Top
   public void updateMeshSelection(Mesh mesh) 

Update the currently selected mesh.

Parameter Description
mesh The newly selected mesh.



All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7