Class that brigde to VTK, override double click... More...
#include <vtk3DSurfaceWidget.h>
Public Member Functions | |
vtk3DSurfaceWidget (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr) | |
~vtk3DSurfaceWidget () | |
void | OnLeftDClick (wxMouseEvent &event) |
virtual void | OnMouseWheel (wxMouseEvent &event) |
void | Render () |
void | ConfigureVTK () |
void | ShowMARACASData (marInterface *mar) |
void | ShowMARACASDataCT (marInterfaceCT *mar) |
void | SetSurfaceColor (float red, float green, float blue) |
void | SetSurfaceVisibility (bool visible) |
void | SetSurfaceIsoValue (int isoval) |
void | SetSurfaceOpacity (int opaval) |
void | GetSphereCenter (double center[3]) |
void | SetAxis (vtkPolyData *axis) |
void | RemoveAxis () |
vtkGetMacro (InitialSphere, int) | |
void | SetInterfaceVtkPanelWidgets (InterfaceVtkPanelWidgets *intVtkPanWid) |
void | SetInitialPoint () |
void | GetLast3DClickPoint (double *pp, double *cp) |
void | InitCameraReset () |
vtkRenderer * | GetRenderer () |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | Initialize () |
void | Enable () |
bool | Enable (bool enable) |
void | Disable () |
void | Start () |
void | UpdateSize (int x, int y) |
int | CreateTimer (int timertype) |
int | DestroyTimer () |
void | TerminateApp () |
void | OnPaint (wxPaintEvent &event) |
void | OnEraseBackground (wxEraseEvent &event) |
void | OnMotion (wxMouseEvent &event) |
void | OnButtonDown (wxMouseEvent &event) |
(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1) | |
void | OnButtonUp (wxMouseEvent &event) |
void | OnEnter (wxMouseEvent &event) |
void | OnLeave (wxMouseEvent &event) |
void | OnKeyDown (wxKeyEvent &event) |
void | OnKeyUp (wxKeyEvent &event) |
void | OnTimer (wxTimerEvent &event) |
void | OnSize (wxSizeEvent &event) |
void | SetRenderWhenDisabled (int newValue) |
vtkGetMacro (Stereo, int) | |
vtkBooleanMacro (Stereo, int) | |
vtkBooleanMacro (UseCaptureMouse, int) | |
virtual void | SetStereo (int capable) |
vtkSetMacro (UseCaptureMouse, int) | |
Static Public Member Functions | |
static wxVTKRenderWindowInteractor * | New () |
Public Attributes | |
vtkImageData * | _marImageData |
vtkPolyData * | _marPolyData |
Protected Member Functions | |
void | SetInitialPoint (float *pickPoint, float *cameraPos) |
void | SetLast3DClickPoint (double *pp, double *cp) |
long | GetHandleHack () |
Protected Attributes | |
marInterface * | _mar |
marInterfaceCT * | _marCT |
vtkRenderer * | _pRenderer |
vtkRenderWindow * | _pRenderWindow |
vtkOutlineFilter * | _outLine |
vtkPolyDataMapper * | _outMapper |
vtkActor * | _outActor |
vtkMarchingCubes * | _mCubes |
vtkPolyDataMapper * | _surfMapper |
vtkActor * | _surfActor |
vtkPolyData * | _centralLine |
vtkPolyDataMapper * | _centralLineMapper |
vtkActor * | _centralLineActor |
vtkSphereSource * | _spheres [4] |
vtkPolyDataMapper * | _spheresMapper [4] |
vtkActor * | _spheresActor [4] |
vtkPolyDataMapper * | _axesMapper |
vtkActor * | _axesActor |
double | _range [2] |
InterfaceVtkPanelWidgets * | _intVtkPanWid |
wxTimer | timer |
int | ActiveButton |
int | RenderAllowed |
int | Stereo |
Private Member Functions | |
DECLARE_EVENT_TABLE () | |
Private Attributes | |
int | _width |
int | _height |
int | _depth |
int | InitialSphere |
float | _lastPickPoint [3] |
float | _lastCameraPos [3] |
Class that brigde to VTK, override double click...
Definition at line 48 of file vtk3DSurfaceWidget.h.
vtk3DSurfaceWidget::vtk3DSurfaceWidget | ( | wxWindow * | parent, | |
wxWindowID | id, | |||
const wxPoint & | pos = wxDefaultPosition , |
|||
const wxSize & | size = wxDefaultSize , |
|||
long | style = 0 , |
|||
const wxString & | name = wxPanelNameStr | |||
) |
Definition at line 49 of file vtk3DSurfaceWidget.cxx.
References vtkInteractorStyle3DMaracas::New().
00052 : wxVTKRenderWindowInteractor( parent, id, pos, size, style, name ) 00053 { 00054 //make current interactor style be trackbal camera, asked by radiologists. 00055 00056 /* 00057 vtkInteractorStyleSwitch *iss = dynamic_cast<vtkInteractorStyleSwitch*>(this->GetInteractorStyle()); 00058 iss->SetCurrentStyleToTrackballCamera(); 00059 */ 00060 00061 00062 vtkInteractorStyle3DMaracas *interactorStyle3DMaracas = vtkInteractorStyle3DMaracas::New(); 00063 // interactorStyle3DMaracas->SetInteractor (this); 00064 this->SetInteractorStyle(interactorStyle3DMaracas); 00065 00066 00067 _pRenderer = vtkRenderer::New( ); 00068 InitialSphere = 0; 00069 _centralLine = NULL; 00070 _centralLineMapper = NULL; 00071 _centralLineActor = NULL; 00072 _axesMapper = NULL; 00073 _axesActor = NULL; 00074 for(int i=0; i<4; i++) { 00075 _spheres[ i ] = NULL; 00076 _spheresMapper[ i ] = NULL; 00077 _spheresActor[ i ] = NULL; 00078 } 00079 _axesActor = NULL; 00080 _axesMapper = NULL; 00081 _surfActor = NULL; 00082 _surfMapper = NULL; 00083 _intVtkPanWid = NULL; 00084 _outActor = NULL; 00085 _outMapper = NULL; 00086 _outLine = NULL; 00087 _mCubes = NULL; 00088 }
vtk3DSurfaceWidget::~vtk3DSurfaceWidget | ( | ) |
Definition at line 90 of file vtk3DSurfaceWidget.cxx.
References _axesActor, _axesMapper, _centralLine, _centralLineActor, _centralLineMapper, _mCubes, _outActor, _outLine, _outMapper, _pRenderer, _spheres, _spheresActor, _spheresMapper, _surfActor, and _surfMapper.
00090 { 00091 00092 //good luck: 00093 if( _outActor ) _outActor -> Delete( ); 00094 if( _outMapper ) _outMapper -> Delete( ); 00095 if( _outLine ) _outLine -> Delete( ); 00096 if( _surfActor ) _surfActor -> Delete( ); 00097 if( _surfMapper ) _surfMapper -> Delete( ); 00098 if( _mCubes ) _mCubes -> Delete( ); 00099 if( _centralLine ) _centralLine -> Delete( ); 00100 if( _centralLineMapper ) _centralLineMapper -> Delete( ); 00101 if( _centralLineActor ) _centralLineActor -> Delete( ); 00102 if( _axesActor ) _axesActor -> Delete(); 00103 if( _axesMapper ) _axesMapper -> Delete(); 00104 for(int i=0; i<4; i++) 00105 { 00106 if( _spheres[ i ] ) _spheres[ i ] ->Delete( ); 00107 if( _spheresMapper[ i ] ) _spheresMapper[ i ] ->Delete( ); 00108 if( _spheresActor[ i ] ) _spheresActor[ i ] ->Delete( ); 00109 } 00110 if( _pRenderer ) _pRenderer -> Delete( ); 00111 }
void vtk3DSurfaceWidget::ConfigureVTK | ( | ) |
Definition at line 488 of file vtk3DSurfaceWidget.cxx.
References _pRenderer, and _pRenderWindow.
Referenced by wxSurfaceWidget::ShowMARACASData(), vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxe(), and vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxeCT().
00489 { 00490 // get render window 00491 _pRenderWindow = this->GetRenderWindow( ); 00492 00493 // connect renderer and render window and configure render window 00494 _pRenderWindow->AddRenderer( _pRenderer ); 00495 00496 // configure renderer 00497 _pRenderer->SetBackground( 0.0, 0.0, 0.0 ); 00498 //_pRenderer->SetBackground( 1, 1, 0); //FIXME 00499 _pRenderer->GetActiveCamera( )->Zoom( 1.0 ); 00500 _pRenderer->GetActiveCamera( )->SetClippingRange( 1, 1000 ); 00501 _pRenderer->ResetCamera( ); 00502 00503 //EED 22Mai2007 00504 // AttachRenderWindow(); 00505 00506 }
int wxVTKRenderWindowInteractor::CreateTimer | ( | int | timertype | ) | [inherited] |
vtk3DSurfaceWidget::DECLARE_EVENT_TABLE | ( | ) | [private] |
int wxVTKRenderWindowInteractor::DestroyTimer | ( | ) | [inherited] |
Definition at line 267 of file wxVTKRenderWindowInteractor.cxx.
void wxVTKRenderWindowInteractor::Disable | ( | ) | [inherited] |
Definition at line 223 of file wxVTKRenderWindowInteractor.cxx.
bool wxVTKRenderWindowInteractor::Enable | ( | bool | enable | ) | [inherited] |
Definition at line 214 of file wxVTKRenderWindowInteractor.cxx.
References wxVTKRenderWindowInteractor::Enable().
00215 { 00216 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) 00217 return wxGLCanvas::Enable(enable); 00218 #else 00219 return wxWindow::Enable(enable); 00220 #endif 00221 }
void wxVTKRenderWindowInteractor::Enable | ( | ) | [inherited] |
Definition at line 200 of file wxVTKRenderWindowInteractor.cxx.
Referenced by wxVTKRenderWindowInteractor::Enable(), and wxVTKRenderWindowInteractor::Initialize().
00201 { 00202 // if already enabled then done 00203 if (Enabled) 00204 return; 00205 00206 // that's it 00207 Enabled = 1; 00208 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) 00209 SetCurrent(); 00210 #endif 00211 Modified(); 00212 }
long wxVTKRenderWindowInteractor::GetHandleHack | ( | ) | [protected, inherited] |
Definition at line 296 of file wxVTKRenderWindowInteractor.cxx.
Referenced by wxVTKRenderWindowInteractor::Render().
00297 { 00298 //helper function to hide the MSW vs GTK stuff 00299 long handle_tmp = 0; 00300 00301 // __WXMSW__ is for Win32 00302 //__WXMAX__ stands for using Carbon C-headers, using either the CarbonLib/CFM or the native Mach-O builds (which then also use the latest features available) 00303 // __WXGTK__ is for both gtk 1.2.x and gtk 2.x 00304 #if defined(__WXMSW__) || defined(__WXMAC__) 00305 handle_tmp = (long)this->GetHandle(); 00306 #endif //__WXMSW__ 00307 00308 //__WXCOCOA__ stands for using the objective-c Cocoa API 00309 #ifdef __WXCOCOA__ 00310 // Here is how to find the NSWindow 00311 wxTopLevelWindow* toplevel = dynamic_cast<wxTopLevelWindow*>( 00312 wxGetTopLevelParent( this ) ); 00313 if (toplevel != NULL ) 00314 { 00315 handle_tmp = (long)toplevel->GetNSWindow(); 00316 } 00317 // The NSView will be deducted from 00318 // [(NSWindow*)Handle contentView] 00319 // if only I knew how to write that in c++ 00320 #endif //__WXCOCOA__ 00321 00322 // Find and return the actual X-Window. 00323 #if defined(__WXGTK__) || defined(__WXX11__) 00324 return (long)GetXWindow(this); 00325 #endif 00326 00327 //#ifdef __WXMOTIF__ 00328 // handle_tmp = (long)this->GetXWindow(); 00329 //#endif 00330 00331 return handle_tmp; 00332 }
void vtk3DSurfaceWidget::GetLast3DClickPoint | ( | double * | pp, | |
double * | cp | |||
) |
Definition at line 135 of file vtk3DSurfaceWidget.cxx.
References _lastCameraPos, and _lastPickPoint.
Referenced by wxQuantificationWidgetCT::CallBackOnLeftDClick(), and wxQuantificationWidget::CallBackOnLeftDClick().
00135 { 00136 pp[0]=_lastPickPoint[0]; 00137 pp[1]=_lastPickPoint[1]; 00138 pp[2]=_lastPickPoint[2]; 00139 cp[0]=_lastCameraPos[0]; 00140 cp[1]=_lastCameraPos[1]; 00141 cp[2]=_lastCameraPos[2]; 00142 }
vtkRenderer * vtk3DSurfaceWidget::GetRenderer | ( | ) |
Definition at line 510 of file vtk3DSurfaceWidget.cxx.
References _pRenderer.
Referenced by wxPathologyWidget_01::ConfigureMPR(), wxPathologyWidget_01::ConfigureSTL(), wxEmptyPanelWidget_2::ConfigureVTK(), wxEmptyPanelWidget_2::ExtractTree1_JF(), wxEmptyPanelWidget_2::ExtractTree2_JF(), wxPathologyWidget_01::OnBtnExtractAxis(), wxPathologyWidget_01::OnBtnExtractPat(), wxPathologyWidget_01::OnBtnSetP1(), wxPathologyWidget_01::OnBtnSetP2(), wxPathologyWidget_01::OnBtnSetPat(), wxEmptyPanelWidget_2::PaintVascularTree_MH_JFC(), wxEmptyPanelWidget_2::PaintVascularVolume_MH_JFC(), wxEmptyPanelWidget_2::ResetTree1_JF(), wxEmptyPanelWidget_2::ResetTree2_JF(), and wxEmptyPanelWidget_2::ResetTree_MH_JFC().
00510 { 00511 return _pRenderer; 00512 }
void vtk3DSurfaceWidget::GetSphereCenter | ( | double | center[3] | ) |
Definition at line 190 of file vtk3DSurfaceWidget.cxx.
References _spheres.
Referenced by wxEmptyPanelWidget_2::OnBtnExtractTree1_JF(), wxEmptyPanelWidget_2::OnBtnExtractTree2_JF(), wxEmptyPanelWidget_2::OnBtnExtractTree_MH_JFC(), wxPathologyWidget_01::OnBtnSetP1(), wxPathologyWidget_01::OnBtnSetP2(), and wxSurfaceWidget::OnExtractAxis().
00191 { 00192 _spheres[ 3 ]->GetCenter( center ); 00193 }
void vtk3DSurfaceWidget::InitCameraReset | ( | ) |
Definition at line 157 of file vtk3DSurfaceWidget.cxx.
References _pRenderer.
Referenced by wxSurfaceWidget::ShowMARACASData(), wxQuantificationWidgetCT::ShowMARACASData(), and wxQuantificationWidget::ShowMARACASData().
00157 { 00158 _pRenderer->ResetCameraClippingRange(); 00159 vtkCamera *cam=_pRenderer->GetActiveCamera(); 00160 cam->Zoom(1.8); 00161 // EED 31 Mai 2007 00162 // Render(); 00163 }
void wxVTKRenderWindowInteractor::Initialize | ( | ) | [inherited] |
Definition at line 185 of file wxVTKRenderWindowInteractor.cxx.
References wxVTKRenderWindowInteractor::Enable().
00186 { 00187 int *size = RenderWindow->GetSize(); 00188 // enable everything and start rendering 00189 Enable(); 00190 //RenderWindow->Start(); 00191 00192 // set the size in the render window interactor 00193 Size[0] = size[0]; 00194 Size[1] = size[1]; 00195 00196 // this is initialized 00197 Initialized = 1; 00198 }
wxVTKRenderWindowInteractor * wxVTKRenderWindowInteractor::New | ( | ) | [static, inherited] |
Reimplemented in wxVTKRenderWindowInteractorPlus.
Definition at line 179 of file wxVTKRenderWindowInteractor.cxx.
Referenced by vtk3DSurfaceSTLWidget::ConstructVessel(), vtk3DSurfaceSTLWidget::ConvertMarAxisToPolyData(), vtk3DSurfaceSTLWidget::ExportSurfaceAsSTL(), vtk3DSurfaceSTLWidget::GetPointAndNormalIntersection(), OnLeftDClick(), vtk3DQuantSurfaceWidget::Set3DSliceActor(), SetAxis(), vtk3DSurfaceSTLWidget::SetAxis(), vtk3DSurfaceSTLWidget::SetCuttingMode(), SetInitialPoint(), vtk3DSurfaceSTLWidget::SetInitialPoint(), ShowMARACASData(), vtk3DSurfaceSTLWidget::ShowMARACASData(), vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxe(), vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxeCT(), and ShowMARACASDataCT().
00180 { 00181 // we don't make use of the objectfactory, because we're not registered 00182 return new wxVTKRenderWindowInteractor; 00183 }
void wxVTKRenderWindowInteractor::OnButtonDown | ( | wxMouseEvent & | event | ) | [inherited] |
(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
Reimplemented in wxVTKRenderWindowInteractorEditContour.
Definition at line 541 of file wxVTKRenderWindowInteractor.cxx.
References wxVTKRenderWindowInteractor::ActiveButton, wxVTKRenderWindowInteractor::UseCaptureMouse, and WX_USE_X_CAPTURE.
00542 { 00543 if (!Enabled || (ActiveButton != wxEVT_NULL)) 00544 { 00545 return; 00546 } 00547 ActiveButton = event.GetEventType(); 00548 00549 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00550 SetEventInformationFlipY(event.GetX(), event.GetY(), 00551 event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); 00552 #endif 00553 00554 if(event.RightDown()) 00555 { 00556 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00557 // new style 00558 InvokeEvent(vtkCommand::RightButtonPressEvent, NULL); 00559 #else 00560 // old style 00561 InteractorStyle->OnRightButtonDown(event.ControlDown(), event.ShiftDown(), 00562 event.GetX(), Size[1] - event.GetY() - 1); 00563 #endif 00564 } 00565 else if(event.LeftDown()) 00566 { 00567 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00568 // new style 00569 InvokeEvent(vtkCommand::LeftButtonPressEvent, NULL); 00570 #else 00571 // old style 00572 InteractorStyle->OnLeftButtonDown(event.ControlDown(), event.ShiftDown(), 00573 event.GetX(), Size[1] - event.GetY() - 1); 00574 #endif 00575 } 00576 else if(event.MiddleDown()) 00577 { 00578 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00579 // new style 00580 InvokeEvent(vtkCommand::MiddleButtonPressEvent, NULL); 00581 #else 00582 // old style 00583 InteractorStyle->OnMiddleButtonDown(event.ControlDown(), event.ShiftDown(), 00584 event.GetX(), Size[1] - event.GetY() - 1); 00585 #endif 00586 } 00587 //save the button and capture mouse until the button is released 00588 //Only if : 00589 //1. it is possible (WX_USE_X_CAPTURE) 00590 //2. user decided to. 00591 if ((ActiveButton != wxEVT_NULL) && WX_USE_X_CAPTURE && UseCaptureMouse) 00592 { 00593 CaptureMouse(); 00594 } 00595 }
void wxVTKRenderWindowInteractor::OnButtonUp | ( | wxMouseEvent & | event | ) | [inherited] |
Reimplemented in wxVTKRenderWindowInteractorEditContour.
Definition at line 597 of file wxVTKRenderWindowInteractor.cxx.
References wxVTKRenderWindowInteractor::ActiveButton, wxVTKRenderWindowInteractor::UseCaptureMouse, and WX_USE_X_CAPTURE.
00598 { 00599 //EVT_xxx_DOWN == EVT_xxx_UP - 1 00600 //This is only needed if two mouse buttons are pressed at the same time. 00601 //In wxWindows 2.4 and later: better use of wxMOUSE_BTN_RIGHT or 00602 //wxEVT_COMMAND_RIGHT_CLICK 00603 if (!Enabled || (ActiveButton != (event.GetEventType()-1))) 00604 { 00605 return; 00606 } 00607 00608 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00609 SetEventInformationFlipY(event.GetX(), event.GetY(), 00610 event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); 00611 #endif 00612 00613 if(ActiveButton == wxEVT_RIGHT_DOWN) 00614 { 00615 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00616 // new style 00617 InvokeEvent(vtkCommand::RightButtonReleaseEvent, NULL); 00618 #else 00619 // old style 00620 InteractorStyle->OnRightButtonUp(event.ControlDown(), event.ShiftDown(), 00621 event.GetX(), Size[1] - event.GetY() - 1); 00622 #endif 00623 } 00624 else if(ActiveButton == wxEVT_LEFT_DOWN) 00625 { 00626 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00627 // new style 00628 InvokeEvent(vtkCommand::LeftButtonReleaseEvent, NULL); 00629 #else 00630 // old style 00631 InteractorStyle->OnLeftButtonUp(event.ControlDown(), event.ShiftDown(), 00632 event.GetX(), Size[1] - event.GetY() - 1); 00633 #endif 00634 } 00635 else if(ActiveButton == wxEVT_MIDDLE_DOWN) 00636 { 00637 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00638 // new style 00639 InvokeEvent(vtkCommand::MiddleButtonReleaseEvent, NULL); 00640 #else 00641 // old style 00642 InteractorStyle->OnMiddleButtonUp(event.ControlDown(), event.ShiftDown(), 00643 event.GetX(), Size[1] - event.GetY() - 1); 00644 #endif 00645 } 00646 //if the ActiveButton is realeased, then release mouse capture 00647 if ((ActiveButton != wxEVT_NULL) && WX_USE_X_CAPTURE && UseCaptureMouse) 00648 { 00649 ReleaseMouse(); 00650 } 00651 ActiveButton = wxEVT_NULL; 00652 }
void wxVTKRenderWindowInteractor::OnEnter | ( | wxMouseEvent & | event | ) | [inherited] |
Definition at line 406 of file wxVTKRenderWindowInteractor.cxx.
00407 { 00408 SetFocus(); 00409 if (!Enabled) 00410 { 00411 return; 00412 } 00413 00414 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00415 // new style 00416 SetEventInformationFlipY(event.GetX(), event.GetY(), 00417 event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); 00418 00419 InvokeEvent(vtkCommand::EnterEvent, NULL); 00420 #else 00421 // old style 00422 InteractorStyle->OnEnter(event.ControlDown(), event.ShiftDown(), 00423 event.GetX(), Size[1] - event.GetY() - 1); 00424 #endif 00425 }
void wxVTKRenderWindowInteractor::OnEraseBackground | ( | wxEraseEvent & | event | ) | [inherited] |
Definition at line 362 of file wxVTKRenderWindowInteractor.cxx.
void wxVTKRenderWindowInteractor::OnKeyDown | ( | wxKeyEvent & | event | ) | [inherited] |
Reimplemented in wxVTKRenderWindowInteractorEditContour.
Definition at line 447 of file wxVTKRenderWindowInteractor.cxx.
00448 { 00449 if (!Enabled) 00450 { 00451 return; 00452 } 00453 00454 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00455 // new style 00456 int keycode = event.GetKeyCode(); 00457 00458 00459 char key = '\0'; 00460 if ( keycode < 256 ) 00461 { 00462 // TODO: Unicode in non-Unicode mode ?? 00463 key = (char)keycode; 00464 } 00465 else//Dic 2007 00466 { 00467 if ( keycode==314 )//Real keyCode for Left ARROW and non-Unicode 00468 { 00469 key = 'L';//Left 00470 } 00471 else if( keycode==315 )//Real keyCode for Left ARROW and non-Unicode 00472 { 00473 key = 'U';//Up 00474 } 00475 else if( keycode==316 )//Real keyCode for Left ARROW and non-Unicode 00476 { 00477 key = 'R';//Right 00478 } 00479 else if( keycode==317 )//Real keyCode for Down ARROW and non-Unicode 00480 { 00481 key = 'D';//Down 00482 } 00483 else if( keycode==312 )//Real keyCode for Diagonal left down ARROW and non-Unicode 00484 { 00485 key = 'W';//Diagonal left down 00486 } 00487 else if( keycode==313 )//Real keyCode for Diagonal left up ARROW and non-Unicode 00488 { 00489 key = 'Q';//Diagonal left up 00490 } 00491 else if( keycode==366 )//Real keyCode for Diagonal right up ARROW and non-Unicode 00492 { 00493 key = 'P';//Diagonal right up 00494 } 00495 else if( keycode==367 )//Real keyCode for Diagonal right down ARROW and non-Unicode 00496 { 00497 key = 'M';//Diagonal right down 00498 } 00499 } 00500 00501 SetEventInformationFlipY(event.GetX(), event.GetY(), 00502 event.ControlDown(), event.ShiftDown(), key, 0, NULL); 00503 00504 InvokeEvent(vtkCommand::KeyPressEvent, NULL); 00505 InvokeEvent(vtkCommand::CharEvent, NULL); 00506 #else 00507 InteractorStyle->OnKeyDown(event.ControlDown(), event.ShiftDown(), 00508 event.GetKeyCode(), 1); 00509 #endif 00510 event.Skip(); 00511 }
void wxVTKRenderWindowInteractor::OnKeyUp | ( | wxKeyEvent & | event | ) | [inherited] |
Definition at line 513 of file wxVTKRenderWindowInteractor.cxx.
00514 { 00515 if (!Enabled) 00516 { 00517 return; 00518 } 00519 00520 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00521 // new style 00522 int keycode = event.GetKeyCode(); 00523 char key = '\0'; 00524 if (keycode < 256) 00525 { 00526 // TODO: Unicode in non-Unicode mode ?? 00527 key = (char)keycode; 00528 } 00529 00530 SetEventInformationFlipY(event.GetX(), event.GetY(), 00531 event.ControlDown(), event.ShiftDown(), key, 0, NULL); 00532 InvokeEvent(vtkCommand::KeyReleaseEvent, NULL); 00533 #else 00534 InteractorStyle->OnKeyUp(event.ControlDown(), event.ShiftDown(), 00535 event.GetKeyCode(), 1); 00536 #endif 00537 event.Skip(); 00538 }
void wxVTKRenderWindowInteractor::OnLeave | ( | wxMouseEvent & | event | ) | [inherited] |
Definition at line 427 of file wxVTKRenderWindowInteractor.cxx.
00428 { 00429 if (!Enabled) 00430 { 00431 return; 00432 } 00433 00434 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00435 // new style 00436 SetEventInformationFlipY(event.GetX(), event.GetY(), 00437 event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); 00438 00439 InvokeEvent(vtkCommand::LeaveEvent, NULL); 00440 #else 00441 // old style 00442 InteractorStyle->OnLeave(event.ControlDown(), event.ShiftDown(), 00443 event.GetX(), Size[1] - event.GetY() - 1); 00444 #endif 00445 }
void vtk3DSurfaceWidget::OnLeftDClick | ( | wxMouseEvent & | event | ) |
Definition at line 121 of file vtk3DSurfaceWidget.cxx.
References _intVtkPanWid, _pRenderer, InterfaceVtkPanelWidgets::CallBackOnLeftDClick(), wxVTKRenderWindowInteractor::New(), and SetLast3DClickPoint().
00121 { 00122 double pp[ 3 ], cp[ 3 ]; 00123 int eventrwi[2]; 00124 vtkPointPicker* picker = vtkPointPicker::New( ); 00125 this->GetEventPosition( eventrwi ); 00126 picker->Pick( eventrwi[0], eventrwi[1], 0.0, _pRenderer ); 00127 _pRenderer->GetActiveCamera( )->GetPosition( cp ); 00128 picker->GetPickPosition( pp ); 00129 00130 picker->Delete( ); 00131 this->SetLast3DClickPoint( pp, cp ); 00132 if (_intVtkPanWid!=NULL) { _intVtkPanWid->CallBackOnLeftDClick(event); } 00133 }
void wxVTKRenderWindowInteractor::OnMotion | ( | wxMouseEvent & | event | ) | [inherited] |
Reimplemented in wxVTKRenderWindowInteractorEditContour.
Definition at line 387 of file wxVTKRenderWindowInteractor.cxx.
00388 { 00389 if (!Enabled) 00390 { 00391 return; 00392 } 00393 00394 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) 00395 SetEventInformationFlipY(event.GetX(), event.GetY(), 00396 event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); 00397 00398 InvokeEvent(vtkCommand::MouseMoveEvent, NULL); 00399 #else 00400 InteractorStyle->OnMouseMove(event.ControlDown(), event.ShiftDown(), 00401 event.GetX(), Size[1] - event.GetY() - 1); 00402 #endif 00403 }
void vtk3DSurfaceWidget::OnMouseWheel | ( | wxMouseEvent & | event | ) | [virtual] |
Reimplemented from wxVTKRenderWindowInteractor.
Definition at line 117 of file vtk3DSurfaceWidget.cxx.
References _intVtkPanWid, and InterfaceVtkPanelWidgets::CallBackOnMouseWheel().
00117 { 00118 if (_intVtkPanWid!=NULL) { _intVtkPanWid->CallBackOnMouseWheel(event);} 00119 }
void wxVTKRenderWindowInteractor::OnPaint | ( | wxPaintEvent & | event | ) | [inherited] |
void wxVTKRenderWindowInteractor::OnSize | ( | wxSizeEvent & | event | ) | [inherited] |
void wxVTKRenderWindowInteractor::OnTimer | ( | wxTimerEvent & | event | ) | [inherited] |
void wxVTKRenderWindowInteractor::PrintSelf | ( | ostream & | os, | |
vtkIndent | indent | |||
) | [inherited] |
Definition at line 762 of file wxVTKRenderWindowInteractor.cxx.
00763 { 00764 this->Superclass::PrintSelf(os, indent); 00765 }
void vtk3DSurfaceWidget::RemoveAxis | ( | ) |
Definition at line 213 of file vtk3DSurfaceWidget.cxx.
References _axesActor, _pRenderer, and _pRenderWindow.
Referenced by wxSurfaceWidget::Clean3D(), wxQuantificationWidgetCT::Clean3D(), and wxQuantificationWidget::Clean3D().
00214 { 00215 if (_axesActor) 00216 { 00217 _pRenderer->RemoveActor(_axesActor); 00218 _axesActor->Delete(); 00219 _axesActor = NULL; 00220 _pRenderWindow->Render( ); 00221 } 00222 }
void vtk3DSurfaceWidget::Render | ( | ) |
Reimplemented from wxVTKRenderWindowInteractor.
Definition at line 153 of file vtk3DSurfaceWidget.cxx.
References _pRenderWindow.
Referenced by wxPathologyWidget_01::Refresh(), wxEmptyPanelWidget_2::Refresh(), wxSurfaceWidget::RefreshAxis(), wxQuantificationWidgetCT::RefreshAxis(), and wxQuantificationWidget::RefreshAxis().
00153 { 00154 _pRenderWindow->Render(); 00155 }
void vtk3DSurfaceWidget::SetAxis | ( | vtkPolyData * | axis | ) |
Definition at line 195 of file vtk3DSurfaceWidget.cxx.
References _axesActor, _axesMapper, _pRenderer, and wxVTKRenderWindowInteractor::New().
Referenced by wxSurfaceWidget::AddAxisActors(), wxQuantificationWidgetCT::AddAxisActors(), wxQuantificationWidget::AddAxisActors(), vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxe(), and vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxeCT().
00196 { 00197 _axesMapper = vtkPolyDataMapper::New( ); 00198 _axesMapper->SetInput( axis ); 00199 _axesMapper->Update(); 00200 //axis->Delete(); 00201 00202 _axesActor = vtkActor::New( ); 00203 _axesActor->SetMapper( _axesMapper ); 00204 _axesActor->GetProperty()->SetColor( 1, 0, 0 ); 00205 _axesActor->GetProperty()->SetLineWidth( 2.0 ); 00206 _pRenderer->AddActor( _axesActor ); 00207 00208 //Generate a new vtkwindow ??? 00209 //EED 31 Mai 2007 00210 // _pRenderWindow->Render( ); 00211 }
void vtk3DSurfaceWidget::SetInitialPoint | ( | float * | pickPoint, | |
float * | cameraPos | |||
) | [protected] |
Definition at line 334 of file vtk3DSurfaceWidget.cxx.
References _centralLine, _centralLineActor, _centralLineMapper, _depth, marInterface::_experiment, _height, _mar, _mCubes, _pRenderer, _pRenderWindow, _spheres, _spheresActor, _spheresMapper, _width, UtilVtk3DGeometriSelection::FindCubePointsFromPoints(), gtm::TVector< T >::GetAnsiRef(), marObject::getParameters(), UtilVtk3DGeometriSelection::GetPointAndNormalIntersection(), marDictionary::GetString(), GTM_MAX, InitialSphere, wxVTKRenderWindowInteractor::New(), UtilVtk3DGeometriSelection::SetDimentions(), UtilVtk3DGeometriSelection::SetMarchingCube(), marParameters::setROIStep(), and marExperiment::setStartPoint().
00334 { 00335 marDictionary marDict; 00336 char ttmp[256]; 00337 00338 gtm::TVector< double > pO( 3 ), pF( 3 ), pp( 3 ), cp( 3 ); 00339 gtm::TVector< double > xc( 3 ); 00340 gtm::TVector< double > x1( 3 ), n1( 3 ); 00341 gtm::TVector< double > x2( 3 ), n2( 3 ); 00342 gtm::TVector< double > tmp( 3 ); 00343 double fac; 00344 bool success = true; 00345 int notSuccessType = 0; 00346 00347 if( _centralLineActor ) 00348 { 00349 _pRenderer->RemoveActor( _centralLineActor ); 00350 _centralLineActor->Delete( ); 00351 } // fi 00352 if( _centralLineMapper ) _centralLineMapper->Delete( ); 00353 if( _centralLine ) _centralLine->Delete( ); 00354 00355 _centralLine = NULL; 00356 _centralLineMapper = NULL; 00357 _centralLineActor = NULL; 00358 00359 for(int i=0; i<4; i++) 00360 { 00361 if( _spheresActor[ i ] ) 00362 { 00363 _pRenderer->RemoveActor( _spheresActor[ i ] ); 00364 _spheresActor[ i ]->Delete( ); 00365 } // fi 00366 if( _spheresMapper[ i ] ) _spheresMapper[ i ]->Delete( ); 00367 if( _spheres[ i ] ) _spheres[ i ]->Delete( ); 00368 _spheres[ i ] = NULL; 00369 _spheresMapper[ i ] = NULL; 00370 _spheresActor[ i ] = NULL; 00371 } //rof 00372 00373 fac = GTM_MAX( _width, _height ); 00374 fac = 2 * GTM_MAX( fac, _depth ); 00375 pp( 0 ) = pickPoint[ 0 ]; pp( 1 ) = pickPoint[ 1 ]; pp( 2 ) = pickPoint[ 2 ]; 00376 cp( 0 ) = cameraPos[ 0 ]; cp( 1 ) = cameraPos[ 1 ]; cp( 2 ) = cameraPos[ 2 ]; 00377 00378 00379 UtilVtk3DGeometriSelection utilVtk3DGeometriSelection; 00380 utilVtk3DGeometriSelection.SetDimentions(_width,_height,_depth); 00381 utilVtk3DGeometriSelection.SetMarchingCube(_mCubes); 00382 00383 if( utilVtk3DGeometriSelection.FindCubePointsFromPoints( 00384 pO.GetAnsiRef( ), pF.GetAnsiRef( ), 00385 pp.GetAnsiRef( ), cp.GetAnsiRef( ) 00386 ) ) { 00387 00388 if( utilVtk3DGeometriSelection.GetPointAndNormalIntersection( 00389 x1.GetAnsiRef( ), n1.GetAnsiRef( ), 00390 pO.GetAnsiRef( ), pF.GetAnsiRef( ) 00391 ) ) { 00392 00393 if( utilVtk3DGeometriSelection.GetPointAndNormalIntersection( 00394 x2.GetAnsiRef( ), n2.GetAnsiRef( ), 00395 ( x1 - n1 ).GetAnsiRef( ), ( x1 - ( n1 * fac ) ).GetAnsiRef( ) 00396 ) ) { 00397 00398 xc = ( x2 + x1 ) * 0.5; 00399 00400 00401 double dd=12; // EED ****** ATENTION **************** 00402 00403 if (!( 00404 (xc(0)<dd) || (xc(1)<dd) || (xc(2)<dd) || 00405 (fabs(xc(0)-_width)<dd) || (fabs(xc(1)-_height)<dd) || (fabs(xc(2)-_depth)<dd) 00406 )){ 00407 00408 _mar->_experiment->setStartPoint( (int)xc( 0 ), (int)xc( 1 ), (int)xc( 2 ) ); 00409 _mar->_experiment->getParameters( )->setROIStep( 2*( xc - x1 ).GetNorm( ) ); 00410 00411 for(int i=0; i<4; i++) 00412 { 00413 _spheres[ i ] = vtkSphereSource::New( ); 00414 _spheresMapper[ i ] = vtkPolyDataMapper::New( ); 00415 _spheresMapper[ i ]->SetInput( _spheres[ i ]->GetOutput( ) ); 00416 _spheresActor[ i ] = vtkActor::New( ); 00417 _spheresActor[ i ]->SetMapper( _spheresMapper[ i ] ); 00418 _spheresActor[ i ]->PickableOff( ); 00419 _pRenderer->AddActor( _spheresActor[ i ] ); 00420 } 00421 00422 _spheres[ 0 ]->SetCenter( x1( 0 ), x1( 1 ), x1( 2 ) ); 00423 _spheres[ 1 ]->SetCenter( x2( 0 ), x2( 1 ), x2( 2 ) ); 00424 _spheres[ 2 ]->SetCenter( xc( 0 ), xc( 1 ), xc( 2 ) ); 00425 _spheres[ 3 ]->SetCenter( xc( 0 ), xc( 1 ), xc( 2 ) ); 00426 00427 _spheres[ 0 ]->SetRadius( 0.5 ); 00428 _spheres[ 1 ]->SetRadius( 0.5 ); 00429 _spheres[ 2 ]->SetRadius( 0.5 ); 00430 _spheres[ 3 ]->SetRadius( ( xc - x1 ).GetNorm( ) ); 00431 00432 _spheresActor[ 0 ]->GetProperty( )->SetColor( 1.0, 0.0, 0.0 ); 00433 _spheresActor[ 1 ]->GetProperty( )->SetColor( 0.0, 1.0, 0.0 ); 00434 _spheresActor[ 2 ]->GetProperty( )->SetColor( 0.0, 0.0, 1.0 ); 00435 _spheresActor[ 3 ]->GetProperty( )->SetColor( 1.0, 0.0, 0.0 ); 00436 _spheresActor[ 3 ]->GetProperty( )->SetOpacity( 0.3 ); 00437 00438 vtkPoints* points = vtkPoints::New( ); 00439 points->InsertNextPoint( x1.GetAnsiRef( ) ); 00440 points->InsertNextPoint( x2.GetAnsiRef( ) ); 00441 00442 vtkCellArray* array = vtkCellArray::New( ); 00443 array->InsertNextCell( 2 ); 00444 array->InsertCellPoint( 0 ); 00445 array->InsertCellPoint( 1 ); 00446 00447 _centralLine = vtkPolyData::New( ); 00448 _centralLine->SetPoints( points ); 00449 _centralLine->SetLines( array ); 00450 points->Delete(); 00451 array->Delete(); 00452 00453 _centralLineMapper = vtkPolyDataMapper::New( ); 00454 _centralLineMapper->SetInput( _centralLine ); 00455 00456 _centralLineActor = vtkActor::New( ); 00457 _centralLineActor->SetMapper( _centralLineMapper ); 00458 _centralLineActor->GetProperty( )->SetColor( 1.0, 1.0, 1.0 ); 00459 _centralLineActor->PickableOff( ); 00460 _pRenderer->AddActor( _centralLineActor ); 00461 00462 00463 } else {success = false; notSuccessType=1; } 00464 00465 } // fi 00466 00467 } else success = false; 00468 00469 } else success = false; 00470 00471 // Show a message, if any. 00472 if (( !success ) && (notSuccessType==0)) { 00473 strcpy( ttmp , marDict.GetString(905) ); strcat( ttmp , "\n \n" ); strcat( ttmp , marDict.GetString(910) ); 00474 wxMessageBox( wxString(ttmp, wxConvUTF8) , // "Set an initial point.\n \n (Double click over the interest artery.)" 00475 _T("DxMM : MARACAS"), wxOK | wxCENTRE | wxICON_INFORMATION, this); 00476 } 00477 if ((!success ) && (notSuccessType==1)) { 00478 strcpy( ttmp , marDict.GetString(915) ); strcat( ttmp , "\n \n" ); strcat( ttmp , marDict.GetString(920) ); 00479 wxMessageBox( wxString(ttmp, wxConvUTF8), //"The initial point should be far \n of the limits of the volume." 00480 _T("DxMM : MARACAS"), wxOK | wxCENTRE | wxICON_INFORMATION, this); 00481 } 00482 // Finish 00483 _pRenderWindow->Render( ); 00484 InitialSphere = success; 00485 00486 }
void vtk3DSurfaceWidget::SetInitialPoint | ( | ) |
Definition at line 330 of file vtk3DSurfaceWidget.cxx.
References _lastCameraPos, and _lastPickPoint.
Referenced by wxSurfaceWidget::CallBackOnLeftDClick().
00330 { 00331 this->SetInitialPoint( _lastPickPoint, _lastCameraPos ); 00332 }
void vtk3DSurfaceWidget::SetInterfaceVtkPanelWidgets | ( | InterfaceVtkPanelWidgets * | intVtkPanWid | ) | [inline] |
Definition at line 84 of file vtk3DSurfaceWidget.h.
References _intVtkPanWid.
Referenced by wxQuantificationWidgetCT::CreatePanel_Left().
00084 {_intVtkPanWid=intVtkPanWid;};
void vtk3DSurfaceWidget::SetLast3DClickPoint | ( | double * | pp, | |
double * | cp | |||
) | [protected] |
Definition at line 144 of file vtk3DSurfaceWidget.cxx.
References _lastCameraPos, and _lastPickPoint.
Referenced by OnLeftDClick().
00144 { 00145 _lastPickPoint[0]=pp[0]; 00146 _lastPickPoint[1]=pp[1]; 00147 _lastPickPoint[2]=pp[2]; 00148 _lastCameraPos[0]=cp[0]; 00149 _lastCameraPos[1]=cp[1]; 00150 _lastCameraPos[2]=cp[2]; 00151 }
void wxVTKRenderWindowInteractor::SetRenderWhenDisabled | ( | int | newValue | ) | [inherited] |
Definition at line 723 of file wxVTKRenderWindowInteractor.cxx.
References wxVTKRenderWindowInteractor::RenderWhenDisabled.
00724 { 00725 //Change value of __RenderWhenDisabled ivar. 00726 //If __RenderWhenDisabled is false (the default), this widget will not 00727 //call Render() on the RenderWindow if the top level frame (i.e. the 00728 //containing frame) has been disabled. 00729 00730 //This prevents recursive rendering during wxSafeYield() calls. 00731 //wxSafeYield() can be called during the ProgressMethod() callback of 00732 //a VTK object to have progress bars and other GUI elements updated - 00733 //it does this by disabling all windows (disallowing user-input to 00734 //prevent re-entrancy of code) and then handling all outstanding 00735 //GUI events. 00736 00737 //However, this often triggers an OnPaint() method for wxVTKRWIs, 00738 //resulting in a Render(), resulting in Update() being called whilst 00739 //still in progress. 00740 00741 RenderWhenDisabled = (bool)newValue; 00742 }
void wxVTKRenderWindowInteractor::SetStereo | ( | int | capable | ) | [virtual, inherited] |
Definition at line 748 of file wxVTKRenderWindowInteractor.cxx.
References wxVTKRenderWindowInteractor::Stereo.
void vtk3DSurfaceWidget::SetSurfaceColor | ( | float | red, | |
float | green, | |||
float | blue | |||
) |
Definition at line 165 of file vtk3DSurfaceWidget.cxx.
References _pRenderWindow, and _surfActor.
00166 { 00167 _surfActor->GetProperty()->SetColor(red, green, blue ); 00168 _pRenderWindow->Render(); 00169 }
void vtk3DSurfaceWidget::SetSurfaceIsoValue | ( | int | isoval | ) |
Definition at line 177 of file vtk3DSurfaceWidget.cxx.
References _mCubes, and _pRenderWindow.
Referenced by wxQuantificationWidgetCT::OnSliderIsovalueScroll(), wxQuantificationWidget::OnSliderIsovalueScroll(), wxSurfaceWidget::OnSliderIsovalueScrollThumbrelease(), wxQuantificationWidgetCT::SetSlider_Isovalue_Opacity(), and wxQuantificationWidget::SetSlider_Isovalue_Opacity().
00178 { 00179 _mCubes->SetValue(0, isoval); 00180 _pRenderWindow->Render(); 00181 }
void vtk3DSurfaceWidget::SetSurfaceOpacity | ( | int | opaval | ) |
Definition at line 183 of file vtk3DSurfaceWidget.cxx.
References _pRenderWindow, and _surfActor.
Referenced by wxQuantificationWidgetCT::OnSliderOpacityScroll(), wxQuantificationWidget::OnSliderOpacityScroll(), wxSurfaceWidget::OnSliderOpacityScrollThumbrelease(), wxQuantificationWidgetCT::SetSlider_Isovalue_Opacity(), and wxQuantificationWidget::SetSlider_Isovalue_Opacity().
00184 { 00185 //There is no way in Win32 to specify a slider different than 0->100 00186 _surfActor->GetProperty()->SetOpacity( (double)opaval/100.0 ); 00187 _pRenderWindow->Render(); 00188 }
void vtk3DSurfaceWidget::SetSurfaceVisibility | ( | bool | visible | ) |
Definition at line 171 of file vtk3DSurfaceWidget.cxx.
References _pRenderWindow, and _surfActor.
Referenced by wxQuantificationWidgetCT::OnShowSurface_CB(), and wxQuantificationWidget::OnShowSurface_CB().
00172 { 00173 _surfActor->SetVisibility( visible ); 00174 _pRenderWindow->Render(); 00175 }
void vtk3DSurfaceWidget::ShowMARACASData | ( | marInterface * | mar | ) |
Definition at line 224 of file vtk3DSurfaceWidget.cxx.
References _depth, marInterface::_experiment, _height, _mar, _marImageData, _mCubes, _outActor, _outLine, _outMapper, _pRenderer, _range, _surfActor, _surfMapper, _width, marExperiment::getDynData(), marDynData::getVolume(), and wxVTKRenderWindowInteractor::New().
Referenced by wxSurfaceWidget::ShowMARACASData(), and vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxe().
00224 { 00225 int whd[3]; 00226 00227 _mar = mar; 00228 _marImageData = _mar->_experiment->getDynData( )->getVolume( )->castVtk(); 00229 _marImageData->GetDimensions( whd ); 00230 _width = whd[0]; 00231 _height = whd[1]; 00232 _depth = whd[2]; 00233 00234 _marImageData->GetScalarRange( _range ); 00235 00236 //Outline v2: 00237 // An outline provides context around the data. 00238 _outLine = vtkOutlineFilter::New( ); 00239 _outLine->SetInput( _marImageData ); 00240 _outMapper = vtkPolyDataMapper::New( ); 00241 _outMapper->SetInput( _outLine->GetOutput( ) ); 00242 _outActor = vtkActor::New( ); 00243 _outActor->SetMapper( _outMapper ); 00244 _outActor->GetProperty( )->SetColor( 0.7, 0.0, 0.9 ); 00245 //_outActor->PickableOff( ); 00246 _pRenderer->AddActor( _outActor ); 00247 00248 // Surface 00249 _mCubes = vtkMarchingCubes::New( ); 00250 _surfMapper = vtkPolyDataMapper::New( ); 00251 _surfActor = vtkActor::New( ); 00252 00253 _mCubes->SetInput( _marImageData ); 00254 _mCubes->SetValue( 0, _range[1] / 4 ); 00255 00256 vtkStripper *stripper = vtkStripper::New(); 00257 stripper->SetInput( _mCubes->GetOutput( ) ); 00258 00259 _surfMapper->SetInput( stripper->GetOutput() ); 00260 _surfMapper->ScalarVisibilityOff( ); 00261 stripper->Delete(); 00262 00263 _surfActor->SetMapper( _surfMapper ); 00264 _surfActor->PickableOff( ); 00265 _surfActor->GetProperty( )->SetColor( 0.9803, 0.9215, 0.8392 ); 00266 _surfActor->GetProperty( )->SetOpacity( 0.5 ); 00267 _pRenderer->AddActor( _surfActor ); 00268 00269 // 1. ParallelProjectionOn should be set after AddActor (otherwise call vtkRenderer::ResetCameraClippingRange 00270 // 2. ParallelProjectionOn is *necessary* for the vtkImplicitSelectionLoop 00271 // otherwise this give a cone instead of a cylinder cutting. 00272 _pRenderer->GetActiveCamera()->ParallelProjectionOn(); 00273 00274 }
void vtk3DSurfaceWidget::ShowMARACASDataCT | ( | marInterfaceCT * | mar | ) |
Definition at line 276 of file vtk3DSurfaceWidget.cxx.
References _depth, _height, _marCT, _marImageData, _mCubes, _outActor, _outLine, _outMapper, _pRenderer, _range, _surfActor, _surfMapper, _width, marInterfaceCT::getDynData(), marInterfaceCT::GetExperiment(), marDynData::getVolume(), and wxVTKRenderWindowInteractor::New().
Referenced by vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxeCT().
00276 { 00277 int whd[3]; 00278 00279 00280 _marCT = mar; 00281 _marImageData = _marCT->getDynData()->getVolume()->castVtk(); 00282 _marImageData->GetDimensions( whd ); 00283 _width = whd[0]; 00284 _height = whd[1]; 00285 _depth = whd[2]; 00286 00287 _marImageData->GetScalarRange( _range ); 00288 00289 int a = (_marCT->GetExperiment())->getQuantStart(); 00290 //Outline v2: 00291 // An outline provides context around the data. 00292 _outLine = vtkOutlineFilter::New( ); 00293 _outLine->SetInput( _marImageData ); 00294 _outMapper = vtkPolyDataMapper::New( ); 00295 _outMapper->SetInput( _outLine->GetOutput( ) ); 00296 _outActor = vtkActor::New( ); 00297 _outActor->SetMapper( _outMapper ); 00298 _outActor->GetProperty( )->SetColor( 0.7, 0.0, 0.9 ); 00299 //_outActor->PickableOff( ); 00300 _pRenderer->AddActor( _outActor ); 00301 00302 // Surface 00303 _mCubes = vtkMarchingCubes::New( ); 00304 _surfMapper = vtkPolyDataMapper::New( ); 00305 _surfActor = vtkActor::New( ); 00306 00307 _mCubes->SetInput( _marImageData ); 00308 _mCubes->SetValue( 0, _range[1] / 4 ); 00309 00310 vtkStripper *stripper = vtkStripper::New(); 00311 stripper->SetInput( _mCubes->GetOutput( ) ); 00312 00313 _surfMapper->SetInput( stripper->GetOutput() ); 00314 _surfMapper->ScalarVisibilityOff( ); 00315 stripper->Delete(); 00316 00317 _surfActor->SetMapper( _surfMapper ); 00318 _surfActor->PickableOff( ); 00319 _surfActor->GetProperty( )->SetColor( 0.9803, 0.9215, 0.8392 ); 00320 _surfActor->GetProperty( )->SetOpacity( 0.5 ); 00321 _pRenderer->AddActor( _surfActor ); 00322 00323 // 1. ParallelProjectionOn should be set after AddActor (otherwise call vtkRenderer::ResetCameraClippingRange 00324 // 2. ParallelProjectionOn is *necessary* for the vtkImplicitSelectionLoop 00325 // otherwise this give a cone instead of a cylinder cutting. 00326 _pRenderer->GetActiveCamera()->ParallelProjectionOn(); 00327 00328 }
void wxVTKRenderWindowInteractor::Start | ( | ) | [inherited] |
Definition at line 234 of file wxVTKRenderWindowInteractor.cxx.
void wxVTKRenderWindowInteractor::TerminateApp | ( | ) | [inline, inherited] |
Definition at line 124 of file wxVTKRenderWindowInteractor.h.
void wxVTKRenderWindowInteractor::UpdateSize | ( | int | x, | |
int | y | |||
) | [inherited] |
Definition at line 241 of file wxVTKRenderWindowInteractor.cxx.
00242 { 00243 if( RenderWindow ) 00244 { 00245 // if the size changed tell render window 00246 if ( x != Size[0] || y != Size[1] ) 00247 { 00248 // adjust our (vtkRenderWindowInteractor size) 00249 Size[0] = x; 00250 Size[1] = y; 00251 // and our RenderWindow's size 00252 RenderWindow->SetSize(x, y); 00253 } 00254 } 00255 }
wxVTKRenderWindowInteractor::vtkBooleanMacro | ( | UseCaptureMouse | , | |
int | ||||
) | [inherited] |
wxVTKRenderWindowInteractor::vtkBooleanMacro | ( | Stereo | , | |
int | ||||
) | [inherited] |
wxVTKRenderWindowInteractor::vtkGetMacro | ( | Stereo | , | |
int | ||||
) | [inherited] |
vtk3DSurfaceWidget::vtkGetMacro | ( | InitialSphere | , | |
int | ||||
) |
wxVTKRenderWindowInteractor::vtkSetMacro | ( | UseCaptureMouse | , | |
int | ||||
) | [inherited] |
vtkActor* vtk3DSurfaceWidget::_axesActor [protected] |
Definition at line 115 of file vtk3DSurfaceWidget.h.
Referenced by RemoveAxis(), SetAxis(), and ~vtk3DSurfaceWidget().
vtkPolyDataMapper* vtk3DSurfaceWidget::_axesMapper [protected] |
Definition at line 114 of file vtk3DSurfaceWidget.h.
Referenced by SetAxis(), and ~vtk3DSurfaceWidget().
vtkPolyData* vtk3DSurfaceWidget::_centralLine [protected] |
Definition at line 106 of file vtk3DSurfaceWidget.h.
Referenced by SetInitialPoint(), and ~vtk3DSurfaceWidget().
vtkActor* vtk3DSurfaceWidget::_centralLineActor [protected] |
Definition at line 108 of file vtk3DSurfaceWidget.h.
Referenced by SetInitialPoint(), and ~vtk3DSurfaceWidget().
vtkPolyDataMapper* vtk3DSurfaceWidget::_centralLineMapper [protected] |
Definition at line 107 of file vtk3DSurfaceWidget.h.
Referenced by SetInitialPoint(), and ~vtk3DSurfaceWidget().
int vtk3DSurfaceWidget::_depth [private] |
Definition at line 125 of file vtk3DSurfaceWidget.h.
Referenced by SetInitialPoint(), ShowMARACASData(), and ShowMARACASDataCT().
int vtk3DSurfaceWidget::_height [private] |
Definition at line 124 of file vtk3DSurfaceWidget.h.
Referenced by SetInitialPoint(), ShowMARACASData(), and ShowMARACASDataCT().
Definition at line 119 of file vtk3DSurfaceWidget.h.
Referenced by OnLeftDClick(), OnMouseWheel(), and SetInterfaceVtkPanelWidgets().
float vtk3DSurfaceWidget::_lastCameraPos[3] [private] |
Definition at line 128 of file vtk3DSurfaceWidget.h.
Referenced by GetLast3DClickPoint(), SetInitialPoint(), and SetLast3DClickPoint().
float vtk3DSurfaceWidget::_lastPickPoint[3] [private] |
Definition at line 127 of file vtk3DSurfaceWidget.h.
Referenced by GetLast3DClickPoint(), SetInitialPoint(), and SetLast3DClickPoint().
marInterface* vtk3DSurfaceWidget::_mar [protected] |
Definition at line 95 of file vtk3DSurfaceWidget.h.
Referenced by vtk3DQuantSurfaceWidget::Set3DEndRegionSliceActor(), vtk3DQuantSurfaceWidget::Set3DHealthySliceActor(), vtk3DQuantSurfaceWidget::Set3DSliceActor(), vtk3DQuantSurfaceWidget::Set3DStartRegionSliceActor(), SetInitialPoint(), ShowMARACASData(), and vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxe().
marInterfaceCT* vtk3DSurfaceWidget::_marCT [protected] |
Definition at line 96 of file vtk3DSurfaceWidget.h.
Referenced by vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxeCT(), and ShowMARACASDataCT().
vtkImageData* vtk3DSurfaceWidget::_marImageData |
Definition at line 79 of file vtk3DSurfaceWidget.h.
Referenced by ShowMARACASData(), and ShowMARACASDataCT().
vtkPolyData* vtk3DSurfaceWidget::_marPolyData |
Definition at line 80 of file vtk3DSurfaceWidget.h.
vtkMarchingCubes* vtk3DSurfaceWidget::_mCubes [protected] |
Definition at line 102 of file vtk3DSurfaceWidget.h.
Referenced by SetInitialPoint(), SetSurfaceIsoValue(), ShowMARACASData(), ShowMARACASDataCT(), and ~vtk3DSurfaceWidget().
vtkActor* vtk3DSurfaceWidget::_outActor [protected] |
Definition at line 101 of file vtk3DSurfaceWidget.h.
Referenced by ShowMARACASData(), ShowMARACASDataCT(), and ~vtk3DSurfaceWidget().
vtkOutlineFilter* vtk3DSurfaceWidget::_outLine [protected] |
Definition at line 99 of file vtk3DSurfaceWidget.h.
Referenced by ShowMARACASData(), ShowMARACASDataCT(), and ~vtk3DSurfaceWidget().
vtkPolyDataMapper* vtk3DSurfaceWidget::_outMapper [protected] |
Definition at line 100 of file vtk3DSurfaceWidget.h.
Referenced by ShowMARACASData(), ShowMARACASDataCT(), and ~vtk3DSurfaceWidget().
vtkRenderer* vtk3DSurfaceWidget::_pRenderer [protected] |
Definition at line 97 of file vtk3DSurfaceWidget.h.
Referenced by ConfigureVTK(), GetRenderer(), vtk3DQuantSurfaceWidget::Hide3DEndRegionSliceActor(), vtk3DQuantSurfaceWidget::Hide3DHealthySliceActor(), vtk3DQuantSurfaceWidget::Hide3DSliceActor(), vtk3DQuantSurfaceWidget::Hide3DStartRegionSliceActor(), InitCameraReset(), OnLeftDClick(), vtk3DQuantSurfaceWidget::QuantSurfaceWidget_GetRenderer(), RemoveAxis(), vtk3DQuantSurfaceWidget::Set3DSliceActor(), SetAxis(), SetInitialPoint(), vtk3DQuantSurfaceWidget::Show3DEndRegionSliceActor(), vtk3DQuantSurfaceWidget::Show3DHealthySliceActor(), vtk3DQuantSurfaceWidget::Show3DSliceActor(), vtk3DQuantSurfaceWidget::Show3DStartRegionSliceActor(), ShowMARACASData(), vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxe(), vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxeCT(), ShowMARACASDataCT(), and ~vtk3DSurfaceWidget().
vtkRenderWindow* vtk3DSurfaceWidget::_pRenderWindow [protected] |
Definition at line 98 of file vtk3DSurfaceWidget.h.
Referenced by ConfigureVTK(), vtk3DQuantSurfaceWidget::Hide3DEndRegionSliceActor(), vtk3DQuantSurfaceWidget::Hide3DHealthySliceActor(), vtk3DQuantSurfaceWidget::Hide3DSliceActor(), vtk3DQuantSurfaceWidget::Hide3DStartRegionSliceActor(), vtk3DQuantSurfaceWidget::QuantSurfaceWidget_GetRenderWindow(), RemoveAxis(), Render(), vtk3DQuantSurfaceWidget::SetBWLookUp(), vtk3DQuantSurfaceWidget::SetColorLookUp(), SetInitialPoint(), SetSurfaceColor(), SetSurfaceIsoValue(), SetSurfaceOpacity(), SetSurfaceVisibility(), vtk3DQuantSurfaceWidget::Show3DEndRegionSliceActor(), vtk3DQuantSurfaceWidget::Show3DHealthySliceActor(), vtk3DQuantSurfaceWidget::Show3DSliceActor(), and vtk3DQuantSurfaceWidget::Show3DStartRegionSliceActor().
double vtk3DSurfaceWidget::_range[2] [protected] |
Definition at line 117 of file vtk3DSurfaceWidget.h.
Referenced by ShowMARACASData(), vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxe(), vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxeCT(), and ShowMARACASDataCT().
vtkSphereSource* vtk3DSurfaceWidget::_spheres[4] [protected] |
Definition at line 110 of file vtk3DSurfaceWidget.h.
Referenced by GetSphereCenter(), SetInitialPoint(), and ~vtk3DSurfaceWidget().
vtkActor* vtk3DSurfaceWidget::_spheresActor[4] [protected] |
Definition at line 112 of file vtk3DSurfaceWidget.h.
Referenced by SetInitialPoint(), and ~vtk3DSurfaceWidget().
vtkPolyDataMapper* vtk3DSurfaceWidget::_spheresMapper[4] [protected] |
Definition at line 111 of file vtk3DSurfaceWidget.h.
Referenced by SetInitialPoint(), and ~vtk3DSurfaceWidget().
vtkActor* vtk3DSurfaceWidget::_surfActor [protected] |
Definition at line 104 of file vtk3DSurfaceWidget.h.
Referenced by SetSurfaceColor(), SetSurfaceOpacity(), SetSurfaceVisibility(), ShowMARACASData(), ShowMARACASDataCT(), and ~vtk3DSurfaceWidget().
vtkPolyDataMapper* vtk3DSurfaceWidget::_surfMapper [protected] |
Definition at line 103 of file vtk3DSurfaceWidget.h.
Referenced by ShowMARACASData(), ShowMARACASDataCT(), and ~vtk3DSurfaceWidget().
int vtk3DSurfaceWidget::_width [private] |
Definition at line 123 of file vtk3DSurfaceWidget.h.
Referenced by SetInitialPoint(), ShowMARACASData(), and ShowMARACASDataCT().
int wxVTKRenderWindowInteractor::ActiveButton [protected, inherited] |
Definition at line 162 of file wxVTKRenderWindowInteractor.h.
Referenced by wxVTKRenderWindowInteractor::OnButtonDown(), and wxVTKRenderWindowInteractor::OnButtonUp().
int vtk3DSurfaceWidget::InitialSphere [private] |
Definition at line 126 of file vtk3DSurfaceWidget.h.
Referenced by SetInitialPoint().
int wxVTKRenderWindowInteractor::RenderAllowed [protected, inherited] |
Definition at line 163 of file wxVTKRenderWindowInteractor.h.
Referenced by wxVTKRenderWindowInteractor::Render().
int wxVTKRenderWindowInteractor::Stereo [protected, inherited] |
Definition at line 165 of file wxVTKRenderWindowInteractor.h.
Referenced by wxVTKRenderWindowInteractor::SetStereo().
wxTimer wxVTKRenderWindowInteractor::timer [protected, inherited] |
Definition at line 161 of file wxVTKRenderWindowInteractor.h.