#include <manualViewPoint.h>
Public Member Functions | |
manualViewPoint (wxVtkBaseView *wxvtkbaseview) | |
~manualViewPoint () | |
virtual manualViewPoint * | Clone () |
void | CopyAttributesTo (manualViewPoint *cloneObject) |
void | SetSelected (bool selected) |
void | SetPosibleSelected (bool posibleSelected) |
bool | GetSelected () |
bool | GetPosibleSelected () |
void | DeleteVtkObjects () |
vtkActor * | CreateVtkPointActor () |
void | SetPositionXY (double x, double y, double range, double posZ) |
vtkActor * | GetVtkActor () |
void | UpdateColorActor () |
void | UpdateColorActor (double nR, double nG, double nB) |
void | GetSpacing (double spc[3]) |
void | SetSpacing (double spc[3]) |
void | SetWidthLine (double width) |
Protected Attributes | |
double | _spc [3] |
double | _colorNormal_r |
double | _colorNormal_g |
double | _colorNormal_b |
double | _colorPosibleSelected_r |
double | _colorPosibleSelected_g |
double | _colorPosibleSelected_b |
Private Attributes | |
bool | _selected |
bool | _posibleSelected |
vtkPoints * | _pts |
vtkPolyData * | _pd |
vtkActor * | _pointVtkActor |
vtkPolyDataMapper * | _bboxMapper |
wxVtkBaseView * | _wxvtkbaseview |
double | _widthline |
Definition at line 30 of file manualViewPoint.h.
manualViewPoint::manualViewPoint | ( | wxVtkBaseView * | wxvtkbaseview | ) |
Definition at line 4 of file manualViewPoint.cpp.
References _bboxMapper, _colorNormal_b, _colorNormal_g, _colorNormal_r, _colorPosibleSelected_b, _colorPosibleSelected_g, _colorPosibleSelected_r, _pd, _pointVtkActor, _posibleSelected, _pts, _selected, _spc, _widthline, and _wxvtkbaseview.
Referenced by Clone().
00004 { 00005 _selected = false; 00006 _posibleSelected = false; 00007 _pts = NULL; 00008 _pd = NULL; 00009 _pointVtkActor = NULL; 00010 _bboxMapper = NULL; 00011 _wxvtkbaseview = wxvtkbaseview; 00012 _spc[0] = 1; 00013 _spc[1] = 1; 00014 _spc[2] = 1; 00015 _widthline = 1; 00016 00017 //Colors 00018 _colorNormal_r = 1.0; 00019 _colorNormal_g = 0.0; 00020 _colorNormal_b = 0.0; 00021 00022 _colorPosibleSelected_r = 1.0; 00023 _colorPosibleSelected_g = 1.0; 00024 _colorPosibleSelected_b = 0.0; 00025 00026 }
manualViewPoint::~manualViewPoint | ( | ) |
Definition at line 28 of file manualViewPoint.cpp.
References DeleteVtkObjects().
00028 { 00029 DeleteVtkObjects(); 00030 }
manualViewPoint * manualViewPoint::Clone | ( | ) | [virtual] |
Definition at line 34 of file manualViewPoint.cpp.
References _wxvtkbaseview, CopyAttributesTo(), and manualViewPoint().
00035 { 00036 manualViewPoint * clone = new manualViewPoint(_wxvtkbaseview); 00037 CopyAttributesTo(clone); 00038 return clone; 00039 }
void manualViewPoint::CopyAttributesTo | ( | manualViewPoint * | cloneObject | ) |
Definition at line 43 of file manualViewPoint.cpp.
References _posibleSelected, _selected, _spc, _widthline, SetPosibleSelected(), SetSelected(), SetSpacing(), and SetWidthLine().
Referenced by Clone().
00044 { 00045 // Fathers object 00046 cloneObject->SetPosibleSelected(_posibleSelected); 00047 cloneObject->SetSelected(_selected); 00048 cloneObject->SetSpacing(_spc); 00049 cloneObject->SetWidthLine(_widthline); 00050 }
vtkActor * manualViewPoint::CreateVtkPointActor | ( | ) |
Definition at line 90 of file manualViewPoint.cpp.
References _bboxMapper, _pd, _pointVtkActor, _pts, DeleteVtkObjects(), and UpdateColorActor().
Referenced by manualViewBaseContour::AddPoint(), manualViewBaseContour::InsertPoint(), and manualViewPoints::RefreshContour().
00091 { 00092 DeleteVtkObjects(); 00093 00094 _pts = vtkPoints::New(); 00095 _pts->SetNumberOfPoints(8); 00096 00097 _pts->SetPoint(0, -1000 , -1000 , 0 ); 00098 _pts->SetPoint(1, 1000 , -1000 , 0 ); 00099 _pts->SetPoint(2, 1000 , 1000 , 0 ); 00100 _pts->SetPoint(3, -1000 , 1000 , 0 ); 00101 _pts->SetPoint(4, -1000 , 1000 , 0 ); 00102 _pts->SetPoint(5, -1000 , 1000 , 0 ); 00103 _pts->SetPoint(6, -1000 , 1000 , 0 ); 00104 _pts->SetPoint(7, -1000 , 1000 , 0 ); 00105 00106 vtkCellArray *lines = vtkCellArray::New(); 00107 lines->InsertNextCell(17); 00108 lines->InsertCellPoint(0); 00109 lines->InsertCellPoint(1); 00110 lines->InsertCellPoint(2); 00111 lines->InsertCellPoint(3); 00112 lines->InsertCellPoint(0); 00113 lines->InsertCellPoint(4); 00114 lines->InsertCellPoint(5); 00115 lines->InsertCellPoint(6); 00116 lines->InsertCellPoint(7); 00117 lines->InsertCellPoint(4); 00118 lines->InsertCellPoint(0); 00119 lines->InsertCellPoint(3); 00120 lines->InsertCellPoint(7); 00121 lines->InsertCellPoint(6); 00122 lines->InsertCellPoint(2); 00123 lines->InsertCellPoint(1); 00124 lines->InsertCellPoint(5); 00125 00126 _pd = vtkPolyData::New(); 00127 _pd->SetPoints( _pts ); 00128 _pd->SetLines( lines ); 00129 // lines->Delete(); //do not delete lines ?? 00130 00131 _pointVtkActor = vtkActor::New(); 00132 _bboxMapper = vtkPolyDataMapper::New(); 00133 00134 _bboxMapper->SetInput(_pd); 00135 // _bboxMapper->ImmediateModeRenderingOn(); 00136 _pointVtkActor->SetMapper(_bboxMapper); 00137 // _pointVtkActor->GetProperty()->BackfaceCullingOn(); 00138 UpdateColorActor(); 00139 // _pd->ComputeBounds(); 00140 00141 return _pointVtkActor; 00142 }
void manualViewPoint::DeleteVtkObjects | ( | ) |
Definition at line 76 of file manualViewPoint.cpp.
References _bboxMapper, _pd, _pointVtkActor, and _pts.
Referenced by CreateVtkPointActor(), and ~manualViewPoint().
00076 { 00077 if (_pointVtkActor !=NULL) { _pointVtkActor->Delete(); } 00078 if (_bboxMapper !=NULL) { _bboxMapper ->Delete(); } 00079 if (_pts !=NULL) { _pts ->Delete(); } 00080 if (_pd !=NULL) { _pd ->Delete(); } 00081 _pointVtkActor = NULL; 00082 _bboxMapper = NULL; 00083 _pts = NULL; 00084 _pd = NULL; 00085 }
bool manualViewPoint::GetPosibleSelected | ( | ) |
Definition at line 72 of file manualViewPoint.cpp.
References _posibleSelected.
00072 { 00073 return _posibleSelected; 00074 }
bool manualViewPoint::GetSelected | ( | ) |
Definition at line 68 of file manualViewPoint.cpp.
References _selected.
00068 { 00069 return _selected; 00070 }
void manualViewPoint::GetSpacing | ( | double | spc[3] | ) |
vtkActor * manualViewPoint::GetVtkActor | ( | ) |
Definition at line 146 of file manualViewPoint.cpp.
References _pointVtkActor.
Referenced by manualViewBaseContour::DeletePoint(), and manualViewPoints::RefreshContour().
00146 { 00147 return _pointVtkActor; 00148 }
void manualViewPoint::SetPosibleSelected | ( | bool | posibleSelected | ) |
Definition at line 64 of file manualViewPoint.cpp.
References _posibleSelected.
Referenced by CopyAttributesTo().
00064 { 00065 _posibleSelected=posibleSelected; 00066 }
void manualViewPoint::SetPositionXY | ( | double | x, | |
double | y, | |||
double | range, | |||
double | posZ | |||
) |
Definition at line 150 of file manualViewPoint.cpp.
Referenced by manualViewPoints::RefreshContour().
00151 { 00152 double range=i_range; 00153 00154 //EED 27 sep 2006 00155 x = x * _spc[0]; 00156 y = y * _spc[1]; 00157 posZ = posZ * _spc[2]; 00158 00159 if (_pts!=NULL){ 00160 _pts->SetPoint(0, x-range, y+range, posZ-range); 00161 _pts->SetPoint(1, x+range, y+range, posZ-range); 00162 _pts->SetPoint(2, x+range, y-range, posZ-range); 00163 _pts->SetPoint(3, x-range, y-range, posZ-range); 00164 _pts->SetPoint(4, x-range, y+range, posZ+range); 00165 _pts->SetPoint(5, x+range, y+range, posZ+range); 00166 _pts->SetPoint(6, x+range, y-range, posZ+range); 00167 _pts->SetPoint(7, x-range, y-range, posZ+range); 00168 } 00169 }
void manualViewPoint::SetSelected | ( | bool | selected | ) |
Definition at line 60 of file manualViewPoint.cpp.
References _selected.
Referenced by CopyAttributesTo().
00060 { 00061 _selected=selected; 00062 }
void manualViewPoint::SetSpacing | ( | double | spc[3] | ) |
Definition at line 202 of file manualViewPoint.cpp.
References _spc.
Referenced by manualViewBaseContour::AddPoint(), CopyAttributesTo(), and manualViewBaseContour::InsertPoint().
void manualViewPoint::SetWidthLine | ( | double | width | ) |
Definition at line 54 of file manualViewPoint.cpp.
References _widthline.
Referenced by CopyAttributesTo().
00055 { 00056 _widthline = width; 00057 }
void manualViewPoint::UpdateColorActor | ( | double | nR, | |
double | nG, | |||
double | nB | |||
) |
Definition at line 186 of file manualViewPoint.cpp.
References _colorNormal_b, _colorNormal_g, _colorNormal_r, and UpdateColorActor().
00187 { 00188 _colorNormal_r = nR; 00189 _colorNormal_g = nG; 00190 _colorNormal_b = nB; 00191 UpdateColorActor(); 00192 }
void manualViewPoint::UpdateColorActor | ( | ) |
Definition at line 173 of file manualViewPoint.cpp.
References _colorNormal_b, _colorNormal_g, _colorNormal_r, _colorPosibleSelected_b, _colorPosibleSelected_g, _colorPosibleSelected_r, _pointVtkActor, _posibleSelected, and _widthline.
Referenced by CreateVtkPointActor(), and UpdateColorActor().
00174 { 00175 if (_pointVtkActor!=NULL){ 00176 //EED03 00177 _pointVtkActor->GetProperty()->SetLineWidth( _widthline ); 00178 _pointVtkActor->GetProperty()->SetDiffuseColor(_colorNormal_r,_colorNormal_g,_colorNormal_b); 00179 if (_posibleSelected==true){ 00180 _pointVtkActor->GetProperty()->SetDiffuseColor(_colorPosibleSelected_r,_colorPosibleSelected_g,_colorPosibleSelected_b); 00181 } 00182 } 00183 }
vtkPolyDataMapper* manualViewPoint::_bboxMapper [private] |
Definition at line 99 of file manualViewPoint.h.
Referenced by CreateVtkPointActor(), DeleteVtkObjects(), and manualViewPoint().
double manualViewPoint::_colorNormal_b [protected] |
Definition at line 120 of file manualViewPoint.h.
Referenced by manualViewPoint(), and UpdateColorActor().
double manualViewPoint::_colorNormal_g [protected] |
Definition at line 119 of file manualViewPoint.h.
Referenced by manualViewPoint(), and UpdateColorActor().
double manualViewPoint::_colorNormal_r [protected] |
Definition at line 118 of file manualViewPoint.h.
Referenced by manualViewPoint(), and UpdateColorActor().
double manualViewPoint::_colorPosibleSelected_b [protected] |
Definition at line 125 of file manualViewPoint.h.
Referenced by manualViewPoint(), and UpdateColorActor().
double manualViewPoint::_colorPosibleSelected_g [protected] |
Definition at line 124 of file manualViewPoint.h.
Referenced by manualViewPoint(), and UpdateColorActor().
double manualViewPoint::_colorPosibleSelected_r [protected] |
Definition at line 123 of file manualViewPoint.h.
Referenced by manualViewPoint(), and UpdateColorActor().
vtkPolyData* manualViewPoint::_pd [private] |
Definition at line 89 of file manualViewPoint.h.
Referenced by CreateVtkPointActor(), DeleteVtkObjects(), and manualViewPoint().
vtkActor* manualViewPoint::_pointVtkActor [private] |
Definition at line 94 of file manualViewPoint.h.
Referenced by CreateVtkPointActor(), DeleteVtkObjects(), GetVtkActor(), manualViewPoint(), and UpdateColorActor().
bool manualViewPoint::_posibleSelected [private] |
Definition at line 82 of file manualViewPoint.h.
Referenced by CopyAttributesTo(), GetPosibleSelected(), manualViewPoint(), SetPosibleSelected(), and UpdateColorActor().
vtkPoints* manualViewPoint::_pts [private] |
Definition at line 84 of file manualViewPoint.h.
Referenced by CreateVtkPointActor(), DeleteVtkObjects(), manualViewPoint(), and SetPositionXY().
bool manualViewPoint::_selected [private] |
Definition at line 81 of file manualViewPoint.h.
Referenced by CopyAttributesTo(), GetSelected(), manualViewPoint(), and SetSelected().
double manualViewPoint::_spc[3] [protected] |
Definition at line 115 of file manualViewPoint.h.
Referenced by CopyAttributesTo(), GetSpacing(), manualViewPoint(), SetPositionXY(), and SetSpacing().
double manualViewPoint::_widthline [private] |
Definition at line 109 of file manualViewPoint.h.
Referenced by CopyAttributesTo(), manualViewPoint(), SetWidthLine(), and UpdateColorActor().
wxVtkBaseView* manualViewPoint::_wxvtkbaseview [private] |
Definition at line 104 of file manualViewPoint.h.
Referenced by Clone(), and manualViewPoint().