]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp
ae9a7e3c6a3637bc95bd581b3c75286100f17df0
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualPaint / ManualPaintModel.cpp
1
2 #include "ManualPaintModel.h"
3
4
5 ManualPaintModel::ManualPaintModel()
6 {
7     _tool           =  0;      // 0 pencil         ,   1 fill
8     _brushfilter    =  new BrushFilter();
9     _fillfilter     =  new FillFilter();
10 }
11
12 //---------------------------------------------------------------------------
13 ManualPaintModel::~ManualPaintModel()
14 {
15     delete _brushfilter;
16     delete _fillfilter;
17 }
18
19 //---------------------------------------------------------------------------
20 void ManualPaintModel::PaintImage(int px,int py, int pz)
21 {
22     if (_tool==0)
23     {
24         _brushfilter->SetPoint(px,py,pz);
25         _brushfilter->Run();
26     }
27     if (_tool==1)
28     {
29         _fillfilter->SetPoint(px,py,pz);
30         _fillfilter->Run();
31     }
32 }
33
34 //---------------------------------------------------------------------------
35 void ManualPaintModel::SetTool( int tool )
36 {
37     _tool = tool;
38 }
39
40 //---------------------------------------------------------------------------
41 void ManualPaintModel::Set2D3D( int dim2D3D )
42 {
43     _brushfilter->Set2D3D(dim2D3D);
44     _fillfilter->Set2D3D(dim2D3D);
45 }
46
47
48 //---------------------------------------------------------------------------
49 void ManualPaintModel::SetImage(vtkImageData *image)
50 {
51     _brushfilter->SetImage(image);
52     _fillfilter->SetImage(image);
53 }
54
55 //---------------------------------------------------------------------------
56 void ManualPaintModel::SetGrayLevel( double graylevel )
57 {
58     _brushfilter->SetGrayLevel(graylevel);
59     _fillfilter->SetGrayLevel(graylevel);
60 }
61
62 //---------------------------------------------------------------------------
63 void ManualPaintModel::SetRangeMin( unsigned int min )
64 {
65         _brushfilter->SetRangeMin(min);
66         _fillfilter->SetRangeMin(min);
67 }
68
69 //---------------------------------------------------------------------------
70 void ManualPaintModel::SetRangeMax( unsigned int max )
71 {
72         _brushfilter->SetRangeMax(max);
73         _fillfilter->SetRangeMax(max);
74 }
75
76 //---------------------------------------------------------------------------
77 void ManualPaintModel::SetDirection(int direction)
78 {
79     _brushfilter->SetDirection(direction);
80     _fillfilter->SetDirection(direction);
81 }
82
83
84 //---------------------------------------------------------------------------
85 void ManualPaintModel::SetBrushSize( int brushsize )
86 {
87     _brushfilter->SetBrushSize(brushsize);
88 }
89
90
91 //---------------------------------------------------------------------------
92 void ManualPaintModel::SetBrushForm( int brushform )
93 {
94     _brushfilter->SetBrushForm(brushform);
95 }
96
97 //---------------------------------------------------------------------------
98 void ManualPaintModel::SetToleranceFill(double tolerancefill)
99 {
100     _fillfilter->SetToleranceFill(tolerancefill);
101 }
102
103 //---------------------------------------------------------------------------
104 void ManualPaintModel::SetDistanceFill(int distancefill)
105 {
106     _fillfilter->SetDistanceFill(distancefill);
107 }
108