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