Class description

This section describes classes used to implement this project.



Polydisp
This is an extension of applet class and integrates the canvas where a polyhedron is drawn, the user interface and event handling functions.

Inp_panel_1
A class which defines an interface of data selection and redraw option.

Inp_panel_2
A class which defines an interface of rotation, color and zoom option.

Inp_panel_3
A class which defines an interface of a list. This is used for vertex list and face list.

Adjust
A class which defines an interface of an adjust part for Inp_panel_3


VisualObject
The abstract class of Polyhedron and Genpoly. This class has 4 abstract methods, 2 for color setting and 2 for coordinate transform.

Polyhedron
The subclass of VisualObject. This class declares the vertices of a polyhedron, front color and back color. This class can represent either a polyhedron or an axis. It also defines several methods for drawing itself on a screen.

Genpoly
The subclass of Polyhedron. The 4 instances of this class appear in the class of Tcanvas, which represent either a real polyhedron on the screen, x axis, y axis or z axis. This class also implements transformPolygonToEye method which transforms a polygon in a world coordinate to the one in a view coordinate.


Tcanvas
This class is an extension of Canvas, which integrates related classes in order to draw a polyhedron on a screen. It creates instances of Genpoly, VisualWorld and some other classes. It sets up and updates camera parameters. It defines functions provided in Inp_panel_2.

ViewTransformer
This class implements functions which define a screen height, a screen width and a matrix for the transformation. It also provides Tview and Tpers

VisualWorld
It provides functions for setting up camera parameters and preparing transformation matrix. It also paints a background of the screen and calls "project" method in VisualObject.

Polygon3D
A representation of a polygon in 3D coordinate. This is a single face of a polyhedron.

VectorPolygon3D
A queue of Polygon3D. This represents a whole polyhedron as a collection of faces.


Matrix4x4
A class which represents a 4x4 matrix. It also provides functions related to itself.

Vectorf
A class which represents a floating point vector. It also provides functions related to itself.

Vector4
A subclass of Vectorf. This defines a 4 elements vector.

VectorI
A class which represents an integer vector. It also provides functions related to itself.

IntVector2
A subclass of VectorI. It defines a 2 elements vector. This is for the poisition on the screen.

ITrig
A class which provides sin and cos functions based on radian.


source code