paysages3d/src/basics/Curve.h

45 lines
902 B
C
Raw Permalink Normal View History

#pragma once
2013-11-15 22:26:44 +00:00
#include "basics_global.h"
namespace paysages {
namespace basics {
typedef struct {
double position;
double value;
} CurvePoint;
class BASICSSHARED_EXPORT Curve {
public:
2013-11-15 22:26:44 +00:00
Curve();
~Curve();
void copy(Curve *destination) const;
void save(PackStream *stream) const;
void load(PackStream *stream);
2013-11-15 22:26:44 +00:00
void validate();
inline int getPointCount() const {
return nbpoints;
}
2013-11-15 22:26:44 +00:00
CurvePoint getPoint(int number) const;
bool getPoint(int number, CurvePoint *point) const;
double getValue(double position) const;
void clear();
void setDefault(double value);
int addPoint(const CurvePoint &point);
int addPoint(double position, double value);
void setPoint(int number, const CurvePoint &point);
void removePoint(int number);
private:
2013-11-15 22:26:44 +00:00
double default_value;
int nbpoints;
CurvePoint *points;
2013-11-15 22:26:44 +00:00
};
}
}