1 | #ifndef _CONTOURFILTER_H_ |
---|
2 | #define _CONTOURFILTER_H_ |
---|
3 | |
---|
4 | #include "Vector3.h" |
---|
5 | #include "Vector4.h" |
---|
6 | #include "TypeDefs.h" |
---|
7 | #include <R2/graphics/R2Geometry.h> |
---|
8 | #include <list> |
---|
9 | |
---|
10 | class ContourLineFilter { |
---|
11 | public : |
---|
12 | class ContourLine { |
---|
13 | public : |
---|
14 | float _value; |
---|
15 | std::list<Vector3> _points; |
---|
16 | public : |
---|
17 | ContourLine(float value); |
---|
18 | |
---|
19 | private : |
---|
20 | bool isValueWithIn(float Val1, float Val2); |
---|
21 | void getContourPoint(int vertexIndex1, int vertexIndex2, Vector3* vertices, int width, bool top); |
---|
22 | void getContourPoint(int vertexIndex1, int vertexIndex2, Vector4* vertices, int width, bool top); |
---|
23 | public : |
---|
24 | /** |
---|
25 | * @brief |
---|
26 | * @ret Returns the number of points |
---|
27 | */ |
---|
28 | int createLine(int width, int height, Vector3* vertices, bool top); |
---|
29 | int createLine(int width, int height, Vector4* vertices, bool top); |
---|
30 | }; |
---|
31 | |
---|
32 | typedef std::list<ContourLine*> ContourLineList; |
---|
33 | |
---|
34 | private : |
---|
35 | ContourLineList _lines; |
---|
36 | Vector3Array* _colorMap; |
---|
37 | bool _top; |
---|
38 | public : |
---|
39 | ContourLineFilter(); |
---|
40 | |
---|
41 | private : |
---|
42 | void clear(); |
---|
43 | |
---|
44 | public : |
---|
45 | R2Geometry* create(float min, float max, int linecount, Vector3* vertices, int width, int height); |
---|
46 | R2Geometry* create(float min, float max, int linecount, Vector4* vertices, int width, int height); |
---|
47 | void setColorMap(Vector3Array* colorMap); |
---|
48 | |
---|
49 | void setHeightTop(bool top) |
---|
50 | { |
---|
51 | _top = top; |
---|
52 | } |
---|
53 | }; |
---|
54 | |
---|
55 | #endif |
---|