physicon.graphLib
Class PointArrayCurve

java.lang.Object
  |
  +--physicon.graphLib.GraphElementBase
        |
        +--physicon.graphLib.GraphCurveBase
              |
              +--physicon.graphLib.PointArrayCurve

public class PointArrayCurve
extends GraphCurveBase

Represents the curve consisting of the number of points


Constructor Summary
PointArrayCurve(CurveDrawerBase _drawer)
          Constructor.
 
Method Summary
 DoublePoint getLocalPoint(double _param)
          Returns the point at the given parameter value.
 double getMaxParamValue()
          Returns the maximal parameter value maximal parameter value is equal to the number of the points in the curve - 1.
 double getMinParamValue()
          Returns the minimal parameter value - 0
 DoublePoint getPointAt(int _i)
          Returns the point at the given index
 void insertPointAt(DoublePoint _dpt, int _i)
          Adds new point to the current curve
 int pointsNumber()
          Returns the number of points in the array
 void removeAllPoints()
          Removes all points
 void removePointAt(int _i)
          Removes point with the given index from the curve.
 void updateDrawer()
          Updates drawer.
 
Methods inherited from class physicon.graphLib.GraphCurveBase
getGlobalPoint, getNormLocalPoint, normilizeParamValue, restoreParamValue
 
Methods inherited from class physicon.graphLib.GraphElementBase
addDependent, contains, contains, getContainer, getContext, getDepend, getDrawer, getGEObject, getGraphElement, getRedrawFlag, getRefPoint, getRoughRect, getZLevel, isCreated, isVisible, setDrawer, setRedrawFlag, setRefPoint, setVisible, setZLevel, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointArrayCurve

public PointArrayCurve(CurveDrawerBase _drawer)
Constructor. The curve is empty (it have no points) after creating. You have to add points to it before inserting if to the container.
Parameters:
_drawer - - the drawer object for this curve.
Method Detail

insertPointAt

public void insertPointAt(DoublePoint _dpt,
                          int _i)
Adds new point to the current curve
Parameters:
_dpt - - the point which is to be added.
_i - - the number of point in the point set. set this value to -1 to add point to the end of point set.

getPointAt

public DoublePoint getPointAt(int _i)
Returns the point at the given index
Parameters:
_i - - the given index

removePointAt

public void removePointAt(int _i)
Removes point with the given index from the curve. All other points are shifted downward.
Parameters:
_i - - the given index

removeAllPoints

public void removeAllPoints()
Removes all points

pointsNumber

public int pointsNumber()
Returns the number of points in the array

updateDrawer

public void updateDrawer()
Updates drawer. The point array of drawer is filled in this function
Overrides:
updateDrawer in class GraphElementBase

getMinParamValue

public double getMinParamValue()
Returns the minimal parameter value - 0
Overrides:
getMinParamValue in class GraphCurveBase

getMaxParamValue

public double getMaxParamValue()
Returns the maximal parameter value maximal parameter value is equal to the number of the points in the curve - 1.
Overrides:
getMaxParamValue in class GraphCurveBase

getLocalPoint

public DoublePoint getLocalPoint(double _param)
Returns the point at the given parameter value. The double parameter value is rounded to the closest int value. If the parameter is less than 0, first point is returned. If parameter is grater then maximum parameter value, last point is returned.
Parameters:
_param - - the given parameter value
Overrides:
getLocalPoint in class GraphCurveBase