1 /*=========================================================================
4 Module: $RCSfile: wxMaracas_ManualTree_MPRDlg.cxx,v $
6 Date: $Date: 2008/10/31 16:32:11 $
7 Version: $Revision: 1.1 $
9 Copyright: (c) 2002, 2003
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notice for more information.
16 =========================================================================*/
18 #include "wxMaracas_ManualTree_MPRDlg.h"
19 #include <wx/splitter.h>
22 //----------------------------------------------------------------------------
23 //----------------------------------------------------------------------------
24 //----------------------------------------------------------------------------
26 wxMaracas_ManualTree_MPRDlg::wxMaracas_ManualTree_MPRDlg( wxWindow* parent, marImageData* marimagedata,double voxelSize)
27 : wxDialog( parent, -1,_T("Manual Axis"),wxDefaultPosition,wxDefaultSize,wxCAPTION|wxRESIZE_BORDER | wxMAXIMIZE_BOX )
32 wxSplitterWindow *splitPanel = new wxSplitterWindow(this ,-1);
33 _manualTreeMPR = new wxMaracas_ManualTree_MPR(splitPanel,marimagedata,voxelSize);
34 wxPanel *panel = new wxPanel (splitPanel, -1);
36 wxButton *btnAccept = new wxButton (panel, wxID_OK, _T("Accept"));
37 wxButton *btnCancel = new wxButton (panel, wxID_CANCEL, _T("Cancel"));
39 wxBoxSizer* sizerH1 = new wxBoxSizer( wxHORIZONTAL );
40 sizerH1->Add(btnAccept , 1, wxALL|wxEXPAND, 0);
41 sizerH1->Add(btnCancel , 1, wxALL|wxEXPAND, 0);
42 panel->SetAutoLayout(true);
43 panel->SetSizer(sizerH1);
49 splitPanel->SplitHorizontally(_manualTreeMPR,panel );
50 splitPanel->SetMinimumPaneSize(50);
52 wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
53 sizer->Add(splitPanel , 1, wxALL|wxEXPAND, 0);
61 //----------------------------------------------------------------------------
63 wxMaracas_ManualTree_MPRDlg::~wxMaracas_ManualTree_MPRDlg()
67 //----------------------------------------------------------------------------
69 void wxMaracas_ManualTree_MPRDlg::ConfigureVTK()
72 _manualTreeMPR->ConfigureVTK();
75 //----------------------------------------------------------------------------
77 void wxMaracas_ManualTree_MPRDlg::SetMarAxis( marAxis *maraxis )
82 //----------------------------------------------------------------------------
83 bool wxMaracas_ManualTree_MPRDlg::ExportPoints()
87 manualContourModel *manualcontourmodel = _manualTreeMPR->GetManualContourModel();
90 _manualTreeMPR->GetVtkMPRBaseData()->GetImageData()->GetSpacing(spc);
92 int sizeLstPoints = manualcontourmodel->GetSizeLstPoints();
94 if ( sizeLstPoints>=2 ){
95 manualcontourmodel->UpdateSpline();
97 //JSTG 25-02-08 ---------------------------------------------------
98 //double delta = ((double)sizeLstPoints-1) / (double)max;
102 //manualcontourmodel->GetSplinePoint(t,x,y,z);
103 manualcontourmodel->GetSpline_i_Point(i,&x,&y,&z);
104 //-----------------------------------------------------------------
108 _maraxis->AddPointToList(x, y, z,100);
117 // EOF - wxMaracas_ManualTree_MPRDlg.cxx