vsTASKER 7 User Manual
×
Menu
Index

Curves

 
Curves are Graph objects intended to represent data in a form of one or multiple curves sets. Curves are drawn on the screen using the mouse or imported from other sources.
Curves data are stored in the runtime database and loaded at runtime.
An API allows any runtime object (Entity, Logic, Component, etc.) to query a curve to get interpolated or extrapolated data.
Curves are a powerful way to replace a mathematical function when only empiric data is available.
 
 
To add a new Curve (set) to a Container (once inside), use the button on the vertical toolbar or use the context menu (mouse right click)
Give a name to the Curve.
 
 
First, select the Curves and use the Edit popup menu to set the properties
Edit Chart: see Properties and Data for details
 
Rename: change the name of the current selected Curves
 
Cut: copy the Curves to the clipboard and remove it from the current container
 
Copy: copy the Curves to the clipboard
 
Duplicate: do a copy then paste on the same container
 
Delete: remove the selected Curves from the container and Database.
 
 
Double click on the Curve icon to edit the Curve(s) shapes.
 
When nothing is selected:
Edit Curves: call the properties window.
Add Single Curve: select this option to create a new curve with a Z value (available only for multiple curves). Click on the graph to enter points until done.
Up: Close the Curves and return to the container view.
 
 
To select a Curve, just click on the curve itself. Color changes to magenta and Points are displayed.
When a Curve is selected:
Properties: call the properties window.
 
Add Points: Use this option then click on the graph to enter points until done.
 
Move: select this option then click on the Curve and with the mouse button down, drag the curve on the graph.
 
Duplicate: create another similar Curve, offset on the graph. Note that Z value is kept unchanged.
 
Delete: remove the whole curve from the set.
 
 
To reshape the Curve, just select a Point and drag it around with the mouse.
 
To add new points in a selected Curve, click the button on the vertical toolbar (or use Add Points on the popup menu) then click on the graph everywhere new points must be added.
To finish the insertion, just right click and use Done.
\
 
To remove a Point, select it and use Delete.
 
 
When a Curve (or a set of Curves) is defined, the purpose is using it to retrieve the Y value given the X (and maybe Z) value(s).
From the source code of any vsTASKER object, do the following to get the curve from the graphs library:
 
 Vt_Curve* my_curve = (Vt_Curves*) vt_rtc->graphs->find(TT_Curves, "container::curve"));
 
where container is the name of the container holding the Curve and curve is the name of the curve. If container is not provided, the first curve which will match the name will be returned.
 
Using the returned curve (pointer), use the simple getValue() function to retrieve the Y:
 float y = my_curve->getValue(x);
or
 float y = my_curve->getValue(x,z);
 
You can get the full API list in /include/engine/vt_curves.h