]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuContourCrown.cxx
*** empty log message ***
[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 (mwxwidget!=NULL){
17                 //JSTG 04-04-08
18                 mwxwidget->SetControlPoints( bbGetInputControlPointsInX(), bbGetInputControlPointsInY(), bbGetInputControlPointsInZ() );
19                 
20                 LstValuePosX.clear();
21                 LstValuePosY.clear();
22                 LstValuePosZ.clear();
23                 mwxwidget->GetValuesInsideCrown(&LstValue,&LstValuePosX,&LstValuePosY,&LstValuePosZ);
24
25                 //JSTG 226-02-08 ----------------------------------------------------------
26                 LstContourX.clear();
27                 LstContourY.clear();
28                 LstContourZ.clear();
29                 mwxwidget->GetSplinePoints(&LstContourX,&LstContourY,&LstContourZ);
30                 //-------------------------------------------------------------------------
31
32                 bbSetOutputLstValue(&LstValue);
33                 bbSetOutputLstValuePosX(&LstValuePosX);
34                 bbSetOutputLstValuePosY(&LstValuePosY);
35                 bbSetOutputLstValuePosZ(&LstValuePosZ);
36                 bbSetOutputLstContourX(&LstContourX);
37                 bbSetOutputLstContourY(&LstContourY);
38                 bbSetOutputLstContourZ(&LstContourZ);
39                 bbSetOutputLstContourCrlX(&LstContourCrlX);
40                 bbSetOutputLstContourCrlY(&LstContourCrlY);
41                 bbSetOutputLstContourCrlZ(&LstContourCrlZ);
42                 bbSetOutputLstContourCrlZ(&LstContourCrlZ);
43         } // mwxwidget
44 }
45
46 //-----------------------------------------------------------
47 void ContourCrown::CreateWidget(wxWindow* parent)
48 {
49         bbtkDebugMessageInc("Core",9,"ContourCrown::CreateWidget()"<<std::endl);
50   
51         if (bbGetInputwxVtkBaseView()==NULL) 
52     {
53       wxMessageDialog(NULL,  bbtk::std2wx("(ContourCrown) Input 'wxVtkBaseView' is not set"),  bbtk::std2wx(bbGetFullName()) ).ShowModal();
54     }
55         if (bbGetInputIn()==NULL) 
56     {
57       wxMessageDialog(NULL,  bbtk::std2wx("(ContourCrown) Input 'In' is not set"),  bbtk::std2wx(bbGetFullName()) ).ShowModal();
58     }
59
60         mwxwidget = new wxMaracasCoutourTool( parent, bbGetInputwxVtkBaseView(), bbGetInputIn() );
61         mwxwidget->ConfigureVTK();
62
63         bbSetOutputImageValueResult( mwxwidget->GetVtkImageValueResult() );
64         bbSetOutputImageMaskResult( mwxwidget->GetVtkImageMaskResult() );
65         bbSetOutputWidget(mwxwidget);
66         bbtkDebugDecTab("Core",9);
67 }
68
69 //-----------------------------------------------------------
70 void ContourCrown::bbUserConstructor()
71 {
72         mwxwidget = NULL;
73         bbSetInputIn(NULL);
74         bbSetInputwxVtkBaseView(NULL);
75 //JSTG 26-02-08 ------------------------------------
76         bbSetInputControlPointsInX(NULL);
77         bbSetInputControlPointsInY(NULL);
78         bbSetInputControlPointsInZ(NULL);
79 //--------------------------------------------------
80 }
81
82 //-----------------------------------------------------------
83 void ContourCrown::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
84 {
85 }
86
87 //-----------------------------------------------------------
88 void ContourCrown::bbUserDestructor()
89 {
90 }
91
92 }
93 // EO namespace bbcreaMaracasVisu
94
95