public class PjLinear extends PjProject
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.
Modifier and Type | Field and Description |
---|---|
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.
|
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
Constructor and Description |
---|
PjLinear()
Constructors creates two argument vectors and a result vector.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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, setBackColor, setBorderType, setDisplay, setEnabledAutoFit, setGeometry, setParameter, setTime, setViewer, stop, unmarkVertices
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
getName
public static final int MODE_ADD
public static final int MODE_SUB
public static final int MODE_CROSS
public PjLinear()
public void init()
public 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 PjProject
PvViewerIf.start()
,
PjProject.isEnabledAutoFit()
public int getMode()
public int setMode(int mode)
public void computeResult(int mode)
public boolean update(java.lang.Object event)
update
in interface PsUpdateIf
update
in class PsObject
event
- carries a lot of informationPsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
"