#include <LineView.h>
Public Member Functions | |
LineView () | |
~LineView () | |
void | DeleteLines () |
void | SetWxVtkBaseView (wxVtkBaseView *wxvtkbaseview) |
void | Refresh () |
void | CreateNewLine (double x1, double y1, double z1, double x2, double y2, double z2) |
Private Member Functions | |
void | DeleteVtkObjects () |
Private Attributes | |
wxVtkBaseView * | _wxvtkbaseview |
std::vector< vtkDataSetMapper * > | contour_mapped |
std::vector< vtkActor * > | contour_actor |
Definition at line 14 of file LineView.h.
LineView::LineView | ( | ) |
Definition at line 11 of file LineView.cxx.
References _wxvtkbaseview.
00012 { 00013 _wxvtkbaseview = NULL; 00014 }
LineView::~LineView | ( | ) |
Definition at line 17 of file LineView.cxx.
References DeleteLines().
00018 { 00019 DeleteLines(); 00020 }
void LineView::CreateNewLine | ( | double | x1, | |
double | y1, | |||
double | z1, | |||
double | x2, | |||
double | y2, | |||
double | z2 | |||
) |
Definition at line 43 of file LineView.cxx.
References _wxvtkbaseview, contour_actor, contour_mapped, wxVtkBaseView::GetRenderer(), and wxVtkBaseView::GetRenWin().
00044 { 00045 00046 vtkPoints* pointsLine = vtkPoints::New(); 00047 vtkPolyLine* aLine = vtkPolyLine::New(); 00048 vtkUnstructuredGrid* aLineGrid = vtkUnstructuredGrid::New(); 00049 contour_mapped.push_back(vtkDataSetMapper::New()); 00050 contour_actor.push_back(vtkActor::New()); 00051 00052 pointsLine->SetNumberOfPoints(2); 00053 pointsLine->InsertPoint(0,x1,y1,z1); 00054 pointsLine->InsertPoint(1,x2,y2,z2); 00055 00056 (aLine->GetPointIds())->SetNumberOfIds(2); 00057 (aLine->GetPointIds())->SetId(0,0); 00058 (aLine->GetPointIds())->SetId(1,1); 00059 00060 aLineGrid->Allocate(1,1); 00061 aLineGrid->InsertNextCell(aLine->GetCellType(),aLine->GetPointIds()); 00062 aLineGrid->SetPoints(pointsLine); 00063 00064 00065 contour_mapped.back()->SetInput(aLineGrid); 00066 contour_mapped.back()->ImmediateModeRenderingOn(); 00067 00068 contour_actor.back()->SetMapper(contour_mapped.back()); 00069 contour_actor.back()->GetProperty()->BackfaceCullingOn(); 00070 contour_actor.back()->GetProperty()->SetDiffuseColor(0, 0, 1); 00071 contour_actor.back()->ApplyProperties(); 00072 00073 _wxvtkbaseview->GetRenderer()->AddActor(contour_actor.back()); 00074 _wxvtkbaseview->GetRenWin()->Render(); 00075 00076 }
void LineView::DeleteLines | ( | ) |
Definition at line 23 of file LineView.cxx.
References contour_actor, contour_mapped, and DeleteVtkObjects().
Referenced by wxQuantificationWidgetCT::RefreshAxis(), and ~LineView().
00024 { 00025 DeleteVtkObjects(); 00026 contour_mapped.clear(); 00027 contour_actor.clear(); 00028 }
void LineView::DeleteVtkObjects | ( | ) | [private] |
Definition at line 79 of file LineView.cxx.
References _wxvtkbaseview, contour_actor, contour_mapped, and wxVtkBaseView::GetRenderer().
Referenced by DeleteLines().
00080 { 00081 int i,size=contour_mapped.size(); 00082 for (i=0;i<size; i++){ 00083 if ( contour_mapped[i] != NULL ) { 00084 contour_mapped[i] -> Delete(); 00085 } 00086 if ( contour_actor[i] != NULL ) { 00087 _wxvtkbaseview->GetRenderer()->RemoveActor(contour_actor[i]); 00088 contour_actor[i] -> Delete(); 00089 } 00090 contour_actor[i] = NULL; 00091 contour_mapped[i] = NULL; 00092 } 00093 }
void LineView::Refresh | ( | ) |
Definition at line 37 of file LineView.cxx.
References _wxvtkbaseview, and wxVtkBaseView::GetRenWin().
00038 { 00039 _wxvtkbaseview->GetRenWin()->Render(); 00040 }
void LineView::SetWxVtkBaseView | ( | wxVtkBaseView * | wxvtkbaseview | ) |
Definition at line 31 of file LineView.cxx.
References _wxvtkbaseview.
Referenced by wxQuantificationWidgetCT::ConfigureVTK().
00032 { 00033 _wxvtkbaseview = wxvtkbaseview; 00034 }
wxVtkBaseView* LineView::_wxvtkbaseview [private] |
Definition at line 26 of file LineView.h.
Referenced by CreateNewLine(), DeleteVtkObjects(), LineView(), Refresh(), and SetWxVtkBaseView().
std::vector<vtkActor*> LineView::contour_actor [private] |
Definition at line 29 of file LineView.h.
Referenced by CreateNewLine(), DeleteLines(), and DeleteVtkObjects().
std::vector<vtkDataSetMapper*> LineView::contour_mapped [private] |
Definition at line 28 of file LineView.h.
Referenced by CreateNewLine(), DeleteLines(), and DeleteVtkObjects().