]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx
#2844 creaMaracasVisu Feature New Normal - ManualPaint_model box, Refresh TransferF...
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuManualPaint_Model.cxx
1 //===== 
2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
3 //===== 
4 #include "bbcreaMaracasVisuManualPaint_Model.h"
5 #include "bbcreaMaracasVisuPackage.h"
6 namespace bbcreaMaracasVisu
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ManualPaint_Model)
10 BBTK_BLACK_BOX_IMPLEMENTATION(ManualPaint_Model,bbtk::AtomicBlackBox);
11 //===== 
12 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
13 //===== 
14 void ManualPaint_Model::Process()
15 {
16
17 // THE MAIN PROCESSING METHOD BODY
18 //   Here we simply set the input 'In' value to the output 'Out'
19 //   And print out the output value
20 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
21 //    void bbSet{Input|Output}NAME(const TYPE&)
22 //    const TYPE& bbGet{Input|Output}NAME() const 
23 //    Where :
24 //    * NAME is the name of the input/output
25 //      (the one provided in the attribute 'name' of the tag 'input')
26 //    * TYPE is the C++ type of the input/output
27 //      (the one provided in the attribute 'type' of the tag 'input')
28 //    bbSetOutputOut( bbGetInputIn() );
29 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
30
31         if (bbGetInputImage()!=NULL)
32         {  
33                 manualpaintmodel->SetActive( bbGetInputActive() );
34                 manualpaintmodel->SetTool( bbGetInputTool() );
35                 manualpaintmodel->Set2D3D( bbGetInput2D3D() );
36                 manualpaintmodel->SetImage( bbGetInputImage() );
37                 manualpaintmodel->SetGrayLevel( bbGetInputGrayLevel() );
38                 manualpaintmodel->SetDirection( bbGetInputDirection() );
39                 manualpaintmodel->SetBrushSize( bbGetInputBrushSize() );
40                 manualpaintmodel->SetBrushForm( bbGetInputBrushForm() );
41                 manualpaintmodel->SetToleranceFill( bbGetInputToleranceFill() );
42                 manualpaintmodel->SetDistanceFill( bbGetInputDistanceFill() );
43                 manualpaintmodel->SetRangeMin( bbGetInputRange()[0] );
44                 manualpaintmodel->SetRangeMax( bbGetInputRange()[1] );
45                 manualpaintmodel->PaintImage( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] );
46          } else {
47                 printf("EED Warning: Image not set. Box creaMaracasVisu::ManualPaint_Model (BBTK) \n");
48         } // if 
49 //      manualpaintmodel-> GetScalarRange(double * range);
50 //      manualpaintmodel-> SetUndoImage(); //DFCH
51 //      manualpaintmodel-> Undo(); //DFCH
52 //      manualpaintmodel-> Redo(); //DFCH
53
54
55
56 }
57 //===== 
58 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
59 //===== 
60 void ManualPaint_Model::bbUserSetDefaultValues()
61 {
62
63 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
64 //    Here we initialize the input 'In' to 0
65
66         bbSetInputActive(true);
67         bbSetInputTool(1);  // Paint
68         bbSetInput2D3D(1);  // 3D
69         bbSetInputImage(NULL);
70         bbSetInputGrayLevel(100);
71         bbSetInputDirection(2); // XY
72         bbSetInputBrushSize(3);
73         bbSetInputBrushForm(1); // sphere
74         bbSetInputToleranceFill(50);
75         bbSetInputDistanceFill(25);
76
77         std::vector<int> point;
78         point.push_back(0);
79         point.push_back(0);
80         point.push_back(0);
81         bbSetInputPoint(point);
82
83         std::vector<double> range;
84         range.push_back(0);
85         range.push_back(200);
86         bbSetInputRange(range);
87   
88 }
89 //===== 
90 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
91 //===== 
92 void ManualPaint_Model::bbUserInitializeProcessing()
93 {
94
95 //  THE INITIALIZATION METHOD BODY :
96 //    Here does nothing 
97 //    but this is where you should allocate the internal/output pointers 
98 //    if any 
99
100         manualpaintmodel=new ManualPaintModel();
101
102   
103 }
104 //===== 
105 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
106 //===== 
107 void ManualPaint_Model::bbUserFinalizeProcessing()
108 {
109
110 //  THE FINALIZATION METHOD BODY :
111 //    Here does nothing 
112 //    but this is where you should desallocate the internal/output pointers 
113 //    if any
114         delete manualpaintmodel;
115   
116 }
117
118 }
119 // EO namespace bbcreaMaracasVisu
120
121