Class NURBSpline
- java.lang.Object
-
- com.macrofocus.high_d.parallelcoordinates.geometry.curve.Curve
-
- com.macrofocus.high_d.parallelcoordinates.geometry.curve.BSpline
-
- com.macrofocus.high_d.parallelcoordinates.geometry.curve.NURBSpline
-
public class NURBSpline extends BSpline
General implementation of the Non-Uniform Rational B-spline or NURB-Spline. The main advantage of the NURB-Spline over the B-Spline is the ability to represent conic sections. To do this, a curve with degree of 2 is used. Figure 1 contains examples of conic arcs.
NURB-Splines can also be used to generate circles as shown in figure 2.
As seen in the figures, every control-point has an associated weight value. The weight-values control how much relative pull each control-point has on the curve. If the weight-value is 0, then the associated point will have no affect on the curve. If a point has an associated weight of 0, but the curve is expected to pass through that point, then it is likely that the result of evaluation will be the origin. All weights must be >= 0.
-
-
Constructor Summary
Constructors Constructor Description NURBSpline(ControlPath cp, GroupIterator gi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendTo(com.macrofocus.high_d.parallelcoordinates.geometry.curve.MultiPath mp)
The requirements of the appendTo method include the requirements of the BSpline appendTo method, plus a couple more.protected void
eval(double[] p)
The eval method evaluates a point on a curve given a parametric value "t".boolean
getUseWeightVector()
Returns the value of the useWeightVector flag.ValueVector
getWeightVector()
Returns the weight-vector.void
resetMemory()
Resets the shared memory to the initial state.void
setUseWeightVector(boolean b)
Sets the value of the useWeightVector flag.void
setWeightVector(ValueVector v)
Sets the weight-vector.-
Methods inherited from class com.macrofocus.high_d.parallelcoordinates.geometry.curve.BSpline
getDegree, getKnotVector, getKnotVectorType, getSampleLimit, getUseDefaultInterval, setDegree, setInterval, setKnotVector, setKnotVectorType, setSampleLimit, setUseDefaultInterval, t_max, t_min
-
Methods inherited from class com.macrofocus.high_d.parallelcoordinates.geometry.curve.Curve
getConnect, getControlPath, getGroupIterator, setConnect
-
-
-
-
Constructor Detail
-
NURBSpline
public NURBSpline(ControlPath cp, GroupIterator gi)
-
-
Method Detail
-
eval
protected void eval(double[] p)
The eval method evaluates a point on a curve given a parametric value "t". The parametric value "t" is stored in the last index location of the specified double array. This value should not be changed. The dimension of the point to evaluate is p.length - 1. The result of the evaluation is placed in index locations 0 .. p.length - 2 (inclusive). The eval method should remain protected except for those curves that do no need any preparation to be done in the appendTo method.
-
getWeightVector
public ValueVector getWeightVector()
Returns the weight-vector.- See Also:
setWeightVector(ValueVector)
-
setWeightVector
public void setWeightVector(ValueVector v)
Sets the weight-vector.- See Also:
getWeightVector()
-
getUseWeightVector
public boolean getUseWeightVector()
Returns the value of the useWeightVector flag. The default value is true.- See Also:
setUseWeightVector(boolean)
-
setUseWeightVector
public void setUseWeightVector(boolean b)
Sets the value of the useWeightVector flag. If the flag is true, then the internal weightVector will be used. If the flag is false, then all weights will be assumed to be 1.- See Also:
getUseWeightVector()
-
appendTo
public void appendTo(com.macrofocus.high_d.parallelcoordinates.geometry.curve.MultiPath mp)
The requirements of the appendTo method include the requirements of the BSpline appendTo method, plus a couple more. The additional requirements only apply if the useWeightVector flag is true. If so, then the weight-vector must have size equal to the group-size of the GroupIterator and all weights must have a value >= 0. This method returns quietly if these requirements are not met.- Overrides:
appendTo
in classBSpline
- See Also:
BSpline.appendTo(com.macrofocus.high_d.parallelcoordinates.geometry.curve.MultiPath)
-
resetMemory
public void resetMemory()
Description copied from class:Curve
Resets the shared memory to the initial state.- Overrides:
resetMemory
in classBSpline
-
-