]> Creatis software - creaContours.git/blob - bbtk/src/bbCreaContournDimensions.cxx
55eab4384847dea30748e6a4391b70619bd78afd
[creaContours.git] / bbtk / src / bbCreaContournDimensions.cxx
1 #include "bbCreaContournDimensions.h"
2 #include "bbcreaContoursPackage.h"
3
4 #include "creaSystem.h"
5 namespace bbcreaContours
6 {
7
8 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,nDimensions)
9 BBTK_BLACK_BOX_IMPLEMENTATION(nDimensions,bbtk::WxBlackBox);
10 void nDimensions::Process()
11 {
12 printf("EED nDimensions::Process 01\n");        
13         double **vectx = 0, **vecty = 0, **vectz = 0;
14
15         std::vector< void * > vectortemp;
16         std::vector<int> size;
17         vtkImageData **mask = 0, **value = 0;
18
19         vtkImageData* img = bbGetInputIn();
20
21         std::vector<vtkImageData*> selectedimages;
22         if(img!=NULL && currentimg!=img){
23
24                 printf("EED nDimensions::Process 02\n");        
25                 wxContourMainFrame::getInstance()->ShowToolsPanel(true);
26                 currentimg=img;
27                 selectedimages.push_back(img);
28                 wxContourMainFrame::getInstance()->setVectImages(selectedimages);
29                 printf("EED nDimensions::Process 03\n");        
30         }
31
32         printf("EED nDimensions::Process 04\n");        
33         if(currentimg != NULL){
34                 int contourtype = bbGetInputContourType();
35                 //wxContourMainFrame::getInstance()->getValuesXYZ(vectx, vecty, vectz, &size);
36                 //wxContourMainFrame::getInstance()->getMaskValue(mask, value, contourtype);
37         }
38
39         printf("EED nDimensions::Process 05\n");        
40         bbSetOutputX(vectx);
41         printf("EED nDimensions::Process 05.1\n");      
42         bbSetOutputY(vecty);
43         printf("EED nDimensions::Process 05.2\n");      
44         bbSetOutputZ(vectz);
45         printf("EED nDimensions::Process 05.3\n");      
46         bbSetOutputSizeContour(size);
47         printf("EED nDimensions::Process 05.4\n");      
48         bbSetOutputMask(*mask);
49         printf("EED nDimensions::Process 05.5\n");      
50         bbSetOutputValue(*value);
51         printf("EED nDimensions::Process 06\n");        
52 }
53
54 //-----------------------------------------------------------------
55 void nDimensions::CreateWidget(wxWindow* parent)
56 {
57         //vtkImageData* img = bbGetInputIn();
58
59         std::vector<vtkImageData*> selectedimages;
60         //selectedimages.push_back(img);
61
62         //wxFrame* frame1 = new wxFrame(parent, wxID_ANY, wxT("ROI Application  -    Evaluation version, 23 Oct 2008 "), wxPoint(400,50), wxSize(800, 600) );
63         //frame = wxContourMainFrame::getInstance(frame1, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages );
64         //new wxContourMainFrame( frame1, wxID_ANY, _T(""), wxPoint(50,50), wxSize(800, 600),selectedimages );
65         //frame1->CreateStatusBar();
66         //bbSetOutputWidget( frame1 );
67 std::string datadir=".";
68 #ifdef WIN32
69         datadir = crea::System::GetDllAppPath();
70 #else
71         datadir= crea::System::GetExecutablePath();
72 #endif
73         
74         
75 #ifdef LINUX /* assume this is OSX */
76         datadir=datadir+"/../share/creaContours";
77 #endif // MACOSX        
78         
79 #ifdef MACOSX /* assume this is OSX */
80         datadir=datadir+"/../../../../share/creaContours";
81 #endif // MACOSX        
82         
83         
84         printf("EED nDimensions::CreateWidget path=%s\n",datadir.c_str() );
85
86         wxPanel* panel = wxContourMainFrame::getInstance(parent, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages,wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,datadir );
87         wxContourMainFrame::getInstance()->ShowToolsPanel(false);
88 //EED   bbSetOutputWidget( panel );
89                 bbSetOutputWidget( new wxPanel(parent,-1) );
90 }
91
92 //-----------------------------------------------------------------
93 void nDimensions::bbUserSetDefaultValues()
94 {
95         bbSetInputContourType(0);
96         bbSetInputIn(NULL);
97 }
98
99 //-----------------------------------------------------------------
100 void nDimensions::bbUserInitializeProcessing()
101 {
102 }
103
104 //-----------------------------------------------------------------
105 void nDimensions::bbUserFinalizeProcessing()
106 {
107 }
108
109 }  // EO namespace bbCreaContour