]> 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 namespace bbcreaMaracasVisu
8 {
9
10 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ContourControlPoints)
11 BBTK_BLACK_BOX_IMPLEMENTATION(ContourControlPoints,bbtk::AtomicBlackBox);
12 //===== 
13 // 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)
14 //===== 
15 void ContourControlPoints::Process()
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
29 //    bbSetOutputOut( bbGetInputIn() );
30 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
31   
32         // Contorno 1
33
34
35         if ( bbGetInputwxVtkBaseView() != NULL )
36         {
37                 if (_manContourControl_1==NULL)
38                 {
39                         _manContourControl_1    = new manualContourControler();
40                         _mContourModel_1                = new manualContourModel();
41                         _mViewContour_1                 = new manualViewContour();
42                         _mContourModel_1 -> SetCloseContour( bbGetInputOpenClose() );
43                         _mViewContour_1->SetModel( _mContourModel_1 );
44                         _mViewContour_1->SetWxVtkBaseView( bbGetInputwxVtkBaseView() );
45                         _mViewContour_1->SetRange( 2 );
46                         _mViewContour_1->SetZ( 1000 );
47 //JSTG 18-06-07
48                         _mContourModel_1->SetNumberOfPointsSpline(100);
49 //EED 3 oct 2006
50                         double spc[3];
51                         bbGetInputwxVtkBaseView()->GetSpacing(spc);
52                         _mViewContour_1->SetSpacing(spc);
53 //EED 3 oct 2006
54                         _mViewContour_1->SetColorNormalContour(0, 0, 1);
55                         _mViewContour_1->SetColorEditContour(0.5, 0.5, 0.5);
56                         _manContourControl_1->SetModelView( _mContourModel_1 , _mViewContour_1 );
57                         ((vtkInteractorStyleBaseView*)bbGetInputwxVtkBaseView()->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _manContourControl_1 );
58                         _manContourControl_1->CreateNewManualContour();
59                         _manContourControl_1->SetActive(  bbGetInputActive() );
60                         _mViewContour_1->RefreshContour();
61                 } // _manContourControl_1
62                 _mContourModel_1 -> SetCloseContour( bbGetInputOpenClose() );
63                 _manContourControl_1->SetActive( bbGetInputActive() );
64                 if ( bbGetInputVisible() == true)
65                 {
66                    _mViewContour_1->AddCompleteContourActor (true); 
67                 } else {
68                    _mViewContour_1->RemoveCompleteContourActor ();
69                 }
70         double width = bbGetInputWidthLine();
71         _mViewContour_1->SetWidthLine( width );
72         _mViewContour_1->SetRange( 2*width );
73                 _mViewContour_1->RefreshContour();
74         bbSetOutputManualBaseModel( _mContourModel_1 );
75         } // wxVtkBaseView
76
77 }
78 //===== 
79 // 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)
80 //===== 
81 void ContourControlPoints::bbUserSetDefaultValues()
82 {
83
84 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
85 //    Here we initialize the input 'In' to 0
86         bbSetInputActive(false);
87         bbSetInputVisible(true);
88         bbSetInputOpenClose(true);
89         bbSetInputwxVtkBaseView(NULL);
90     bbSetInputWidthLine(1);
91         _manContourControl_1    = NULL;
92         _mContourModel_1                = NULL;
93         _mViewContour_1                 = NULL;
94   
95 }
96 //===== 
97 // 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)
98 //===== 
99 void ContourControlPoints::bbUserInitializeProcessing()
100 {
101
102 //  THE INITIALIZATION METHOD BODY :
103 //    Here does nothing 
104 //    but this is where you should allocate the internal/output pointers 
105 //    if any 
106
107   
108 }
109 //===== 
110 // 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)
111 //===== 
112 void ContourControlPoints::bbUserFinalizeProcessing()
113 {
114
115 //  THE FINALIZATION METHOD BODY :
116 //    Here does nothing 
117 //    but this is where you should desallocate the internal/output pointers 
118 //    if any
119   
120 }
121 }
122 // EO namespace bbcreaMaracasVisu
123
124