]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuContourCrown.cxx
1dac025acc6f081e4eea9b84961446225d01b24c
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuContourCrown.cxx
1 #include "bbmaracasvisuContourCrown.h"
2 #include "bbcreaMaracasVisuPackage.h"
3
4 #include <vtkImageData.h>
5
6 namespace bbcreaMaracasVisu
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ContourCrown)
10 BBTK_BLACK_BOX_IMPLEMENTATION(ContourCrown,bbtk::WxBlackBox);
11
12 //-----------------------------------------------------------
13 void ContourCrown::Process()
14 {
15
16     if (firsttime==true)
17         {
18                 firsttime=false;
19                 if (bbGetInputwxVtkBaseView()==NULL) 
20                 {
21                         wxMessageDialog(NULL,  bbtk::std2wx("(ContourCrown) Input 'wxVtkBaseView' is not set"),  bbtk::std2wx(bbGetFullName()) ).ShowModal();
22                 }
23                 if (bbGetInputIn()==NULL) 
24                 {
25                         wxMessageDialog(NULL,  bbtk::std2wx("(ContourCrown) Input 'In' is not set"),  bbtk::std2wx(bbGetFullName()) ).ShowModal();
26                 }
27         
28                 mwxwidget->Init(  bbGetInputwxVtkBaseView(), bbGetInputIn() );
29                 mwxwidget->ConfigureVTK();
30         
31                 bbSetOutputImageValueResult( mwxwidget->GetVtkImageValueResult() );
32                 bbSetOutputImageMaskResult( mwxwidget->GetVtkImageMaskResult() );
33         }
34         
35         
36         if (mwxwidget!=NULL){
37                 //JSTG 04-04-08
38                 mwxwidget->SetControlPoints( bbGetInputControlPointsInX(), bbGetInputControlPointsInY(), bbGetInputControlPointsInZ() );
39                 
40                 LstValuePosX.clear();
41                 LstValuePosY.clear();
42                 LstValuePosZ.clear();
43                 mwxwidget->GetValuesInsideCrown(&LstValue,&LstValuePosX,&LstValuePosY,&LstValuePosZ);
44
45                 //JSTG 226-02-08 ----------------------------------------------------------
46                 LstContourX.clear();
47                 LstContourY.clear();
48                 LstContourZ.clear();
49                 mwxwidget->GetSplinePoints(&LstContourX,&LstContourY,&LstContourZ);
50                 //-------------------------------------------------------------------------
51
52                 bbSetOutputLstValue(&LstValue);
53                 bbSetOutputLstValuePosX(&LstValuePosX);
54                 bbSetOutputLstValuePosY(&LstValuePosY);
55                 bbSetOutputLstValuePosZ(&LstValuePosZ);
56                 bbSetOutputLstContourX(&LstContourX);
57                 bbSetOutputLstContourY(&LstContourY);
58                 bbSetOutputLstContourZ(&LstContourZ);
59                 bbSetOutputLstContourCrlX(&LstContourCrlX);
60                 bbSetOutputLstContourCrlY(&LstContourCrlY);
61                 bbSetOutputLstContourCrlZ(&LstContourCrlZ);
62                 bbSetOutputLstContourCrlZ(&LstContourCrlZ);
63         } // mwxwidget
64 }
65
66 //-----------------------------------------------------------
67 void ContourCrown::CreateWidget(wxWindow* parent)
68 {
69         bbtkDebugMessageInc("Core",9,"ContourCrown::CreateWidget()"<<std::endl);
70   
71         mwxwidget = new wxMaracasCoutourTool( parent );
72         bbSetOutputWidget( mwxwidget );
73         bbtkDebugDecTab("Core",9);
74 }
75
76 //-----------------------------------------------------------
77 void ContourCrown::bbUserSetDefaultValues()
78 {
79         firsttime=true;
80         mwxwidget = NULL;
81         bbSetInputIn(NULL);
82         bbSetInputwxVtkBaseView(NULL);
83 //JSTG 26-02-08 ------------------------------------
84         bbSetInputControlPointsInX(NULL);
85         bbSetInputControlPointsInY(NULL);
86         bbSetInputControlPointsInZ(NULL);
87 //--------------------------------------------------
88 }
89
90         //-----------------------------------------------------------------     
91         void ContourCrown::bbUserInitializeProcessing()
92         {
93         }
94         
95         //-----------------------------------------------------------------     
96         void ContourCrown::bbUserFinalizeProcessing()
97         {
98         }
99         
100         //-----------------------------------------------------------------     
101         
102
103 }
104 // EO namespace bbcreaMaracasVisu
105
106