📄 curve.h
字号:
Curve(LPCSTR lpcszYData); // Construct a Curve from a Y data set name and an associated X data set.
/**
Constructor for Curve class. Both the X and Y data sets are specified by name. Operations on the Curve
object do effect the specified X and Y data sets.
Example:
// Assumes Data1_A and Data1_B exist and contain data
Curve crv( "Data1_A", "Data1_B" ); // Attach Origin C Curve object to internal Origin data sets
crv.Sort(); // Does effect Data1_A and Data1_B
Parameters:
lpcszXData=Name of X Dataset
lpcszYData=Name of Y Dataset
SeeAlso:
Curve::Attach, Curve::Detach
*/
Curve(LPCSTR lpcszXData, LPCSTR lpcszYData); // Construct a Curve from X and Y data set names.
/**
Constructor for Curve class. Both the X and Y data sets are specified by Origin C Dataset objects
which are attached to internal Origin data sets. Operations on the Curve object do not effect the
associated Origin X and Y data sets.
Example:
// Assumes Data1_A and Data1_B exist and contain data
Dataset ds1("Data1_A"), ds2("Data1_B");
Curve crv( ds1, ds2 );
crv.Sort(); // Does not effect ds1, ds2
Parameters:
dsX=Origin C Dataset object attached to internal Origin X data set
dsY=Origin C Dataset object attached to internal Origin Y data set
SeeAlso:
Curve::Attach, Curve::Detach
*/
Curve(Dataset dsX, Dataset dsY); // Construct a Curve from X and Y Datasets.
/**
Constructor for Curve class. The X and Y data sets are specified by column number in an Origin C
worksheet object. Operations on the Curve object do effect the associated Origin X and Y worksheet
columns (data sets).
Example:
// Assumes Data1_A and Data1_B exist and contain data
Worksheet wks("Data1");
Curve crv( wks, 0, 1 ); // Data1 worksheet and columns 1 (X) and 2 (Y)
crv.Sort(); // Does effect columns 1 and 2 in wks
Parameters:
wks=Origin C Dataset object attached to an internal Origin worksheet
nColX=0 based offset or column number of X column (data set)
nColY=0 based offset or column number of Y column (data set)
SeeAlso:
Curve::Attach, Curve::Detach
*/
Curve(Worksheet & wks, int nColX, int nColY); // Construct a Curve from a Worksheet and X and Y column numbers.
/**
Constructor for Curve class. The Y data set is specified by column number in an Origin C
worksheet object and, if it exists, the Y column's internally associated X column is
automatically used for the X column. Otherwise, row numbers are used for the X data set.
Operations on the Curve object do effect the X and/or the specified Y column(s).
Example:
// Assumes Data1_B exists and contains data
Worksheet wks("Data1");
Curve crv( wks, 1 ); // Data1 worksheet and column 2 (Y)
crv.Sort(); // Does effect column 2 in wks
Parameters:
wks=Origin C Dataset object attached to an internal Origin worksheet
nColY=0 based offset or column number of Y column (data set)
SeeAlso:
Curve::Attach, Curve::Detach
*/
Curve(Worksheet & wks, int nColY); // Construct a Curve from a Worksheet, a Y column number, and an associated X column.
/**
Constructor for Curve class. The X and Y data sets are specified by an Origin C DataPlot object.
Operations on the Curve object do effect the associated data plot and underlying data sets in
Origin.
Example:
// Assumes Graph1 window with one or more data plots is active in Origin
GraphLayer gl = Project.ActiveLayer(); // Get active layer in project file
if(gl) // If valid graph layer...
{
DataPlot dp = gl.DataPlots(0); // Get first data plot in graph layer
if(dp) // If valid DataPlot...
{
Curve crv(dp); // Get Curve from DataPlot
crv.Sort(); // Does effect DataPlot
}
}
Parameters:
DataPlot=Origin C DataPlot object attached to an internal Origin data plot
SeeAlso:
Curve::Attach, Curve::Detach
*/
Curve(DataPlot& dp); // Construct a Curve from a DataPlot
/**
It creates a temporary curve object from the supplied source.
Example:
Paramaters:
cv = [in] source curve
nNumMissingInCopy = [output] number of missing values in the created curve.
nSrcOffset = index in source curve that the result curve's 1st point is copied from
dwOptions = a combination of values from the enumeration:
enum {
CURVECOPY_SCAN_OVER_MISSING_FROM_LEFT = 0x00000001, // if on, it will scan from the left (see the parameter nLower) until it finds the first nonmissing value
CURVECOPY_SCAN_OVER_MISSING_FROM_RIGHT = 0x00000002, // if on, it will scan back from the right (see the parameter nUpper) until it finds the first nonmissing value
CURVECOPY_SKIP_MISSING_INSIDE = 0x00000004, // if on, it will not copy any missing values found in the middle
CURVECOPY_REPLACE_MISSING_INSIDE = 0x00000008, // if on, any missing values in the middle will be replaced with the average of neighboring points (not used if the bit CURVECOPY_SKIP_MISSING_INSIDE is on)
};
nLower = lower index to start from or -1 to start from the lower bound.
nUpper = upper index to end at, or -1 to end at the upper bound.
*/
Curve(curvebase &cv, int &nNumMissingInCopy, int &nSrcOffset, DWORD dwOptions = 0, int nLower = -1, int nUpper = -1);
/**
Attach an Origin C Curve object to an internal Origin Y data set and its associated X data set. The Y data
set is specified by name and, if it exists, the Y data set's internally associated X data set is automatically
used for the X data set. Otherwise, row numbers are used for the X data set. Operations on the Curve object
do effect the X and/or the specified Y data set(s).
Example:
// Assumes Data1_B exists and contains data
Curve crv; // Declare Curve object
crv.Attach( "Data1_B" ); // Attach to Y data set by name
crv.Sort(); // Does effect Data1_B
Parameters:
lpcszYData=Name of Y Dataset
Return:
Returns TRUE on successful exit and FALSE on error.
SeeAlso:
Curve::Curve, Curve::Detach
*/
BOOL Attach(LPCSTR lpcszYData); // Attach an Origin C Curve object to an internal Origin Y data set and its associated X data set.
/**
Attach an Origin C Curve object to internal Origin X and Y data sets. Both the X and Y data sets are specified
by name. Operations on the Curve object do effect the specified X and Y data sets.
Example:
// Assumes Data1_A and Data1_B exist and contain data
Curve crv; // Declare Curve object
crv.Attach( "Data1_A", "Data1_B" ); // Attach Curve object to X and Y data sets by name
crv.Sort(); // Does effect data sets Data1_A and Data1_B
Parameters:
lpcszXData=Name of X Dataset
lpcszYData=Name of Y Dataset
Return:
Returns TRUE on successful exit and FALSE on error.
SeeAlso:
Curve::Curve, Curve::Detach
*/
BOOL Attach(LPCSTR lpcszXData, LPCSTR lpcszYData); // Attach an Origin C Curve object to internal Origin X and Y data sets.
/**
Detach an Origin C Curve object from internal Origin data sets. The Curve object can only
be attached to one pair of internal Origin data sets at a time but it may be sequentially
detached and re-attached as many times as desired.
Example:
// Assumes Data1_A, Data1_B, Data2_A, and Data2_B exist and contain data
Curve crv( "Data1_A", "Data1_B" ); // Declare Curve object and attach to X and Y data sets
crv.Sort();
crv.Detach(); // Detach Curve Object from X and Y data sets
crv.Attach( "Data2_A", "Data2_B" ); // Re-Attach Curve object to different X and Y data sets
crv.Sort();
Return:
Returns TRUE on successful exit and FALSE on error.
SeeAlso:
Curve::Attach, Curve::Curve
*/
BOOL Detach(); // Detach an Origin C Curve object from internal Origin data sets.
/**
Attach an Origin C Curve object to internal Origin X and Y datasets.
The X and Y data sets are specified by column number in an Origin C
worksheet object. Operations on the Curve object do affect the associated Origin X and Y worksheet
columns (data sets).
Example:
// Assumes Data1_A and Data1_B exist and contain data
Worksheet wks("Data1");
Curve crv; // Data1 worksheet and columns 1 (X) and 2 (Y)
crv.Attach( wks, 0, 1 ); // Data1 worksheet and columns 1 (X) and 2 (Y)
crv.Sort(); // Does affect columns 1 and 2 in wks
Parameters:
wks=Origin C Dataset object attached to an internal Origin worksheet
nColX=0 based offset or column number of X column (data set)
nColY=0 based offset or column number of Y column (data set)
Return:
Returns TRUE on successful exit and FALSE on error.
*/
BOOL Attach(Worksheet & wks, int nColX, int nColY);
/**
Attach an Origin C Curve object to internal Origin X and Y datasets.
The Y data set is specified by the column number in an Origin C
worksheet object. The Y data set's internally associated X data set is automatically
used for the X data set. Otherwise, row numbers are used for the X data set.
Operations on the Curve object do affect the associated Origin X and Y worksheet
columns (data sets).
Example:
// Assumes Data1_A and Data1_B exist and contain data
Worksheet wks("Data1");
Curve crv; // Data1 worksheet and columns 1 (X) and 2 (Y)
crv.Attach( wks, 1 ); // Data1 worksheet and column 2 (Y)
crv.Sort(); // Does affect columns 1 and 2 in wks
Parameters:
wks=Origin C Dataset object attached to an internal Origin worksheet
nColY=0 based offset or column number of Y column (data set)
Return:
Returns TRUE on successful exit and FALSE on error.
*/
BOOL Attach(Worksheet & wks, int nColY);
/**
Create a temporary (or permanent) Origin data set and attach the
Dataset object to it. If Option=1 is specified and data set is not
destroyed by calling the Dataset::Destroy method the data set will
remain in Origin after the Origin C function completes execution.
Example:
int ii;
{
LT_execute("list s;");
Dataset ds0;
ds0.Create(3); // Size=3 & Option=0 by default (create and attach to temporary data set)
for(ii = 0; ii < 3; ii++)
ds0[ii] = ii;
LT_execute("list s;"); // Note new ds0 TEMP_ data set
}
LT_execute("list s;"); // Out of ds0's scope, note new ds0 TEMP_ data set is destroyed
Dataset ds1;
ds1.Create(3,1); // Size=3 & Option=1 (create and attach to a second data set that is not temporary)
for(ii = 0; ii < 3; ii++)
ds1[ii] = ii;
LT_execute("list s;"); // Note new ds1 TEMP_ data set
ds1.Destroy(); // Destroy ds1 TEMP_ data set (comment out this line and TEMP_ data set does not get deleted)
LT_execute("list s;"); // Note new ds1 TEMP_ data set is destroyed (or not if above line is commented out)
Parameters:
Size=Size of the data set
Option=0 (default) causes temporary Origin data set to be automatically deleted when program control exits scope
of Dataset object, Option=1 causes data set to not be deleted unless user calls Dataset::Destroy method
Return:
Returns TRUE on successful exit and FALSE on error.
SeeAlso:
Dataset::Destroy, Dataset::Detach, Dataset::Dataset, Dataset::Attach
*/
BOOL Create(int Size, UINT Option = 0); // Create an internal Origin data set (may or may not be temporary).
/**
Delete (destroy) an Origin data set created using the Dataset::Create
method. For data sets not created by the Dataset::Create method the
Destroy method functions identically to the Dataset::Detach method.
Example:
// Worksheet column Data1_A must exist prior to execution
int ii;
Dataset ds1;
ds1.Create(3,1); // Create data set with Size=3 & Option=1 (not a temporary data set)
for(ii = 0; ii < 3; ii++)
ds1[ii] = ii;
LT_execute("list s;"); // Note new ds1 TEMP_ data set
ds1.Destroy(); // Destroy ds1 TEMP_ data set
LT_execute("list s;"); // Note new ds1 TEMP_ data set is destroyed
Dataset ds2("Data1_A"); // Construct and attach to pre-existing Origin data set
ds2.Destroy(); // Detaches ds2 from Data1_A but does not delete pre-existing data set from Origin
LT_execute("list s;"); // Note ds2 is an Invalid Object but Data1_A still exists
SeeAlso:
Dataset::Detach, Dataset::Attach, Dataset::Create
*/
void Destroy(); // Detach the Origin C Dataset object and Destroy (delete) the internal Origin data set.
};
#endif//_CURVE_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -