#include <wxVtkClipping3DView.h>
Public Member Functions | |
wxVtkClipping3DView (wxVtk3DBaseView *wxvtk3Dbaseview) | |
virtual | ~wxVtkClipping3DView () |
virtual void | Refresh () |
virtual void | Configure () |
void | SetVtkClipping3DDataViewer (vtkClipping3DDataViewer *vtkclipping3Ddataviewer) |
wxPanel * | CreateSurfControlPanel (wxWindow *parent) |
wxPanel * | CreateVolControlPanel (wxWindow *parent) |
vtkClipping3DDataViewer * | GetVtkClipping3DDataViewer () |
void | VisibleActor (int idTissue, bool visTissue) |
void | VisibleVolumeActor (bool visVolume) |
void | SetVisibleBoxSurface (bool visible) |
void | SetVisibleBoxVolume (bool visible) |
void | SetRepSurfaceWireFrame (int idTissue, bool typeRepresentation) |
wxVtk3DBaseView * | GetWxvtk3Dbaseview () throw (char*) |
Private Attributes | |
wxVtk3DBaseView * | _wxvtk3Dbaseview |
vtkClipping3DDataViewer * | _vtkclipping3Ddataviewer |
vtkBoxWidget * | _boxWidgetS1 |
vtkBoxWidget * | _boxWidgetVolume |
wxPanel * | _wxvtkclipping3DviewCntrlPanel |
wxPanel * | _wxvtkclipping3DviewVolCntrlPanel |
Definition at line 11 of file wxVtkClipping3DView.h.
wxVtkClipping3DView::wxVtkClipping3DView | ( | wxVtk3DBaseView * | wxvtk3Dbaseview | ) |
Definition at line 6 of file wxVtkClipping3DView.cxx.
References _boxWidgetS1, _boxWidgetVolume, _vtkclipping3Ddataviewer, _wxvtk3Dbaseview, and _wxvtkclipping3DviewCntrlPanel.
00007 { 00008 _wxvtk3Dbaseview = wxvtk3Dbaseview; 00009 _vtkclipping3Ddataviewer = NULL; 00010 _wxvtkclipping3DviewCntrlPanel = NULL; 00011 00012 _boxWidgetVolume = NULL; 00013 _boxWidgetS1 = NULL; 00014 }
wxVtkClipping3DView::~wxVtkClipping3DView | ( | ) | [virtual] |
Definition at line 17 of file wxVtkClipping3DView.cxx.
References _boxWidgetS1, _boxWidgetVolume, _vtkclipping3Ddataviewer, and _wxvtkclipping3DviewCntrlPanel.
00017 { 00018 if (_boxWidgetVolume!=NULL) { _boxWidgetVolume -> Delete(); } 00019 if (_boxWidgetS1!=NULL) { _boxWidgetS1 -> Delete(); } 00020 if (_vtkclipping3Ddataviewer!=NULL) { delete _vtkclipping3Ddataviewer; } 00021 if (_wxvtkclipping3DviewCntrlPanel!=NULL){ delete _wxvtkclipping3DviewCntrlPanel; } 00022 }
void wxVtkClipping3DView::Configure | ( | ) | [virtual] |
Definition at line 125 of file wxVtkClipping3DView.cxx.
References _boxWidgetS1, _boxWidgetVolume, _vtkclipping3Ddataviewer, _wxvtk3Dbaseview, wxVtk3DBaseView::Configure(), wxVtk3DBaseView::GetCamera(), vtkClipping3DDataViewer::GetObserverS(), vtkClipping3DDataViewer::GetObserverV(), vtkClipping3DDataViewer::GetOutlineActor(), wxVtk3DBaseView::GetRenderer(), wxVtk3DBaseView::GetRenWin(), vtkClipping3DDataViewer::GetTissueStripper(), GetVtkClipping3DDataViewer(), wxVtkBaseView::GetWxVTKRenderWindowInteractor(), VisibleActor(), and VTKMPRDATA_MAXTISSUE.
00125 { 00126 _wxvtk3Dbaseview->Configure(); 00127 00128 // Actors are added to the renderer. 00129 _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkclipping3Ddataviewer->GetOutlineActor() ); 00130 00131 _boxWidgetS1 = vtkBoxWidget::New(); 00132 _boxWidgetS1->SetInteractor( _wxvtk3Dbaseview->GetWxVTKRenderWindowInteractor() ); 00133 _boxWidgetS1->SetPlaceFactor(1.25); 00134 00135 00136 00137 vtkStripper *stripper=_vtkclipping3Ddataviewer->GetTissueStripper(0); 00138 vtkPolyData *polydata= stripper->GetOutput(); 00139 00140 00141 _boxWidgetS1->SetInput( polydata ); 00142 _boxWidgetS1->PlaceWidget(); 00143 00144 int i; 00145 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++) 00146 { 00147 _boxWidgetS1->AddObserver( vtkCommand::InteractionEvent , _vtkclipping3Ddataviewer->GetObserverS(i) ); 00148 } 00149 00150 00151 00152 00153 // _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkclipping3Ddataviewer->GetTissueActor(0) ); 00154 // _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkclipping3Ddataviewer->GetTissueActor(3)); 00155 00156 VisibleActor(0, false ); 00157 VisibleActor(1, false ); 00158 VisibleActor(2, false ); 00159 VisibleActor(3, false ); 00160 00161 _boxWidgetS1->HandlesOn (); 00162 00163 //EED 29Mars2009 00164 // _boxWidgetS1->On(); 00165 00166 _boxWidgetS1->Off(); 00167 00168 _boxWidgetS1->GetPlanes( this->GetVtkClipping3DDataViewer()->GetTissuePlanes(0) ); 00169 _boxWidgetS1->GetPlanes( this->GetVtkClipping3DDataViewer()->GetTissuePlanes(1) ); 00170 _boxWidgetS1->GetPlanes( this->GetVtkClipping3DDataViewer()->GetTissuePlanes(2) ); 00171 _boxWidgetS1->GetPlanes( this->GetVtkClipping3DDataViewer()->GetTissuePlanes(3) ); 00172 00173 // EED 9 fev 2007 00174 // box Volume 00175 _boxWidgetVolume = vtkBoxWidget::New(); 00176 _boxWidgetVolume->SetInteractor( _wxvtk3Dbaseview->GetWxVTKRenderWindowInteractor() ); 00177 _boxWidgetVolume->SetPlaceFactor(1.25); 00178 00179 _boxWidgetVolume->SetInput( this->GetVtkClipping3DDataViewer()->GetVtkMPRBaseData()->GetImageData() ); 00180 _boxWidgetVolume->PlaceWidget(); 00181 00182 _boxWidgetVolume->AddObserver( vtkCommand::InteractionEvent , _vtkclipping3Ddataviewer->GetObserverV() ); 00183 00184 _boxWidgetVolume->HandlesOn (); 00185 00186 //EED 29Mars2009 00187 // _boxWidgetVolume->On(); 00188 00189 _boxWidgetVolume->Off(); 00190 00191 00192 // vtkPlanes *vtkplanes=this->GetVtkClipping3DDataViewer()->GetVolumePlanes(); 00193 // _boxWidgetVolume->GetPlanes( vtkplanes ); 00194 00195 00196 // An initial camera view is created. The Dolly() method moves 00197 // the camera towards the FocalPoint, thereby enlarging the image. 00198 _wxvtk3Dbaseview->GetRenderer()->SetActiveCamera(_wxvtk3Dbaseview->GetCamera()); 00199 _wxvtk3Dbaseview->GetRenderer()->ResetCamera (); 00200 _wxvtk3Dbaseview->GetCamera()->Dolly(1.5); 00201 00202 // Set a background color for the renderer and set the size of the 00203 // render window (expressed in pixels). 00204 _wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.36 , 0.36 , 0.36 ); 00205 _wxvtk3Dbaseview->GetRenWin()->SetSize(400, 400); 00206 00207 // Note that when camera movement occurs (as it does in the Dolly() 00208 // method), the clipping planes often need adjusting. Clipping planes 00209 // consist of two planes: near and far along the view direction. The 00210 // near plane clips out objects in front of the plane; the far plane 00211 // clips out objects behind the plane. This way only what is drawn 00212 // between the planes is actually rendered. 00213 _wxvtk3Dbaseview->GetRenderer()->ResetCameraClippingRange(); 00214 }
wxPanel * wxVtkClipping3DView::CreateSurfControlPanel | ( | wxWindow * | parent | ) |
Definition at line 53 of file wxVtkClipping3DView.cxx.
References _wxvtkclipping3DviewCntrlPanel.
Referenced by wxManualTree_MPRWidget::Create3DViewContour(), wxMPRWidget::CreateMPRPanel4View(), wxMPRWidget::CreateView(), and wxMaracas_ViewerWidget::wxMaracas_ViewerWidget().
00054 { 00055 _wxvtkclipping3DviewCntrlPanel = new wxVtkClipping3DViewCntrlPanel(parent,this); 00056 return _wxvtkclipping3DviewCntrlPanel; 00057 }
wxPanel * wxVtkClipping3DView::CreateVolControlPanel | ( | wxWindow * | parent | ) |
Definition at line 61 of file wxVtkClipping3DView.cxx.
References _wxvtkclipping3DviewVolCntrlPanel.
Referenced by wxMaracas_ViewerWidget::wxMaracas_ViewerWidget().
00062 { 00063 _wxvtkclipping3DviewVolCntrlPanel = new wxVtkClipping3DViewVolCntrlPanel(parent,this); 00064 return _wxvtkclipping3DviewVolCntrlPanel; 00065 }
vtkClipping3DDataViewer * wxVtkClipping3DView::GetVtkClipping3DDataViewer | ( | ) |
Definition at line 69 of file wxVtkClipping3DView.cxx.
References _vtkclipping3Ddataviewer.
Referenced by Configure(), wxVtkClipping3DViewCntrlPanel::OnBtnCreateFileSTL(), wxVtkClipping3DViewCntrlPanel::OnBtnMeshVTKLoad(), wxVtkClipping3DViewCntrlPanel::OnBtnSaveRawVolume(), wxVtkClipping3DViewVolCntrlPanel::OnBtnVolumeFunctions(), wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(), wxVtkClipping3DViewCntrlPanel::OnColor(), wxMPRWidget::OnCutImagaData(), wxVtkClipping3DViewCntrlPanel::OnIsoValue(), wxVtkClipping3DViewCntrlPanel::OnOpacity(), wxVtkClipping3DViewCntrlPanel::OnSurface(), wxManualRegistration3D::RefreshView(), vtkInteractorStyle3DView::SelectMarchibCubePoint(), SetRepSurfaceWireFrame(), and wxVtkClipping3DViewCntrlPanel::wxVtkClipping3DViewCntrlPanel().
00070 { 00071 return _vtkclipping3Ddataviewer; 00072 }
wxVtk3DBaseView * wxVtkClipping3DView::GetWxvtk3Dbaseview | ( | ) | throw (char*) |
Definition at line 117 of file wxVtkClipping3DView.cxx.
References _wxvtk3Dbaseview.
Referenced by wxManualTree_MPRWidget::ConfigureContour(), wxVtkClipping3DViewCntrlPanel::OnBtnMeshVTKLoad(), wxVtkClipping3DViewVolCntrlPanel::OnBtnVolumeFunctions(), wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(), wxVtkClipping3DViewCntrlPanel::OnColor(), wxVtkClipping3DViewCntrlPanel::OnIsoValue(), wxVtkClipping3DViewCntrlPanel::OnOpacity(), wxVtkClipping3DViewCntrlPanel::OnRepresentationSurfaceWireFrame(), wxVtkClipping3DViewCntrlPanel::OnVisibleSurface(), wxVtkClipping3DViewVolCntrlPanel::OnVisibleVolume(), and wxVtkClipping3DViewCntrlPanel::OnVisibleVolume().
00118 { 00119 if(_wxvtk3Dbaseview==NULL){ 00120 throw "wxVtk3DBaseView* wxVtkClipping3DView::GetWxvtk3Dbaseview() _wxvtk3Dbaseview=NULL"; 00121 } 00122 return _wxvtk3Dbaseview; 00123 }
void wxVtkClipping3DView::Refresh | ( | ) | [virtual] |
Definition at line 44 of file wxVtkClipping3DView.cxx.
References _vtkclipping3Ddataviewer, _wxvtkclipping3DviewCntrlPanel, and vtkClipping3DDataViewer::Refresh().
Referenced by wxVtkClipping3DViewCntrlPanel::OnBtnMeshVTKLoad(), wxVtkClipping3DViewVolCntrlPanel::OnBtnVolumeFunctions(), wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(), wxVtkClipping3DViewCntrlPanel::OnColor(), wxVtkClipping3DViewCntrlPanel::OnIsoValue(), wxVtkClipping3DViewCntrlPanel::OnOpacity(), wxVtkClipping3DViewCntrlPanel::OnRepresentationSurfaceWireFrame(), wxVtkClipping3DViewCntrlPanel::OnVisibleBoxSurface(), wxVtkClipping3DViewVolCntrlPanel::OnVisibleBoxVolume(), wxVtkClipping3DViewCntrlPanel::OnVisibleBoxVolume(), wxVtkClipping3DViewCntrlPanel::OnVisibleSurface(), wxVtkClipping3DViewVolCntrlPanel::OnVisibleVolume(), and wxVtkClipping3DViewCntrlPanel::OnVisibleVolume().
00045 { 00046 _vtkclipping3Ddataviewer->Refresh(); 00047 if (_wxvtkclipping3DviewCntrlPanel!=NULL) 00048 { 00049 _wxvtkclipping3DviewCntrlPanel->Refresh(); 00050 } 00051 }
void wxVtkClipping3DView::SetRepSurfaceWireFrame | ( | int | idTissue, | |
bool | typeRepresentation | |||
) |
Definition at line 87 of file wxVtkClipping3DView.cxx.
References _vtkclipping3Ddataviewer, vtkClipping3DDataViewer::GetTissueActor(), GetVtkClipping3DDataViewer(), and vtkClipping3DDataViewer::SetRepresentationType().
Referenced by wxVtkClipping3DViewCntrlPanel::OnRepresentationSurfaceWireFrame().
00088 { 00089 vtkActor *tmpActor; 00090 tmpActor = GetVtkClipping3DDataViewer()->GetTissueActor(idTissue); 00091 00092 if (representationType==false){ 00093 tmpActor->GetProperty()->SetRepresentationToWireframe(); 00094 } else { 00095 tmpActor->GetProperty()->SetRepresentationToSurface(); 00096 } 00097 00098 _vtkclipping3Ddataviewer->SetRepresentationType(idTissue,representationType); 00099 }
void wxVtkClipping3DView::SetVisibleBoxSurface | ( | bool | visible | ) |
Definition at line 24 of file wxVtkClipping3DView.cxx.
References _boxWidgetS1.
Referenced by wxVtkClipping3DViewCntrlPanel::OnVisibleBoxSurface().
00025 { 00026 if (visible==true){ 00027 _boxWidgetS1->On(); 00028 } else { 00029 _boxWidgetS1->Off(); 00030 } 00031 }
void wxVtkClipping3DView::SetVisibleBoxVolume | ( | bool | visible | ) |
Definition at line 33 of file wxVtkClipping3DView.cxx.
References _boxWidgetVolume.
Referenced by wxVtkClipping3DViewVolCntrlPanel::OnVisibleBoxVolume(), and wxVtkClipping3DViewCntrlPanel::OnVisibleBoxVolume().
00034 { 00035 if (_boxWidgetVolume!=NULL){ 00036 if (visible==true){ 00037 _boxWidgetVolume->On(); 00038 } else { 00039 _boxWidgetVolume->Off(); 00040 } 00041 } 00042 }
void wxVtkClipping3DView::SetVtkClipping3DDataViewer | ( | vtkClipping3DDataViewer * | vtkclipping3Ddataviewer | ) |
Definition at line 216 of file wxVtkClipping3DView.cxx.
References _vtkclipping3Ddataviewer.
Referenced by wxManualRegistration3D::AddPanelControl_B(), wxManualRegistration3D::Create3DView(), wxManualTree_MPRWidget::Create3DViewContour(), wxSegmentationFM3DWidget::Create3DViewContour(), wxManualSegmentation_MPRWidget::Create3DViewContour(), wxMPRWidget::CreateMPRPanel4View(), wxMPRWidget::CreateView(), and wxMaracas_ViewerWidget::wxMaracas_ViewerWidget().
00217 { 00218 _vtkclipping3Ddataviewer = vtkclipping3Ddataviewer; 00219 }
void wxVtkClipping3DView::VisibleActor | ( | int | idTissue, | |
bool | visTissue | |||
) |
Definition at line 74 of file wxVtkClipping3DView.cxx.
References _vtkclipping3Ddataviewer, _wxvtk3Dbaseview, wxVtk3DBaseView::GetRenderer(), vtkClipping3DDataViewer::GetTissueActor(), vtkClipping3DDataViewer::GetVisibleTissue(), and vtkClipping3DDataViewer::SetVisibleTissue().
Referenced by Configure(), and wxVtkClipping3DViewCntrlPanel::OnVisibleSurface().
00074 { 00075 if (visTissue!=_vtkclipping3Ddataviewer->GetVisibleTissue(idTissue)){ 00076 if (visTissue==false){ 00077 _wxvtk3Dbaseview->GetRenderer()->RemoveActor( _vtkclipping3Ddataviewer->GetTissueActor(idTissue) ); 00078 } else { 00079 _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkclipping3Ddataviewer->GetTissueActor(idTissue) ); 00080 // _boxWidgetS1->GetPlanes( this->GetVtkClipping3DDataViewer()->GetTissuePlanes(idTissue) ); 00081 // _actor->VisibilityOn(); 00082 } 00083 _vtkclipping3Ddataviewer->SetVisibleTissue(idTissue,visTissue); 00084 } 00085 }
void wxVtkClipping3DView::VisibleVolumeActor | ( | bool | visVolume | ) |
Definition at line 102 of file wxVtkClipping3DView.cxx.
References _vtkclipping3Ddataviewer, _wxvtk3Dbaseview, wxVtk3DBaseView::GetRenderer(), vtkClipping3DDataViewer::GetVisibleVolume(), vtkClipping3DDataViewer::GetVolumeActor(), and vtkClipping3DDataViewer::SetVisibleVolume().
Referenced by wxVtkClipping3DViewVolCntrlPanel::OnVisibleVolume(), and wxVtkClipping3DViewCntrlPanel::OnVisibleVolume().
00102 { 00103 if (visVolume!=_vtkclipping3Ddataviewer->GetVisibleVolume() ){ 00104 if (visVolume==false){ 00105 //EED 31/03/2008 00106 // _wxvtk3Dbaseview->GetRenderer()->RemoveActor( _vtkclipping3Ddataviewer->GetVolumeActor() ); 00107 _wxvtk3Dbaseview->GetRenderer()->RemoveVolume( _vtkclipping3Ddataviewer->GetVolumeActor() ); 00108 } else { 00109 //EED 31/03/2008 00110 // _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkclipping3Ddataviewer->GetVolumeActor() ); 00111 _wxvtk3Dbaseview->GetRenderer()->AddVolume( _vtkclipping3Ddataviewer->GetVolumeActor() ); 00112 } 00113 _vtkclipping3Ddataviewer->SetVisibleVolume(visVolume); 00114 } 00115 }
vtkBoxWidget* wxVtkClipping3DView::_boxWidgetS1 [private] |
Definition at line 36 of file wxVtkClipping3DView.h.
Referenced by Configure(), SetVisibleBoxSurface(), wxVtkClipping3DView(), and ~wxVtkClipping3DView().
vtkBoxWidget* wxVtkClipping3DView::_boxWidgetVolume [private] |
Definition at line 37 of file wxVtkClipping3DView.h.
Referenced by Configure(), SetVisibleBoxVolume(), wxVtkClipping3DView(), and ~wxVtkClipping3DView().
Definition at line 35 of file wxVtkClipping3DView.h.
Referenced by Configure(), GetVtkClipping3DDataViewer(), Refresh(), SetRepSurfaceWireFrame(), SetVtkClipping3DDataViewer(), VisibleActor(), VisibleVolumeActor(), wxVtkClipping3DView(), and ~wxVtkClipping3DView().
Definition at line 34 of file wxVtkClipping3DView.h.
Referenced by Configure(), GetWxvtk3Dbaseview(), VisibleActor(), VisibleVolumeActor(), and wxVtkClipping3DView().
wxPanel* wxVtkClipping3DView::_wxvtkclipping3DviewCntrlPanel [private] |
Definition at line 38 of file wxVtkClipping3DView.h.
Referenced by CreateSurfControlPanel(), Refresh(), wxVtkClipping3DView(), and ~wxVtkClipping3DView().
wxPanel* wxVtkClipping3DView::_wxvtkclipping3DviewVolCntrlPanel [private] |
Definition at line 39 of file wxVtkClipping3DView.h.
Referenced by CreateVolControlPanel().