vgp.curve.zigzag
Class PjZigZag
- java.lang.Object
-
- jv.object.PsObject
-
- jv.project.PjProject
-
- vgp.curve.zigzag.PjZigZag
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsTimeListenerIf, PsUpdateIf, PvPickListenerIf
public class PjZigZag extends PjProject
Computes a Zigzag construction as described by Peter Giblin. P. Giblin, Zigzags, http://www.liv.ac.uk/~pjgiblin/papers/zigzag-final.pdf- See Also:
- Serialized Form
- Author:
- Janis Bode
- Version:
- 05.06.07, 1.10 revised (kp) Adjusted to JavaView style.
19.01.07, 1.00 created (jb)
-
-
Field Summary
-
Fields inherited from class jv.object.PsObject
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 Summary
Constructors Constructor and Description PjZigZag()Sets the required polygon and the panels for the number of lines, Length of the Zag and the angles of the zig and the zag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description PdVector[]computeVertices(PgPolygonSet z_short, double[] vFac, int[] length)Computes the vertices of the ZigZag with the given parameters.voidcomputeZigZag()Computes the ZigZag construction depending on the given prameters: angles, lengths and number of lines.voidinit()Initializes the Applet.PiVector[]showZags(PgPolygonSet z_short, int delta)Draws the Zags extended to infinity.PiVector[]showZigZag(PgPolygonSet z_short)Draws the ZigZag in original size.voidstart()Starts the Appletbooleanupdate(java.lang.Object event)Handles the events of the Panel-
Methods inherited from class jv.project.PjProject
addDisplay, addGeometry, addGeometry, dispose, dragDisplay, dragInitial, dragVertex, fitDisplays, getAnimation, getDisplay, getDisplays, getGeometry, getGeometry, getNumGeometries, getParameter, getParameterInfo, getViewer, hasAnimation, hasDisplay, isEnabledAutoFit, markVertices, pickDisplay, pickInitial, pickVertex, removeDisplay, removeGeometries, removeGeometry, selectDisplay, selectGeometry, setAnimation, setBackColor, setBorderType, setDisplay, setEnabledAutoFit, setGeometry, setParameterInfo, setTime, setViewer, stop, unmarkVertices
-
Methods inherited from class jv.object.PsObject
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
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jv.anim.PsTimeListenerIf
getName
-
Methods inherited from interface jv.project.PvPickListenerIf
getName
-
-
-
-
Constructor Detail
-
PjZigZag
public PjZigZag()
Sets the required polygon and the panels for the number of lines, Length of the Zag and the angles of the zig and the zag.
-
-
Method Detail
-
init
public void init()
Initializes the Applet. Sets default values and draws the standard zigzag.
-
start
public void start()
Starts the Applet- Overrides:
startin classPjProject- See Also:
PvViewerIf.start(),PjProject.isEnabledAutoFit()
-
update
public boolean update(java.lang.Object event)
Handles the events of the Panel- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPsObject- Parameters:
event- carries a lot of information- Returns:
- true if event has been handled, otherwise false
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
computeZigZag
public void computeZigZag()
Computes the ZigZag construction depending on the given prameters: angles, lengths and number of lines. The length of the zig is held constantly at 100.
-
computeVertices
public PdVector[] computeVertices(PgPolygonSet z_short, double[] vFac, int[] length)
Computes the vertices of the ZigZag with the given parameters.- Parameters:
z_short- polygons that define the number of polygons in the zigzagvFac- vFac[0] = angle of zig, vFac[1] = angle of zaglength- m_length[0] = length of zig, m_length[1] = length of zag- Returns:
- the vertices of the zigzag construction
-
showZags
public PiVector[] showZags(PgPolygonSet z_short, int delta)
Draws the Zags extended to infinity.- Parameters:
z_short- the polygons drawn in this method are baed on the points in this polygonsetdelta- the number of zags skipped- Returns:
- the polygons of which each contains an extended zag (2 verices). The number of polygons is defined by the number of polygons in z_short.
-
showZigZag
public PiVector[] showZigZag(PgPolygonSet z_short)
Draws the ZigZag in original size.- Parameters:
z_short- the polygons drawn in this method are baed on the points in this polygonset- Returns:
- the polygons of which each contains a zig and a zag (3 vertices). The number of polygons is defined by the number of polygons in z_short.
-
-
"