|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.project.PjProject
|
+--vgp.tutor.linear.PjLinear
Simple interactive linear algebra applet performs vector calculations on two vectors and shows the result vector.
The result vector has 3D coordinates because of the possible cross product mode. Nevertheless, the dimension of the two argument vectors has been chosen 2D since then the vectors always lie in the xy-plane in the display, even if the camera is in perspective mode. This makes the dragging of the argument vectors in cross product mode more intuitive. Note, the method computeResult() may be simplified a little if one chooses 3D coordinates for all vectors.
| Field Summary | |
protected int |
m_mode
Computation mode, possibly values are MODE_... constants. |
protected PgPolygon |
m_result
The result vector is a single polygon. |
protected PgPolygonSet |
m_vectors
Two argument vectors are represented as two lines of a polygon set determined by their endpoints. |
static int |
MODE_ADD
Summation mode, result is sum of two argument vectors. |
static int |
MODE_CROSS
Cross product mode, result is cross product of two argument vectors. |
static int |
MODE_SUB
Difference mode, result is difference of two argument vectors. |
| Fields inherited from class jv.project.PjProject |
m_anim, m_bAutoFit, m_display, m_displayList, m_geometry, m_parm, m_rootGeometry |
| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, m_infoPanel, m_name, m_panelList, m_parent, m_tag, m_updateList, NUM_TAGS |
| Constructor Summary | |
PjLinear()
Constructors creates two argument vectors and a result vector. |
|
| Method Summary | |
void |
computeResult(int mode)
Perform vector arithmetic on two argument vectors to compute the result vector. |
int |
getMode()
Get the current computation mode, possibly values are MODE_... constants. |
void |
init()
Initialize all instance variables of this project. |
int |
setMode(int mode)
Set the current computation mode, possibly values are MODE_... constants. |
void |
start()
Method is invoked during loading of a project in JavaView. |
boolean |
update(java.lang.Object event)
Perform recomputations whenever a child has changed. |
| Methods inherited from class jv.project.PjProject |
addDisplay, addGeometry, addGeometry, dispose, dragDisplay, dragInitial, dragVertex, fitDisplays, getAnimation, getDisplay, getDisplays, getGeometry, getGeometry, getNumGeometries, getParameter, getViewer, hasAnimation, hasDisplay, isEnabledAutoFit, markVertices, pickDisplay, pickInitial, pickVertex, removeDisplay, removeGeometries, removeGeometry, selectDisplay, selectGeometry, setAnimation, setDisplay, setEnabledAutoFit, setParameter, setTime, setViewer, stop, unmarkVertices |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, updatePanels |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.anim.PsTimeListenerIf |
getName |
| Methods inherited from interface jv.project.PvPickListenerIf |
getName |
| Methods inherited from interface jv.object.PsUpdateIf |
getFather, getName, setParent |
| Field Detail |
public static final int MODE_ADD
public static final int MODE_SUB
public static final int MODE_CROSS
protected PgPolygonSet m_vectors
protected PgPolygon m_result
protected int m_mode
| Constructor Detail |
public PjLinear()
| Method Detail |
public void init()
init in class PjProjectpublic void start()
PjProject
If a project has an animation object, then the animation panel is shown
when the project's this start() method is invoked during loading
of the project. Use setAnimation(PsAnimation)
to register an animation.
If auto fit is enabled then scenery is scaled to fit in each display.
start in class PjProjectjv.project.PjProjectPvViewerIf.start(),
#isEnabledAutoFit(boolean)public int getMode()
public int setMode(int mode)
public void computeResult(int mode)
public boolean update(java.lang.Object event)
update in class PsObjectjv.object.PsUpdateIfevent - carries a lot of informationPsObject,
PsUpdateIf.getFather(),
PsUpdateIf.setParent(PsUpdateIf)
|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||