43 #include "vtkRenderer.h"
44 #include "vtkCamera.h"
46 #include "vtkRenderWindow.h"
47 #include "vtkRenderWindowInteractor.h"
48 #include "vtkCellPicker.h"
100 void *vtkNotUsed(callData) )
112 if ( event == vtkCommand::EndInteractionEvent )
119 vtkInteractorStyleImage2D::SafeDownCast(caller);
125 if ( isi == v->GetInteractorStyle() )
133 if ( !isi || !viewer || !viewer->GetInput() )
139 if ( event == vtkCommand::ResetWindowLevelEvent )
154 if ( event == vtkCommand::WindowLevelEvent )
156 this->
Collection->SyncSetColorWindow( viewer->GetColorWindow() );
157 this->
Collection->SyncSetColorLevel( viewer->GetColorLevel() );
169 double z = viewer->GetZoom();
170 double parallel_scale =
171 viewer->GetRenderer()->GetActiveCamera()->GetParallelScale();
179 viewer->GetCameraMotionVector(motion);
183 double focal[3], pos[3], n[3];
191 v->GetRenderer()->GetActiveCamera()->GetViewPlaneNormal(n);
192 dot = vtkMath::Dot(n, motion);
194 for (
int dim = 0; dim < 3; dim++ )
196 u = motion[dim] - dot * n[dim];
202 if ( v->GetInteractorStyle()->
GetInteractor()->GetLightFollowCamera() )
204 v->GetRenderer()->UpdateLightsGeometryToFollowCamera();
217 this->
Collection->SyncSetWorldCoordinates(position);
void SetCameraFocalAndPosition(double focal[3], double pos[3])
Set camera focal point and position.
virtual void SyncResetWindowLevel(void)
Description: Synchronize reset window level between views.
Manage events occuring in a 2D view and apply it to a collection.
virtual double * GetWorldCoordinatesFromDisplayPosition(int xy[2])
Useful method that transform a display position into a world corrdinate point.
~vtkViewImage2DCollectionCommand()
void GetCameraFocalAndPosition(double focal[3], double pos[3])
Set camera focal point and position.
Define the interactor behavior withing a vtkImage2D. 4 modes (Default, Zoom, Pan and Pick) ...
virtual void SyncReset(void)
Description: Synchronize reset between views.
virtual void SyncRender()
Description: Synchronize render between views.
vtkViewImage2DCollectionCommand()
Manage a collection of 2D views.
virtual void Execute(vtkObject *caller, unsigned long event, void *vtkNotUsed(callData))
void SyncSetZoomAndParallelScale(double Zoom, double ParallelScale)
vtkViewImage2D * GetNextItem()
void SetCollection(vtkViewImage2DCollection *p)
Set the current collection.
vtkViewImage2DCollection * Collection
virtual void Render(void)
int * GetRequestedPosition(void)
virtual vtkRenderWindowInteractor * GetInteractor()
void SynchronizeViews(bool iSynchronizeViews)
Synchronize the 2d views.
static vtkViewImage2DCollectionCommand * New()
Convenient method to access the constructor.
Basic class to handle 2D/3D items such as images and polydatas visualization in 2D.
vtkViewImage2DCollection * GetCollection()
Get the current collection.