]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuContourControlPoints.cxx
#3478 ContourExtractData
[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 namespace bbcreaMaracasVisu
9 {
10
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ContourControlPoints)
12 BBTK_BLACK_BOX_IMPLEMENTATION(ContourControlPoints,bbtk::AtomicBlackBox);
13 //===== 
14 // 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)
15 //===== 
16 void ContourControlPoints::Process()
17 {
18 // THE MAIN PROCESSING METHOD BODY
19 //   Here we simply set the input 'In' value to the output 'Out'
20 //   And print out the output value
21 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
22 //    void bbSet{Input|Output}NAME(const TYPE&)
23 //    const TYPE& bbGet{Input|Output}NAME() const 
24 //    Where :
25 //    * NAME is the name of the input/output
26 //      (the one provided in the attribute 'name' of the tag 'input')
27 //    * TYPE is the C++ type of the input/output
28 //      (the one provided in the attribute 'type' of the tag 'input')
29
30 //    bbSetOutputOut( bbGetInputIn() );
31 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
32   
33         // Contorno 1
34
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         bbSetOutputManualBaseModel( _mContourModel_1 );
84
85         } // wxVtkBaseView
86
87 }
88 //===== 
89 // 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)
90 //===== 
91 void ContourControlPoints::bbUserSetDefaultValues()
92 {
93
94 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
95 //    Here we initialize the input 'In' to 0
96         bbSetInputActive(false);
97         bbSetInputVisible(true);
98         bbSetInputOpenClose(true);
99         bbSetInputwxVtkBaseView(NULL);
100         _manContourControl_1            = NULL;
101         _mContourModel_1                = NULL;
102         _mViewContour_1                 = NULL;
103   
104 }
105 //===== 
106 // 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)
107 //===== 
108 void ContourControlPoints::bbUserInitializeProcessing()
109 {
110
111 //  THE INITIALIZATION METHOD BODY :
112 //    Here does nothing 
113 //    but this is where you should allocate the internal/output pointers 
114 //    if any 
115
116   
117 }
118 //===== 
119 // 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)
120 //===== 
121 void ContourControlPoints::bbUserFinalizeProcessing()
122 {
123
124 //  THE FINALIZATION METHOD BODY :
125 //    Here does nothing 
126 //    but this is where you should desallocate the internal/output pointers 
127 //    if any
128   
129 }
130 }
131 // EO namespace bbcreaMaracasVisu
132
133