X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxMPRWidget.cxx;h=13a93481dc55c866945757aca37fef6aa73b0d69;hb=0a4bb77d5281ee5bc6eebd504abae2500cfa780a;hp=f5d6a4fd98e7c5050d27676b5683f9c960be4bee;hpb=3fdde2fc9525d85df4fcdd49dab89ab19266cf84;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx index f5d6a4f..13a9348 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMPRWidget.cxx,v $ Language: C++ - Date: $Date: 2008/11/06 11:00:47 $ - Version: $Revision: 1.2 $ + Date: $Date: 2009/03/30 15:31:15 $ + Version: $Revision: 1.6 $ Copyright: (c) 2002, 2003 License: @@ -454,7 +454,7 @@ int wxSphereView::GetIdOfImage(double radio) int i,size=_lstId.size(); for (i=0; i_radio==radio) && (_lstId[i]->_deltavoxel==_delta)) { return _lstId[i]->_id; @@ -979,7 +979,7 @@ bool vtkInteractorStylePlane2D::OnLeftButtonUp() // virtual bool vtkInteractorStylePlane2D::OnRightButtonUp() // virtual { if (_stateRotate==true){ - //vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView()); + //vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView()); // JPRx // EED Borrame // vtkplane2Dview->RotationEnd(); @@ -1857,8 +1857,8 @@ bool vtkInteractorStyleMPRView::OnLeftButtonDown () double x = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0]; double y = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1]; double z = 1; - //double xx = x; - //double yy = y; + //double xx = x; // JPRx + //double yy = y; // JPRx _vtkInteractorStyleBaseView->TransformCoordinate(x,y,z); /*EED Borrame @@ -1981,89 +1981,91 @@ void wxVtkMPR2DView::Configure(){ GetVtkmprbasedata() -> GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2); double spc[3]; - GetVtkmprbasedata()->GetImageData()->GetSpacing(spc); - x1 = (int)(x1*spc[0]); - y1 = (int)(y1*spc[1]); - z1 = (int)(z1*spc[2]); - - x2 = (int)(x2*spc[0]); - y2 = (int)(y2*spc[1]); - z2 = (int)(z2*spc[2]); - - _visibleAxis = true; - -// Axe A - _ptsA = vtkPoints::New(); - _ptsA->SetNumberOfPoints(2); - _ptsA->SetPoint(0, -1000 , -1000 , -1000 ); - _ptsA->SetPoint(1, 1000 , 1000 , 1000 ); - vtkCellArray *linesA; - linesA = vtkCellArray::New(); - linesA->InsertNextCell(2); - linesA->InsertCellPoint(0); - linesA->InsertCellPoint(1); - _pdA = vtkPolyData::New(); - _pdA->SetPoints( _ptsA ); - _pdA->SetLines( linesA ); - linesA->Delete(); //do not delete lines ?? - _lineAActor = vtkActor::New(); - _lineAMapper = vtkPolyDataMapper::New(); - _lineAMapper->SetInput(_pdA); - _lineAMapper->ImmediateModeRenderingOn(); - _lineAActor->SetMapper(_lineAMapper); - _lineAActor->GetProperty()->BackfaceCullingOn(); - _lineAActor->GetProperty()->SetDiffuseColor(1,0,0); - _lineAActor->GetProperty()->SetLineWidth(2); - _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor ); - -// Axe B - _ptsB = vtkPoints::New(); - _ptsB->SetNumberOfPoints(2); - _ptsB->SetPoint(0, -1000 , -1000 , -1000 ); - _ptsB->SetPoint(1, 1000 , 1000 , 1000 ); - vtkCellArray *linesB; - linesB = vtkCellArray::New(); - linesB->InsertNextCell(2); - linesB->InsertCellPoint(0); - linesB->InsertCellPoint(1); - _pdB = vtkPolyData::New(); - _pdB->SetPoints( _ptsB ); - _pdB->SetLines( linesB ); - linesB->Delete(); //do not delete lines ?? - _lineBActor = vtkActor::New(); - _lineBMapper = vtkPolyDataMapper::New(); - _lineBMapper->SetInput(_pdB); - _lineBMapper->ImmediateModeRenderingOn(); - _lineBActor->SetMapper(_lineBMapper); - _lineBActor->GetProperty()->BackfaceCullingOn(); - _lineBActor->GetProperty()->SetDiffuseColor(1,0,0); - _lineBActor->GetProperty()->SetLineWidth(2); - _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineBActor ); - - vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera(); - if (_direction==0) { - camera->SetViewUp ( 0 , -1 , 0 ); - camera->SetPosition ( -10000,(y1+y2)/2 , (z1+z2)/2 ); - camera->SetFocalPoint ( 0 , (y1+y2)/2 , (z1+z2)/2 ); - camera->SetParallelScale( (z2-z1)/3.0 ); - } + vtkImageData* img = GetVtkmprbasedata()->GetImageData(); + if(img!=NULL){ + img->GetSpacing(spc); + x1 = (int)(x1*spc[0]); + y1 = (int)(y1*spc[1]); + z1 = (int)(z1*spc[2]); + + x2 = (int)(x2*spc[0]); + y2 = (int)(y2*spc[1]); + z2 = (int)(z2*spc[2]); + + _visibleAxis = true; + + // Axe A + _ptsA = vtkPoints::New(); + _ptsA->SetNumberOfPoints(2); + _ptsA->SetPoint(0, -1000 , -1000 , -1000 ); + _ptsA->SetPoint(1, 1000 , 1000 , 1000 ); + vtkCellArray *linesA; + linesA = vtkCellArray::New(); + linesA->InsertNextCell(2); + linesA->InsertCellPoint(0); + linesA->InsertCellPoint(1); + _pdA = vtkPolyData::New(); + _pdA->SetPoints( _ptsA ); + _pdA->SetLines( linesA ); + linesA->Delete(); //do not delete lines ?? + _lineAActor = vtkActor::New(); + _lineAMapper = vtkPolyDataMapper::New(); + _lineAMapper->SetInput(_pdA); + _lineAMapper->ImmediateModeRenderingOn(); + _lineAActor->SetMapper(_lineAMapper); + _lineAActor->GetProperty()->BackfaceCullingOn(); + _lineAActor->GetProperty()->SetDiffuseColor(1,0,0); + _lineAActor->GetProperty()->SetLineWidth(2); + _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor ); + + // Axe B + _ptsB = vtkPoints::New(); + _ptsB->SetNumberOfPoints(2); + _ptsB->SetPoint(0, -1000 , -1000 , -1000 ); + _ptsB->SetPoint(1, 1000 , 1000 , 1000 ); + vtkCellArray *linesB; + linesB = vtkCellArray::New(); + linesB->InsertNextCell(2); + linesB->InsertCellPoint(0); + linesB->InsertCellPoint(1); + _pdB = vtkPolyData::New(); + _pdB->SetPoints( _ptsB ); + _pdB->SetLines( linesB ); + linesB->Delete(); //do not delete lines ?? + _lineBActor = vtkActor::New(); + _lineBMapper = vtkPolyDataMapper::New(); + _lineBMapper->SetInput(_pdB); + _lineBMapper->ImmediateModeRenderingOn(); + _lineBActor->SetMapper(_lineBMapper); + _lineBActor->GetProperty()->BackfaceCullingOn(); + _lineBActor->GetProperty()->SetDiffuseColor(1,0,0); + _lineBActor->GetProperty()->SetLineWidth(2); + _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineBActor ); + + vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera(); + if (_direction==0) { + camera->SetViewUp ( 0 , -1 , 0 ); + camera->SetPosition ( -10000,(y1+y2)/2 , (z1+z2)/2 ); + camera->SetFocalPoint ( 0 , (y1+y2)/2 , (z1+z2)/2 ); + camera->SetParallelScale( (z2-z1)/3.0 ); + } - if (_direction==1) { - camera->SetViewUp ( 0 , 0 , -1 ); - camera->SetPosition ((x1+x2)/2 , 10000 , (z1+z2)/2 ); - camera->SetFocalPoint ((x1+x2)/2 , 0 , (z1+z2)/2 ); - camera->SetParallelScale( (x2-x1)/3.0 ); - } + if (_direction==1) { + camera->SetViewUp ( 0 , 0 , -1 ); + camera->SetPosition ((x1+x2)/2 , 10000 , (z1+z2)/2 ); + camera->SetFocalPoint ((x1+x2)/2 , 0 , (z1+z2)/2 ); + camera->SetParallelScale( (x2-x1)/3.0 ); + } - if (_direction==2) { - camera->SetViewUp ( 0 , -1 , 0 ); - camera->SetPosition ((x1+x2)/2 , (y1+y2)/2 , -10000); - camera->SetFocalPoint ((x1+x2)/2 , (y1+y2)/2 , 0 ); - camera->SetParallelScale( (x2-x1)/3.0 ); + if (_direction==2) { + camera->SetViewUp ( 0 , -1 , 0 ); + camera->SetPosition ((x1+x2)/2 , (y1+y2)/2 , -10000); + camera->SetFocalPoint ((x1+x2)/2 , (y1+y2)/2 , 0 ); + camera->SetParallelScale( (x2-x1)/3.0 ); + } } - // _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow (160); // _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel (800); @@ -2094,61 +2096,65 @@ void wxVtkMPR2DView::Refresh() //wxVtk2DBaseView::Refresh(); - //vtkImageViewer2 *IV2=_imageViewer2XYZ->GetVtkImageViewer2(); - //vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera(); + //vtkImageViewer2 *IV2=_imageViewer2XYZ->GetVtkImageViewer2(); // JPRx + //vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera(); // JPRx int x1,x2,y1,y2,z1,z2; GetVtkmprbasedata()->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2); double spc[3]; - GetVtkmprbasedata()->GetImageData()->GetSpacing(spc); - x1 = (int)(x1*spc[0]); - y1 = (int)(y1*spc[1]); - z1 = (int)(z1*spc[2]); + + vtkImageData* img = GetVtkmprbasedata()->GetImageData(); + if(img!=NULL){ + img->GetSpacing(spc); + x1 = (int)(x1*spc[0]); + y1 = (int)(y1*spc[1]); + z1 = (int)(z1*spc[2]); - x2 = (int)(x2*spc[0]); - y2 = (int)(y2*spc[1]); - z2 = (int)(z2*spc[2]); + x2 = (int)(x2*spc[0]); + y2 = (int)(y2*spc[1]); + z2 = (int)(z2*spc[2]); - int x = (int)(GetVtkmprbasedata()->GetX()); - int y = (int)(GetVtkmprbasedata()->GetY()); - int z = (int)(GetVtkmprbasedata()->GetZ()); + int x = (int)(GetVtkmprbasedata()->GetX()); + int y = (int)(GetVtkmprbasedata()->GetY()); + int z = (int)(GetVtkmprbasedata()->GetZ()); - x = (int)(x*spc[0]); - y = (int)(y*spc[1]); - z = (int)(z*spc[2]); + x = (int)(x*spc[0]); + y = (int)(y*spc[1]); + z = (int)(z*spc[2]); - if ((x!=_backX) || (y!=_backY) || (z!=_backZ)) { + if ((x!=_backX) || (y!=_backY) || (z!=_backZ)) { - if (_direction==0) { - _imageViewer2XYZ->SetXSlice( (int)(GetVtkmprbasedata()->GetX()) ); - _ptsA->SetPoint(0, -x2, y1 , z ); - _ptsA->SetPoint(1, -x2, y2 , z ); - _ptsB->SetPoint(0, -x2, y , z1); - _ptsB->SetPoint(1, -x2, y , z2); - } - if (_direction==1) { - _imageViewer2XYZ->SetYSlice( (int)(GetVtkmprbasedata()->GetY()) ); - _ptsA->SetPoint(0, x1 , y2 , z ); - _ptsA->SetPoint(1, x2 , y2 , z ); - _ptsB->SetPoint(0, x , y2 , z1); - _ptsB->SetPoint(1, x , y2 , z2); - } - if (_direction==2) { - _imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) ); - _ptsA->SetPoint(0, x1 , y , -z2 ); - _ptsA->SetPoint(1, x2 , y , -z2 ); - _ptsB->SetPoint(0, x , y1, -z2 ); - _ptsB->SetPoint(1, x , y2, -z2 ); + if (_direction==0) { + _imageViewer2XYZ->SetXSlice( (int)(GetVtkmprbasedata()->GetX()) ); + _ptsA->SetPoint(0, -x2, y1 , z ); + _ptsA->SetPoint(1, -x2, y2 , z ); + _ptsB->SetPoint(0, -x2, y , z1); + _ptsB->SetPoint(1, -x2, y , z2); + } + if (_direction==1) { + _imageViewer2XYZ->SetYSlice( (int)(GetVtkmprbasedata()->GetY()) ); + _ptsA->SetPoint(0, x1 , y2 , z ); + _ptsA->SetPoint(1, x2 , y2 , z ); + _ptsB->SetPoint(0, x , y2 , z1); + _ptsB->SetPoint(1, x , y2 , z2); + } + if (_direction==2) { + _imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) ); + _ptsA->SetPoint(0, x1 , y , -z2 ); + _ptsA->SetPoint(1, x2 , y , -z2 ); + _ptsB->SetPoint(0, x , y1, -z2 ); + _ptsB->SetPoint(1, x , y2, -z2 ); + } + _backX=x; + _backY=y; + _backZ=z; } - _backX=x; - _backY=y; - _backZ=z; + wxVtkBaseView::Refresh(); } - wxVtkBaseView::Refresh(); } //------------------------------------------------------------------- int wxVtkMPR2DView::GetActualSlice() // virtual @@ -2468,7 +2474,7 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV ckBoxX->SetValue(false); ckBoxY->SetValue(false); ckBoxZ->SetValue(false); - _ckBoxXYZ->SetValue(true); + _ckBoxXYZ->SetValue(false); _ckBoxPlane->SetValue(false); _positionX->SetSize(400,20); @@ -2595,7 +2601,7 @@ void wxVtkMPR3DViewCntrlPanel::OnEditColorTable(wxCommandEvent& event) std::vector *ctfunVectorGreen = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorGreen(); std::vector *ctfunVectorBlue = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorBlue(); - //void *p=this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer(); + //void *p=this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer(); // JPRx int i=0,xi,r,g,b; @@ -2617,7 +2623,8 @@ void wxVtkMPR3DViewCntrlPanel::OnEditColorTable(wxCommandEvent& event) double r = (*ctfunVectorRed)[i]; double g = (*ctfunVectorGreen)[i]; double b = (*ctfunVectorBlue)[i]; - hDlg->addColorPoint(gr,r*255,g*255,b*255); + +hDlg->addColorPoint(gr,(int)(r*255),(int)(g*255),(int)(b*255)); i++; } } @@ -2891,9 +2898,9 @@ wxVtkClipping3DViewCntrlPanel::wxVtkClipping3DViewCntrlPanel(wxWindow *parent, w wxFlexGridSizer *sizerH1 = new wxFlexGridSizer(20); wxFlexGridSizer *sizerH2 = new wxFlexGridSizer(10); wxFlexGridSizer *sizerH3 = new wxFlexGridSizer(10); - //wxFlexGridSizer *sizerH4 = new wxFlexGridSizer(10); - //wxFlexGridSizer *sizerH5 = new wxFlexGridSizer(10); - //wxFlexGridSizer *sizerH6 = new wxFlexGridSizer(10); + //wxFlexGridSizer *sizerH4 = new wxFlexGridSizer(10); // JPRx + //wxFlexGridSizer *sizerH5 = new wxFlexGridSizer(10); // JPRx + //wxFlexGridSizer *sizerH6 = new wxFlexGridSizer(10); // JPRx sizerH0->Add( ckVolum , 1, wxALL|wxEXPAND, 0); sizerH0->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0); @@ -3274,7 +3281,7 @@ void wxVtkClipping3DViewCntrlPanel::OnBtnSaveRawVolume(wxCommandEvent& event) void wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(wxCommandEvent& event) { - int /*i=0,*/ xi,yi,r,g,b; + int /*i=0,*/ xi,yi,r,g,b; // JPRx vtkColorTransferFunction* ctfun = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetColorTransferenceFunction(); vtkPiecewiseFunction* tfun = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTransferencefunction(); std::vector* gtf = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetGreyValuesTransferenceFVector(); @@ -3331,7 +3338,7 @@ void wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(wxCommandEvent& event) double r=(*rctf)[i]; double g=(*gctf)[i]; double b=(*bctf)[i]; - hDlg->addColorPoint(gr,r*255,g*255,b*255); + hDlg->addColorPoint(gr,(int)(r*255),(int)(g*255),(int)(b*255)); i++; } } @@ -3495,7 +3502,7 @@ void wxVtkMPR3DView::RefreshView() // virtual double spc[3]; this->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData()->GetSpacing(spc); - //double nx=1,ny=0,nz=0; + //double nx=1,ny=0,nz=0; // JPRx Refresh(); double x=GetVtkMPR3DDataViewer ()->GetVtkMPRBaseData()->GetX(); double y=GetVtkMPR3DDataViewer ()->GetVtkMPRBaseData()->GetY(); @@ -3567,7 +3574,6 @@ void wxVtkMPR3DView::Configure(){ _wxvtk3Dbaseview->GetRenderer()->ResetCameraClippingRange(); - // vtkPointWidget _myCallback = vtkmyPWCallback_3DPointWidget::New(); _myCallback->SetWxVtkMPR3DView(this); @@ -3576,10 +3582,16 @@ void wxVtkMPR3DView::Configure(){ _myCallback->SetVtkPointWidget(_pointWidget); _pointWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() ); _pointWidget->SetInput( GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData() ); + _pointWidget->AllOff(); + _pointWidget->PlaceWidget(); // _pointWidget->SetPosition( x,y,z ); - _pointWidget->On(); + +//EED01 29Mars2009 +// MACOS probleme vtk-window out of wx-window +// _pointWidget->On(); + _pointWidget->AddObserver(vtkCommand::InteractionEvent,_myCallback); @@ -3612,10 +3624,12 @@ void wxVtkMPR3DView::Configure(){ contourMapper->SetScalarRange( imageData->GetScalarRange() ); _contourPlaneActor = vtkActor::New(); _contourPlaneActor->SetMapper(contourMapper); + _contourPlaneActor->VisibilityOff(); _planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() ); _planeWidget->AddObserver(vtkCommand::InteractionEvent,_myCallback); + _planeWidget->Off(); _wxvtk3Dbaseview->GetRenderer()->AddActor( _contourPlaneActor ); } @@ -4010,7 +4024,10 @@ void wxVtkClipping3DView::Configure(){ VisibleActor(3, false ); _boxWidgetS1->HandlesOn (); - _boxWidgetS1->On(); + +//EED 29Mars2009 +// _boxWidgetS1->On(); + _boxWidgetS1->Off(); _boxWidgetS1->GetPlanes( this->GetVtkClipping3DDataViewer()->GetTissuePlanes(0) ); @@ -4030,7 +4047,10 @@ void wxVtkClipping3DView::Configure(){ _boxWidgetVolume->AddObserver( vtkCommand::InteractionEvent , _vtkclipping3Ddataviewer->GetObserverV() ); _boxWidgetVolume->HandlesOn (); - _boxWidgetVolume->On(); + +//EED 29Mars2009 +// _boxWidgetVolume->On(); + _boxWidgetVolume->Off(); @@ -5384,38 +5404,60 @@ wxMPRWidget::wxMPRWidget( wxWindow* parent, _vtkmprbasedata = NULL; - _voxelSize = voxelSize; + _framePanelCutting = NULL; _panelCutting = NULL; - _marImageData = marimageData; - _vtkmprbasedata = new vtkMPRBaseData(); - _vtkmprbasedata->SetMarImageData(_marImageData); - - wxSplitterWindow *pnlSplitter = new wxSplitterWindow( this , -1); - wxPanel *MPRPanel = CreateMPRPanel(pnlSplitter,_vtkmprbasedata); - wxPanel *controlPanel = CreateControlPanel(pnlSplitter); wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL ); - sizer -> Add( pnlSplitter ,1,wxGROW ,0); - int ww,hh; - wxWindow *pp=this; - while (pp->GetParent()!=NULL) pp=pp->GetParent(); - pp->GetSize(&ww,&hh); + if(marimageData!=NULL){ + _marImageData = marimageData; + _voxelSize = voxelSize; + _vtkmprbasedata = new vtkMPRBaseData(); + _vtkmprbasedata->SetMarImageData(_marImageData); + + + - pnlSplitter -> SetMinimumPaneSize( 2 ); + wxSplitterWindow *pnlSplitter = new wxSplitterWindow( this , -1); + pnlSplitter -> SetMinimumPaneSize( 2 ); - pnlSplitter -> SplitVertically( MPRPanel, controlPanel, 550 ); + wxPanel *MPRPanel = CreateMPRPanel(pnlSplitter,_vtkmprbasedata); + wxPanel *controlPanel = CreateControlPanel(pnlSplitter); + pnlSplitter -> SplitVertically( MPRPanel, controlPanel, 550 ); + + sizer -> Add( pnlSplitter ,1,wxGROW ,0); + + } + + //int ww,hh; + //wxWindow *pp=this; + //while (pp->GetParent()!=NULL) pp=pp->GetParent(); + //pp->GetSize(&ww,&hh); + this -> SetAutoLayout( true ); this -> SetSizer(sizer); // sizer -> Fit( this ); - _refreshAPage=0; _refreshBPage=0; } +void wxMPRWidget::setMarImage(marImageData *marimageData, double voxelsize){ + _marImageData = marimageData; + _voxelSize = voxelsize; + _vtkmprbasedata = new vtkMPRBaseData(); + _vtkmprbasedata->SetMarImageData(_marImageData); + + wxSplitterWindow *pnlSplitter = new wxSplitterWindow( this , -1); + pnlSplitter -> SetMinimumPaneSize( 2 ); + wxPanel *MPRPanel = CreateMPRPanel(pnlSplitter,_vtkmprbasedata); + wxPanel *controlPanel = CreateControlPanel(pnlSplitter); + pnlSplitter -> SplitVertically( MPRPanel, controlPanel, 550 ); + + this->GetSizer() -> Add( pnlSplitter ,1,wxGROW ,0); +} //---------------------------------------------------------------------------- wxMPRWidget::~wxMPRWidget( ) @@ -5907,8 +5949,10 @@ void wxMPRWidget::ConfigureVTK(){ { _wxvtk3Dbaseview_Clipping3D_BB->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( vtkinteractorstyle3Dview ); } - - RefreshView(true); + +//EED 29Mars2009 +// RefreshView(true); + } //----------------------------------------------------------------------------