|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.piece.Features
public class Features
Data store for "features" (for feature-based warping/morphing).
Field Summary | |
---|---|
protected static java.lang.String |
CATEGORY
Object category. |
protected java.util.ArrayList<cz.cuni.jagrlib.piece.Features.Feature> |
features
Array of all registered features. |
static RegPiece |
reg
Static registration instance for this class. |
protected static java.lang.String |
TEMPLATE_NAME
Object template identifier. |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.FeatureStore |
---|
FEATURE_ARROW, FEATURE_POINT, FEATURE_TRIANGLE, NULL |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
Features()
|
Method Summary | |
---|---|
protected cz.cuni.jagrlib.piece.Features.Feature |
feature(int id)
|
protected cz.cuni.jagrlib.piece.Features.Feature |
feature(int id,
int time)
|
int |
featureEnd(int id)
Returns Time of death of the given feature. |
int |
featureStart(int id)
Returns Birth-time of the given feature. |
int |
featureType(int id)
Reads feature-type ( FeatureStore.FEATURE_POINT , FeatureStore.FEATURE_ARROW or FeatureStore.FEATURE_TRIANGLE ). |
protected java.lang.Object |
getAttr(int id,
double time,
java.lang.String name)
|
double[] |
getCoords(int id,
double time,
double[] coords)
Reads feature coordinates of the given feature in the given time. |
java.lang.Object |
getParam(int id,
double time,
java.lang.String name)
Reads the given general parametr in the given time. |
double |
getParamDouble(int id,
double time,
java.lang.String name)
Reads the given floating-point parametr in the given time. |
int |
getParamInt(int id,
double time,
java.lang.String name)
Reads the given integer parametr in the given time. |
int |
insertFeature(int timeFrom,
int timeTo,
int type)
Inserts a new feature of the given type. |
int |
nextFeature(int id,
double time)
Finds the next feature in the database. |
void |
removeFeature(int id)
Removes the given feature from the database. |
protected void |
setAttr(int id,
int time,
java.lang.String name,
java.lang.Object value)
|
void |
setCoords(int id,
int time,
double[] coords)
Sets feature coordinates of the given feature in the given keyframe-time. |
void |
setParam(int id,
int time,
java.lang.String name,
java.lang.Object value)
Sets feature's general parameter in the given keyframe-time. |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
void |
setTimes(int id,
int timeFrom,
int timeTo)
Sets feature life-time. |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, get, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit, get, set |
Field Detail |
---|
protected java.util.ArrayList<cz.cuni.jagrlib.piece.Features.Feature> features
protected static final java.lang.String TEMPLATE_NAME
protected static final java.lang.String CATEGORY
public static final RegPiece reg
Constructor Detail |
---|
public Features()
Method Detail |
---|
protected final cz.cuni.jagrlib.piece.Features.Feature feature(int id)
protected final cz.cuni.jagrlib.piece.Features.Feature feature(int id, int time)
protected final java.lang.Object getAttr(int id, double time, java.lang.String name)
protected final void setAttr(int id, int time, java.lang.String name, java.lang.Object value)
public int insertFeature(int timeFrom, int timeTo, int type)
insertFeature
in interface FeatureStore
type
- Feature type (FeatureStore.FEATURE_POINT
, FeatureStore.FEATURE_ARROW
or FeatureStore.FEATURE_TRIANGLE
).
removeFeature(int)
,
setTimes(int, int, int)
,
setCoords(int, int, double[])
,
setParam(int, int, java.lang.String, java.lang.Object)
public void removeFeature(int id)
removeFeature
in interface FeatureStore
id
- Handle of an existing feature.public int nextFeature(int id, double time)
FeatureStore.NULL
. This function also returns FeatureStore.NULL
if there is no other feature..
nextFeature
in interface FeatureStore
id
- Handle of previous feature (or FeatureStore.NULL
if we are restaring an iteration).time
- Time of interest.
FeatureStore.NULL
if the previous was the last one).public int featureType(int id)
FeatureStore.FEATURE_POINT
, FeatureStore.FEATURE_ARROW
or FeatureStore.FEATURE_TRIANGLE
).
featureType
in interface FeatureStore
public void setTimes(int id, int timeFrom, int timeTo)
setTimes
in interface FeatureStore
id
- Handle of a feature.timeFrom
- Birth-time of the feature.timeTo
- Death-time of the feature.public int featureStart(int id)
featureStart
in interface FeatureStore
public int featureEnd(int id)
featureEnd
in interface FeatureStore
public void setCoords(int id, int time, double[] coords)
setCoords
in interface FeatureStore
id
- Handle of a feature.time
- Keyframe-time.coords
- Coordinate array (e.g. double[4]
for 2D arrow feature:
[ x0, y0, x1, y1 ]
).public double[] getCoords(int id, double time, double[] coords)
getCoords
in interface FeatureStore
id
- Handle of a feature.time
- Time of interest. Needs not be keyframe-time.coords
- Pre-allocated coordinate array to be filled
(double[4]
for 2D arrow feature: [ x0, y0, x1, y1 ]
). Can be null
.
null
.public void setParam(int id, int time, java.lang.String name, java.lang.Object value)
setParam
in interface FeatureStore
id
- Handle of a feature.time
- Keyframe-time (FeatureStore.NULL
for time-independent parameter).name
- Parameter identifier.value
- New parameter value.public int getParamInt(int id, double time, java.lang.String name)
getParamInt
in interface FeatureStore
id
- Handle of a feature.time
- Time of interest. Needs not be keyframe-time.name
- Parameter identifier.
public double getParamDouble(int id, double time, java.lang.String name)
getParamDouble
in interface FeatureStore
id
- Handle of a feature.time
- Time of interest. Needs not be keyframe-time.name
- Parameter identifier.
public java.lang.Object getParam(int id, double time, java.lang.String name)
getParam
in interface FeatureStore
id
- Handle of a feature.time
- Time of interest. Needs not be keyframe-time.name
- Parameter identifier.
public static int setTemplate(Template t, int ord)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |