1 #include "ManualPaintModel.h"
3 ManualPaintModel::ManualPaintModel() {
4 _tool = 0; // 0 pencil , 1 fill
5 _brushfilter = new BrushFilter();
6 _fillfilter = new FillFilter();
7 //_imageUndoRedo = new ImageUndoRedo();
10 //---------------------------------------------------------------------------
11 ManualPaintModel::~ManualPaintModel() {
16 //---------------------------------------------------------------------------
17 void ManualPaintModel::PaintImage(int px, int py, int pz) {
19 _brushfilter->SetPoint(px, py, pz);
23 _fillfilter->SetPoint(px, py, pz);
28 //---------------------------------------------------------------------------
29 void ManualPaintModel::SetTool(int tool) {
33 //---------------------------------------------------------------------------
34 void ManualPaintModel::Set2D3D(int dim2D3D) {
35 _brushfilter->Set2D3D(dim2D3D);
36 _fillfilter->Set2D3D(dim2D3D);
39 //---------------------------------------------------------------------------
40 void ManualPaintModel::SetImage(vtkImageData *image) {
41 _brushfilter->SetImage(image);
42 _fillfilter->SetImage(image);
43 //_imageUndoRedo->SetImage(image);
46 //---------------------------------------------------------------------------
47 void ManualPaintModel::SetGrayLevel(double graylevel) {
48 _brushfilter->SetGrayLevel(graylevel);
49 _fillfilter->SetGrayLevel(graylevel);
52 //---------------------------------------------------------------------------
53 void ManualPaintModel::SetRangeMin(int min) {
54 _brushfilter->SetRangeMin(min);
55 _fillfilter->SetRangeMin(min);
58 //---------------------------------------------------------------------------
59 void ManualPaintModel::SetRangeMax(int max) {
60 _brushfilter->SetRangeMax(max);
61 _fillfilter->SetRangeMax(max);
64 //---------------------------------------------------------------------------
65 void ManualPaintModel::SetDirection(int direction) {
66 _brushfilter->SetDirection(direction);
67 _fillfilter->SetDirection(direction);
70 //---------------------------------------------------------------------------
71 void ManualPaintModel::SetBrushSize(int brushsize) {
72 _brushfilter->SetBrushSize(brushsize);
75 //---------------------------------------------------------------------------
76 void ManualPaintModel::SetBrushForm(int brushform) {
77 _brushfilter->SetBrushForm(brushform);
80 //---------------------------------------------------------------------------
81 void ManualPaintModel::SetToleranceFill(double tolerancefill) {
82 _fillfilter->SetToleranceFill(tolerancefill);
85 //---------------------------------------------------------------------------
86 void ManualPaintModel::SetDistanceFill(int distancefill) {
87 _fillfilter->SetDistanceFill(distancefill);
89 //---------------------------------------------------------------------------
90 void ManualPaintModel::GetScalarRange(double * range) {
91 _fillfilter->GetScalarRange(range);
93 //---------------------------------------------------------------------------
94 void ManualPaintModel::SetUndoImage() {
95 /*ImageMManager* imMManager = NULL;
97 imMManager = this->_brushfilter->GetImageMManager();
100 imMManager = this->_fillfilter->GetImageMManager();
102 this->_imageUndoRedo->SetURImages(imMManager);
103 this->_brushfilter->CleanImageMManager();
104 this->_fillfilter->CleanImageMManager();*/
106 //---------------------------------------------------------------------------
108 void ManualPaintModel::Undo() {
109 //this->_imageUndoRedo->Undo();
112 void ManualPaintModel::Redo() {
113 //this->_imageUndoRedo->Redo();