#include <vtk3DQuantSurfaceWidget.h>
Public Member Functions | |
listContourVTK (vtk3DQuantSurfaceWidget *quantSurfaceWidget) | |
~listContourVTK () | |
void | EraseListContourActor () |
void | EraseSliceContourActor (int slice, bool refresh=true) |
void | InitListContourActor (int nos) |
void | Set3DContourActor (int slice, vtkPoints *contour3D, bool showActor) |
void | Show3DContourActor () |
void | Hide3DContourActor () |
void | SetColour (int r, int g, int b) |
Private Attributes | |
int | _r |
int | _g |
int | _b |
vtk3DQuantSurfaceWidget * | _vtk3DQuantSurfaceWidget |
std::vector< vtkActor * > | _lst3DContoursVtkActor |
std::vector < vtkUnstructuredGrid * > | _lst3DContoursVtkUnstructuredGrid |
std::vector< vtkDataSetMapper * > | _lst3DContoursVtkDataSetMapper |
std::vector< vtkPolyLine * > | _lst3DContoursVtkPolyLine |
Definition at line 54 of file vtk3DQuantSurfaceWidget.h.
listContourVTK::listContourVTK | ( | vtk3DQuantSurfaceWidget * | quantSurfaceWidget | ) |
Definition at line 50 of file vtk3DQuantSurfaceWidget.cxx.
References _b, _g, _r, and _vtk3DQuantSurfaceWidget.
00050 { 00051 _r=1; 00052 _g=1; 00053 _b=1; 00054 _vtk3DQuantSurfaceWidget=quantSurfaceWidget; 00055 }
listContourVTK::~listContourVTK | ( | ) |
Definition at line 57 of file vtk3DQuantSurfaceWidget.cxx.
References EraseListContourActor().
00057 { 00058 EraseListContourActor(); 00059 }
void listContourVTK::EraseListContourActor | ( | ) |
Definition at line 83 of file vtk3DQuantSurfaceWidget.cxx.
References _lst3DContoursVtkActor, _lst3DContoursVtkDataSetMapper, _lst3DContoursVtkPolyLine, _lst3DContoursVtkUnstructuredGrid, and EraseSliceContourActor().
Referenced by InitListContourActor(), and ~listContourVTK().
00083 { 00084 int i; 00085 for (i=0;i<_lst3DContoursVtkActor.size();i++){ 00086 EraseSliceContourActor(i,false); 00087 } 00088 _lst3DContoursVtkActor.clear(); 00089 _lst3DContoursVtkUnstructuredGrid.clear(); 00090 _lst3DContoursVtkDataSetMapper.clear(); 00091 _lst3DContoursVtkPolyLine.clear(); 00092 }
void listContourVTK::EraseSliceContourActor | ( | int | slice, | |
bool | refresh = true | |||
) |
Definition at line 94 of file vtk3DQuantSurfaceWidget.cxx.
References _lst3DContoursVtkActor, _lst3DContoursVtkDataSetMapper, _lst3DContoursVtkPolyLine, _lst3DContoursVtkUnstructuredGrid, _vtk3DQuantSurfaceWidget, vtk3DQuantSurfaceWidget::QuantSurfaceWidget_GetRenderer(), and vtk3DQuantSurfaceWidget::QuantSurfaceWidget_GetRenderWindow().
Referenced by vtk3DQuantSurfaceWidget::Erase3DContourActor(), EraseListContourActor(), and Set3DContourActor().
00094 { 00095 if (_lst3DContoursVtkActor[slice]!=NULL){ 00096 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer(); 00097 if (_lst3DContoursVtkActor[slice]) pRenderer->RemoveActor(_lst3DContoursVtkActor[slice]); 00098 if (_lst3DContoursVtkUnstructuredGrid[slice]) _lst3DContoursVtkUnstructuredGrid[slice]->Delete(); 00099 if (_lst3DContoursVtkDataSetMapper[slice]) _lst3DContoursVtkDataSetMapper[slice]->Delete(); 00100 if (_lst3DContoursVtkPolyLine[slice]) _lst3DContoursVtkPolyLine[slice]->Delete(); 00101 if (_lst3DContoursVtkActor[slice]) _lst3DContoursVtkActor[slice]->Delete(); 00102 _lst3DContoursVtkUnstructuredGrid[slice]=NULL; 00103 _lst3DContoursVtkDataSetMapper[slice]=NULL; 00104 _lst3DContoursVtkPolyLine[slice]=NULL; 00105 _lst3DContoursVtkActor[slice]=NULL; 00106 } 00107 if (refresh==true){ 00108 // Refresh 3DWidget 00109 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow(); 00110 pRenderWindow->Render( ); 00111 } 00112 }
void listContourVTK::Hide3DContourActor | ( | ) |
Definition at line 163 of file vtk3DQuantSurfaceWidget.cxx.
References _lst3DContoursVtkActor, _vtk3DQuantSurfaceWidget, vtk3DQuantSurfaceWidget::QuantSurfaceWidget_GetRenderer(), and vtk3DQuantSurfaceWidget::QuantSurfaceWidget_GetRenderWindow().
Referenced by vtk3DQuantSurfaceWidget::Hide3DContourActor().
00163 { 00164 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer(); 00165 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow(); 00166 int i; 00167 for (i=0;i<_lst3DContoursVtkActor.size();i++){ 00168 if (_lst3DContoursVtkActor[i]!=NULL) pRenderer->RemoveActor( _lst3DContoursVtkActor[i] ); 00169 } 00170 // Refresh 3DWidget 00171 pRenderWindow->Render( ); 00172 }
void listContourVTK::InitListContourActor | ( | int | nos | ) |
Definition at line 67 of file vtk3DQuantSurfaceWidget.cxx.
References _lst3DContoursVtkActor, _lst3DContoursVtkDataSetMapper, _lst3DContoursVtkPolyLine, _lst3DContoursVtkUnstructuredGrid, and EraseListContourActor().
Referenced by vtk3DQuantSurfaceWidget::InitListContourActor(), vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxe(), and vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxeCT().
00067 { 00068 EraseListContourActor(); 00069 int i; 00070 for (i=0;i<nos;i++){ 00071 _lst3DContoursVtkActor.push_back( NULL ); 00072 _lst3DContoursVtkUnstructuredGrid.push_back( NULL ); 00073 _lst3DContoursVtkDataSetMapper.push_back( NULL ); 00074 _lst3DContoursVtkPolyLine.push_back( NULL ); 00075 } 00076 00077 // Refresh 3DWidget 00078 // EED 31 mai 2007 00079 // vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow(); 00080 // pRenderWindow->Render( ); 00081 }
void listContourVTK::Set3DContourActor | ( | int | slice, | |
vtkPoints * | contour3D, | |||
bool | showActor | |||
) |
Definition at line 114 of file vtk3DQuantSurfaceWidget.cxx.
References _b, _g, _lst3DContoursVtkActor, _lst3DContoursVtkDataSetMapper, _lst3DContoursVtkPolyLine, _lst3DContoursVtkUnstructuredGrid, _r, _vtk3DQuantSurfaceWidget, EraseSliceContourActor(), vtk3DQuantSurfaceWidget::QuantSurfaceWidget_GetRenderer(), and vtk3DQuantSurfaceWidget::QuantSurfaceWidget_GetRenderWindow().
Referenced by vtk3DQuantSurfaceWidget::Set3DContourActor().
00114 { 00115 // Erase old actor 00116 EraseSliceContourActor(slice); 00117 // generate new actor 00118 int id,numberOfPoints; 00119 numberOfPoints=contour3D->GetNumberOfPoints (); 00120 _lst3DContoursVtkPolyLine[slice] = vtkPolyLine::New(); 00121 00122 ( _lst3DContoursVtkPolyLine[slice]->GetPointIds() )->SetNumberOfIds(numberOfPoints); 00123 for (id=0;id<numberOfPoints;id++){ 00124 ( _lst3DContoursVtkPolyLine[slice]->GetPointIds() )->SetId(id,id); 00125 } 00126 _lst3DContoursVtkUnstructuredGrid[slice]=vtkUnstructuredGrid::New(); 00127 _lst3DContoursVtkUnstructuredGrid[slice]->Allocate(1,1); 00128 _lst3DContoursVtkUnstructuredGrid[slice]->InsertNextCell( _lst3DContoursVtkPolyLine[slice]->GetCellType() , 00129 _lst3DContoursVtkPolyLine[slice]->GetPointIds() ); 00130 _lst3DContoursVtkUnstructuredGrid[slice]->SetPoints( contour3D ); 00131 _lst3DContoursVtkDataSetMapper[slice] = vtkDataSetMapper::New(); 00132 _lst3DContoursVtkDataSetMapper[slice]->SetInput(_lst3DContoursVtkUnstructuredGrid[slice]); 00133 _lst3DContoursVtkDataSetMapper[slice]->ImmediateModeRenderingOn(); 00134 _lst3DContoursVtkActor[slice]=vtkActor::New(); 00135 _lst3DContoursVtkActor[slice]->SetMapper(_lst3DContoursVtkDataSetMapper[slice]); 00136 _lst3DContoursVtkActor[slice]->GetProperty()->BackfaceCullingOn(); 00137 _lst3DContoursVtkActor[slice]->GetProperty()->SetDiffuseColor(_r,_g,_b); 00138 _lst3DContoursVtkActor[slice]->PickableOff( ); 00139 // add new actor 00140 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer(); 00141 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow(); 00142 00143 if (showActor==true){ 00144 pRenderer->AddActor( _lst3DContoursVtkActor[slice] ); 00145 } 00146 // Refresh 3DWidget 00147 pRenderWindow->Render( ); 00148 00149 00150 }
void listContourVTK::SetColour | ( | int | r, | |
int | g, | |||
int | b | |||
) |
Definition at line 61 of file vtk3DQuantSurfaceWidget.cxx.
Referenced by vtk3DQuantSurfaceWidget::vtk3DQuantSurfaceWidget().
void listContourVTK::Show3DContourActor | ( | ) |
Definition at line 152 of file vtk3DQuantSurfaceWidget.cxx.
References _lst3DContoursVtkActor, _vtk3DQuantSurfaceWidget, vtk3DQuantSurfaceWidget::QuantSurfaceWidget_GetRenderer(), and vtk3DQuantSurfaceWidget::QuantSurfaceWidget_GetRenderWindow().
Referenced by vtk3DQuantSurfaceWidget::Show3DContourActor().
00152 { 00153 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer(); 00154 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow(); 00155 int i; 00156 for (i=0;i<_lst3DContoursVtkActor.size();i++){ 00157 if (_lst3DContoursVtkActor[i]!=NULL) pRenderer->AddActor( _lst3DContoursVtkActor[i] ); 00158 } 00159 // Refresh 3DWidget 00160 pRenderWindow->Render( ); 00161 }
int listContourVTK::_b [private] |
Definition at line 67 of file vtk3DQuantSurfaceWidget.h.
Referenced by listContourVTK(), Set3DContourActor(), and SetColour().
int listContourVTK::_g [private] |
Definition at line 67 of file vtk3DQuantSurfaceWidget.h.
Referenced by listContourVTK(), Set3DContourActor(), and SetColour().
std::vector< vtkActor* > listContourVTK::_lst3DContoursVtkActor [private] |
Definition at line 69 of file vtk3DQuantSurfaceWidget.h.
Referenced by EraseListContourActor(), EraseSliceContourActor(), Hide3DContourActor(), InitListContourActor(), Set3DContourActor(), and Show3DContourActor().
std::vector< vtkDataSetMapper* > listContourVTK::_lst3DContoursVtkDataSetMapper [private] |
Definition at line 71 of file vtk3DQuantSurfaceWidget.h.
Referenced by EraseListContourActor(), EraseSliceContourActor(), InitListContourActor(), and Set3DContourActor().
std::vector< vtkPolyLine* > listContourVTK::_lst3DContoursVtkPolyLine [private] |
Definition at line 72 of file vtk3DQuantSurfaceWidget.h.
Referenced by EraseListContourActor(), EraseSliceContourActor(), InitListContourActor(), and Set3DContourActor().
std::vector< vtkUnstructuredGrid* > listContourVTK::_lst3DContoursVtkUnstructuredGrid [private] |
Definition at line 70 of file vtk3DQuantSurfaceWidget.h.
Referenced by EraseListContourActor(), EraseSliceContourActor(), InitListContourActor(), and Set3DContourActor().
int listContourVTK::_r [private] |
Definition at line 67 of file vtk3DQuantSurfaceWidget.h.
Referenced by listContourVTK(), Set3DContourActor(), and SetColour().
Definition at line 68 of file vtk3DQuantSurfaceWidget.h.
Referenced by EraseSliceContourActor(), Hide3DContourActor(), listContourVTK(), Set3DContourActor(), and Show3DContourActor().