-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLineBrush.cpp
More file actions
55 lines (39 loc) · 1.01 KB
/
LineBrush.cpp
File metadata and controls
55 lines (39 loc) · 1.01 KB
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
//
// LineBrush.cpp
//
// The implementation of Line Brush. It is a kind of ImpBrush. All your brush implementations
// will look like the file with the different GL primitive calls.
//
#include "impressionistDoc.h"
#include "impressionistUI.h"
#include "linebrush.h"
extern float frand();
LineBrush::LineBrush(ImpressionistDoc* pDoc, char* name) :
ImpBrush(pDoc, name)
{
}
void LineBrush::BrushBegin(const Point source, const Point target)
{
ImpressionistDoc* pDoc = GetDocument();
ImpressionistUI* dlg = pDoc->m_pUI;
int size = pDoc->getBrushSize();
glPointSize((float)size);
BrushMove(source, target);
}
void LineBrush::BrushMove(const Point source, const Point target)
{
ImpressionistDoc* pDoc = GetDocument();
ImpressionistUI* dlg = pDoc->m_pUI;
if (pDoc == NULL) {
printf("LineBrush::BrushMove document is NULL\n");
return;
}
glBegin(GL_POINTS);
SetColor(source);
glVertex2d(target.x, target.y);
glEnd();
}
void LineBrush::BrushEnd(const Point source, const Point target)
{
// do nothing so far
}