#include <ContourView.h>
Public Member Functions | |
ContourView () | |
~ContourView () | |
void | DeleteContours () |
void | SetWxVtkBaseView (wxVtkBaseView *wxvtkbaseview) |
void | Refresh () |
void | CreateNewContour (vtkPolyData *contour, int type) |
Private Types | |
enum | ContourTypes { BLUE = 0, MAGENTA, GREEN, YELLOW } |
Private Member Functions | |
void | DeleteVtkObjects () |
Private Attributes | |
wxVtkBaseView * | _wxvtkbaseview |
std::vector< vtkPolyDataMapper * > | contour_mapped |
std::vector< vtkActor * > | contour_actor |
Definition at line 12 of file ContourView.h.
enum ContourView::ContourTypes [private] |
ContourView::ContourView | ( | ) |
Definition at line 10 of file ContourView.cxx.
References _wxvtkbaseview.
00011 { 00012 _wxvtkbaseview = NULL; 00013 }
ContourView::~ContourView | ( | ) |
Definition at line 16 of file ContourView.cxx.
References DeleteContours().
00017 { 00018 DeleteContours(); 00019 }
void ContourView::CreateNewContour | ( | vtkPolyData * | contour, | |
int | type | |||
) |
Definition at line 42 of file ContourView.cxx.
References _wxvtkbaseview, BLUE, contour_actor, contour_mapped, wxVtkBaseView::GetRenderer(), wxVtkBaseView::GetRenWin(), GREEN, MAGENTA, and YELLOW.
Referenced by wxQuantificationWidgetCT::RefreshAxis().
00043 { 00044 contour_mapped.push_back(vtkPolyDataMapper::New()); 00045 contour_mapped.back()->ImmediateModeRenderingOn(); 00046 contour_mapped.back()->ScalarVisibilityOff( ); 00047 contour_mapped.back()->SetInput(contour); 00048 00049 contour_actor.push_back(vtkActor::New()); 00050 contour_actor.back()->SetMapper(contour_mapped.back()); 00051 contour_actor.back()->GetProperty()->BackfaceCullingOff(); 00052 00053 switch (type) 00054 { 00055 case ContourView::BLUE : contour_actor.back()->GetProperty()->SetDiffuseColor(0, 0, 1); 00056 break; 00057 case ContourView::MAGENTA : contour_actor.back()->GetProperty()->SetDiffuseColor(1, 0, 1); 00058 break; 00059 case ContourView::GREEN : contour_actor.back()->GetProperty()->SetDiffuseColor(0, 1, 0); 00060 break; 00061 case ContourView::YELLOW : contour_actor.back()->GetProperty()->SetDiffuseColor(0, 1, 1); 00062 break; 00063 default: contour_actor.back()->GetProperty()->SetDiffuseColor(0, 0, 1); 00064 00065 } 00066 contour_actor.back()->GetProperty()->SetLineWidth(2); 00067 contour_actor.back()->ApplyProperties(); 00068 00069 _wxvtkbaseview->GetRenderer()->AddActor(contour_actor.back()); 00070 _wxvtkbaseview->GetRenWin()->Render(); 00071 }
void ContourView::DeleteContours | ( | ) |
Definition at line 22 of file ContourView.cxx.
References contour_actor, contour_mapped, and DeleteVtkObjects().
Referenced by wxQuantificationWidgetCT::RefreshAxis(), and ~ContourView().
00023 { 00024 DeleteVtkObjects(); 00025 contour_mapped.clear(); 00026 contour_actor.clear(); 00027 }
void ContourView::DeleteVtkObjects | ( | ) | [private] |
Definition at line 74 of file ContourView.cxx.
References _wxvtkbaseview, contour_actor, contour_mapped, and wxVtkBaseView::GetRenderer().
Referenced by DeleteContours().
00075 { 00076 int i,size=contour_mapped.size(); 00077 for (i=0;i<size; i++){ 00078 if ( contour_mapped[i] != NULL ) { 00079 contour_mapped[i] -> Delete(); 00080 } 00081 if ( contour_actor[i] != NULL ) { 00082 _wxvtkbaseview->GetRenderer()->RemoveActor(contour_actor[i]); 00083 contour_actor[i] -> Delete(); 00084 } 00085 contour_actor[i] = NULL; 00086 contour_mapped[i] = NULL; 00087 } 00088 }
void ContourView::Refresh | ( | ) |
Definition at line 36 of file ContourView.cxx.
References _wxvtkbaseview, and wxVtkBaseView::GetRenWin().
Referenced by wxQuantificationWidgetCT::OnSliderCalcPercentageScroll(), and wxQuantificationWidgetCT::OnSliderLumenPercentageScroll().
00037 { 00038 _wxvtkbaseview->GetRenWin()->Render(); 00039 }
void ContourView::SetWxVtkBaseView | ( | wxVtkBaseView * | wxvtkbaseview | ) |
Definition at line 30 of file ContourView.cxx.
References _wxvtkbaseview.
Referenced by wxQuantificationWidgetCT::ConfigureVTK().
00031 { 00032 _wxvtkbaseview = wxvtkbaseview; 00033 }
wxVtkBaseView* ContourView::_wxvtkbaseview [private] |
Definition at line 35 of file ContourView.h.
Referenced by ContourView(), CreateNewContour(), DeleteVtkObjects(), Refresh(), and SetWxVtkBaseView().
std::vector<vtkActor*> ContourView::contour_actor [private] |
Definition at line 38 of file ContourView.h.
Referenced by CreateNewContour(), DeleteContours(), and DeleteVtkObjects().
std::vector<vtkPolyDataMapper*> ContourView::contour_mapped [private] |
Definition at line 37 of file ContourView.h.
Referenced by CreateNewContour(), DeleteContours(), and DeleteVtkObjects().