medusa.georgios.color_factory
Class AbstractCurve3f
- java.lang.Object
-
- medusa.georgios.color_factory.AbstractCurve3f
-
- Direct Known Subclasses:
- CubicBezierCurve3f
public abstract class AbstractCurve3f extends java.lang.ObjectFrom this classAbstractCurveall further curve classes are subclassed. It defines the abstract interface to all kind of curves defined by a list of coordinates to approximate or interpolate. Additionally it implements basic index mapping and access functionalities.
-
-
Constructor Summary
Constructors Constructor and Description AbstractCurve3f()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract Point3fcomputePoint(float parameter)Returns the point of the curve at the specifiedparameter.abstract Vector3fcomputeTangent(float parameter)Returns the tangent to the curve at the specifiedparameter.java.util.ArrayListgetCoordinates()Gets theCoordinatesattribute of theAbstractCurve3fobject.booleanisUseDefaultDomain()Retrieves domain repsonsibility flag.intmapCurveParameterToSegmentIndex(float parameter)Maps the specified parameter to segment index.floatmapCurveParameterToSegmentParamter(int index, float parameter)Maps the specified parameter to segment parameter.voidsetCoordinates(java.util.ArrayList coordinates)Sets the coordinates of the curve.voidsetDomain(int domainStart, int domainStop)Sets the domain start and end indexvoidsetUseDefaultDomain(boolean useDefaultDomain)Computes the length of the curve.
-
-
-
Method Detail
-
setCoordinates
public void setCoordinates(java.util.ArrayList coordinates)
Sets the coordinates of the curve. Note that all entries in the specified vector have to be instances ofTuple3f. This restriction is not checked and may lead to aClassCastException.- Parameters:
coordinates- The newCoordinatesvalue.
-
setUseDefaultDomain
public void setUseDefaultDomain(boolean useDefaultDomain)
Computes the length of the curve. The default implementation assumes a linear connected curve. Sets the flag indicating whether to give control of the domain setting to the user or ajust it itself (default).- Parameters:
useDefaultDomain- specifies new flag setting
-
setDomain
public void setDomain(int domainStart, int domainStop)Sets the domain start and end index- Parameters:
domainStart- specifies the start index of the new.domainStop- specifies the start index of the new domain.
-
getCoordinates
public java.util.ArrayList getCoordinates()
Gets theCoordinatesattribute of theAbstractCurve3fobject.- Returns:
- The
Coordinatesvalue.
-
isUseDefaultDomain
public boolean isUseDefaultDomain()
Retrieves domain repsonsibility flag.- Returns:
- Returns the current domain flag setting
-
computeTangent
public abstract Vector3f computeTangent(float parameter)
Returns the tangent to the curve at the specifiedparameter.- Parameters:
parameter- Description of parameter.- Returns:
- Description of the returned value.
-
computePoint
public abstract Point3f computePoint(float parameter)
Returns the point of the curve at the specifiedparameter. The curve domain is defined by the domain setting. The interval [0, 1] maps linear to the domain.- Parameters:
parameter- Description of parameter.parameter- specifies the parameters to compute the point- Returns:
- Description of the returned value.
-
mapCurveParameterToSegmentIndex
public int mapCurveParameterToSegmentIndex(float parameter)
Maps the specified parameter to segment index.- Parameters:
parameter- Description of parameter.parameter- The parameter will be mapped to the segments defined by the coordinates- Returns:
- Returns index of the segment that contains the
parameteraccording point
-
mapCurveParameterToSegmentParamter
public float mapCurveParameterToSegmentParamter(int index, float parameter)Maps the specified parameter to segment parameter.- Parameters:
index- The index of the segment, this should be computed using themapParameterToIndexmethodparameter- The parameter will be mapped to the parameter in the segment domain.- Returns:
- Returns segment parameter
-
-
DMelt 3.0 © DataMelt by jWork.ORG