forked from Astar-Li/BezierSurafce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
r3deditor_bezier_surface.h
54 lines (46 loc) · 1.53 KB
/
r3deditor_bezier_surface.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
#ifndef R3DEDITOR_BEZIER_SURFACE_H
#define R3DEDITOR_BEZIER_SURFACE_H
#include "QMouseEvent"
#include "r3deditor_3d_types.h"
#include "r3deditor_object.h"
namespace r3deditor
{
namespace Objects
{
typedef Vertex3D BezierSurfaceBMatrix[4][4];
class BezierSurfaceEditor;
class BezierSurface : public Object
{
public:
BezierSurface(BezierSurfaceBMatrix &Bref);
//returns BezierEditor
ObjectEditor* editorCreate();
Vertex3D B(short int i, short int j);
void setB(short int i, short int j, Vertex3D value);
//for WireframePainter
EdgeList& edgeList();
VertexList& vertexList();
private:
//main parametric equation
Vertex3D r(double u, double v);
//characteristic polyhedra
BezierSurfaceBMatrix B_;
//for WireframPainter
void wireframeRebuild();
VertexList vertex_list;
EdgeList edge_list;
};
class BezierSurfaceEditor : public ObjectEditor
{
public:
BezierSurfaceEditor(BezierSurface &bezier_surface);
// "control"
void mouseEvent(QMouseEvent *event, Camera &camera);
// "view"
void paintTo(QImage &image_buf, Camera &camera);
private:
static const int CONTROL_CIRCLE_RADIUS = 5;
};
}
}
#endif // R3DEDITOR_BEZIER_SURFACE_H