www.pudn.com > roll.rar > CURVE2D.CPP
// Curve2D.cpp : implementation file
//
#include "stdafx.h"
#include "Curve2D.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// OneCurve
void OneCurve::FindMinMaxXY(double& xmin,double& xmax,double& ymin,double& ymax,BOOL bStart)
{
DWORD i=0;
if(bStart) {
i++;
xmin=xmax=x[0];
ymin=ymax=y[0];
}
for(;ix[i]) xmin=x[i];
if(xmaxy[i]) ymin=y[i];
if(ymaxx[i]) xmin=x[i];
if(xmaxy[i]) ymin=y[i];
if(ymax0)
delete[] Curve;
Curve=NewCurve;
return TRUE;
}
void CCurve2D::ReadDataFromString(char *buf,DWORD index,short OldNumCurve)
{
char *p=buf;
while(*p==' ' && *p) p++;
sscanf(p,"%lf",&(Curve[OldNumCurve].x[index]));
for(short i=OldNumCurve;i0) bReadFromFile=TRUE;
return FALSE;
}
ReadDataFromString(buf,0);
for(i=1;i0) bReadFromFile=TRUE;
return FALSE;
}
for(i=0;i