-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCurve.h
73 lines (58 loc) · 1.55 KB
/
Curve.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once
#include <nV/Graphics.h>
namespace nV {
namespace Graphics {
#define ADD_POINT_ANGLE_CURVE 0.05
#define MIN_DELTA_DIS_CURVE 0.001
typedef struct {
double x;
double lefty;
double righty;
double leftd;
double rightd;
} singularitynode;
typedef struct {
double min;
double max;
std::vector<singularitynode *> singularityset;
}domain;
class Curve {
public:
struct LineStrip {
ArrayList<Point2d*> vert;
ArrayList<Color*> color;
};
public:
double spx, spy, xmin, xmax, ymin, ymax;
int dataNum;
//about color functions
bool isColorfulCurve;
ArrayList<LineStrip*> lineStrips;
//ÊÇ·ñÓÐÆæµã
bool singularity;
std::vector<singularitynode *> singularityset;
bool WithDomain;
std::vector<domain *> Domains;
public:
Curve();
Curve(ArrayList<Point2d*> v);
virtual ~Curve();
protected:
Color* getRainbowColor(double code);
void uninitsingularityset();
void uninitdomain();
};
inline void Curve::uninitsingularityset() {
for(std::vector<singularitynode *>::iterator it = singularityset.begin(); it != singularityset.end(); ++it) {
delete (*it);
}
singularityset.clear();
}
inline void Curve::uninitdomain() {
for(std::vector<domain *>::iterator it = Domains.begin(); it != Domains.end(); ++it) {
delete (*it);
}
Domains.clear();
}
}
}