]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuContourControlPoints.cxx
#2976 creaMaracasVisu Feature New Normal - ManualContourModel_Box
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuContourControlPoints.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 "bbcreaMaracasVisuContourControlPoints.h"
5 #include "bbcreaMaracasVisuPackage.h"
6
7
8
9 namespace bbcreaMaracasVisu
10 {
11
12 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ContourControlPoints)
13 BBTK_BLACK_BOX_IMPLEMENTATION(ContourControlPoints,bbtk::AtomicBlackBox);
14 //===== 
15 // 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)
16 //===== 
17 void ContourControlPoints::Process()
18 {
19 // THE MAIN PROCESSING METHOD BODY
20 //   Here we simply set the input 'In' value to the output 'Out'
21 //   And print out the output value
22 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
23 //    void bbSet{Input|Output}NAME(const TYPE&)
24 //    const TYPE& bbGet{Input|Output}NAME() const 
25 //    Where :
26 //    * NAME is the name of the input/output
27 //      (the one provided in the attribute 'name' of the tag 'input')
28 //    * TYPE is the C++ type of the input/output
29 //      (the one provided in the attribute 'type' of the tag 'input')
30
31 //    bbSetOutputOut( bbGetInputIn() );
32 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
33   
34         // Contorno 1
35
36         if ( bbGetInputwxVtkBaseView() != NULL )
37         {
38                 if (_manContourControl_1==NULL)
39                 {
40                         _manContourControl_1            = new manualContourControler();
41                         _mContourModel_1                = new manualContourModel();
42                         _mViewContour_1                 = new manualViewContour();
43
44                         _mContourModel_1 -> SetCloseContour( bbGetInputOpenClose() );
45
46                         _mViewContour_1->SetModel( _mContourModel_1 );
47                         _mViewContour_1->SetWxVtkBaseView( bbGetInputwxVtkBaseView() );
48                         _mViewContour_1->SetRange( 2 );
49                         _mViewContour_1->SetZ( 1000 );
50
51 //JSTG 18-06-07
52                         _mContourModel_1->SetNumberOfPointsSpline(100);
53
54
55 //EED 3 oct 2006
56                         double spc[3];
57                         bbGetInputwxVtkBaseView()->GetSpacing(spc);
58                         _mViewContour_1->SetSpacing(spc);
59
60
61 //EED 3 oct 2006
62                         _mViewContour_1->SetColorNormalContour(0, 0, 1);
63                         _mViewContour_1->SetColorEditContour(0.5, 0.5, 0.5);
64
65
66                         _manContourControl_1->SetModelView( _mContourModel_1 , _mViewContour_1 );
67                         ((vtkInteractorStyleBaseView*)bbGetInputwxVtkBaseView()->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _manContourControl_1 );
68                         _manContourControl_1->CreateNewManualContour();
69                         _manContourControl_1->SetActive(  bbGetInputActive() );
70                         _mViewContour_1->RefreshContour();
71                 } // _manContourControl_1
72
73                 _mContourModel_1 -> SetCloseContour( bbGetInputOpenClose() );
74                 _manContourControl_1->SetActive( bbGetInputActive() );
75                 if ( bbGetInputVisible() == true)
76                 {
77                    _mViewContour_1->AddCompleteContourActor (true); 
78                 } else {
79                    _mViewContour_1->RemoveCompleteContourActor ();
80                 }
81                 _mViewContour_1->RefreshContour();
82
83
84         } // wxVtkBaseView
85
86 }
87 //===== 
88 // 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)
89 //===== 
90 void ContourControlPoints::bbUserSetDefaultValues()
91 {
92
93 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
94 //    Here we initialize the input 'In' to 0
95         bbSetInputActive(false);
96         bbSetInputVisible(true);
97         bbSetInputOpenClose(true);
98         bbSetInputwxVtkBaseView(NULL);
99         _manContourControl_1            = NULL;
100         _mContourModel_1                = NULL;
101         _mViewContour_1                 = NULL;
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 ContourControlPoints::bbUserInitializeProcessing()
108 {
109
110 //  THE INITIALIZATION METHOD BODY :
111 //    Here does nothing 
112 //    but this is where you should allocate the internal/output pointers 
113 //    if any 
114
115   
116 }
117 //===== 
118 // 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)
119 //===== 
120 void ContourControlPoints::bbUserFinalizeProcessing()
121 {
122
123 //  THE FINALIZATION METHOD BODY :
124 //    Here does nothing 
125 //    but this is where you should desallocate the internal/output pointers 
126 //    if any
127   
128 }
129 }
130 // EO namespace bbcreaMaracasVisu
131
132