VTK
dox/Interaction/Widgets/vtkResliceCursorLineRepresentation.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkResliceCursorLineRepresentation.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00037 #ifndef __vtkResliceCursorLineRepresentation_h
00038 #define __vtkResliceCursorLineRepresentation_h
00039 
00040 #include "vtkInteractionWidgetsModule.h" // For export macro
00041 #include "vtkResliceCursorRepresentation.h"
00042 
00043 class vtkPolyData;
00044 class vtkResliceCursorActor;
00045 class vtkResliceCursorPolyDataAlgorithm;
00046 class vtkResliceCursorPicker;
00047 class vtkResliceCursor;
00048 
00049 
00050 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorLineRepresentation : public vtkResliceCursorRepresentation
00051 {
00052 public:
00054   static vtkResliceCursorLineRepresentation *New();
00055 
00057 
00058   vtkTypeMacro(vtkResliceCursorLineRepresentation,vtkResliceCursorRepresentation);
00059   void PrintSelf(ostream& os, vtkIndent indent);
00061 
00063 
00064   virtual void BuildRepresentation();
00065   virtual int  ComputeInteractionState(int X, int Y, int modify=0);
00066   virtual void StartWidgetInteraction(double startEventPos[2]);
00067   virtual void WidgetInteraction(double e[2]);
00068   virtual void Highlight(int highlightOn);
00070 
00072 
00073   virtual void ReleaseGraphicsResources(vtkWindow *w);
00074   virtual int RenderOverlay(vtkViewport *viewport);
00075   virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00076   virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
00077   virtual int HasTranslucentPolygonalGeometry();
00079 
00082   virtual double * GetBounds();
00083 
00085 
00087   vtkGetObjectMacro( ResliceCursorActor, vtkResliceCursorActor );
00089 
00091   virtual vtkResliceCursor * GetResliceCursor();
00092 
00094   virtual void SetUserMatrix( vtkMatrix4x4 *matrix);
00095 
00096 protected:
00097   vtkResliceCursorLineRepresentation();
00098   ~vtkResliceCursorLineRepresentation();
00099 
00100   virtual vtkResliceCursorPolyDataAlgorithm * GetCursorAlgorithm();
00101 
00102   double RotateAxis( double evenPos[2], int axis );
00103 
00104   void RotateAxis( int axis, double angle );
00105 
00106   void RotateVectorAboutVector( double vectorToBeRotated[3],
00107                                 double axis[3], // vector about which we rotate
00108                                 double angle, // angle in radians
00109                                 double o[3] );
00110   int DisplayToReslicePlaneIntersection(
00111     double displayPos[2], double intersectionPos[3] );
00112 
00113   vtkResliceCursorActor  * ResliceCursorActor;
00114   vtkResliceCursorPicker * Picker;
00115 
00116   double                   StartPickPosition[3];
00117   double                   StartCenterPosition[3];
00118 
00119   // Transformation matrices. These have no offset. Offset is recomputed
00120   // based on the cursor, so that the center of the cursor has the same
00121   // location in transformed space as it does in physical space.
00122   vtkMatrix4x4           * MatrixReslice;
00123   vtkMatrix4x4           * MatrixView;
00124   vtkMatrix4x4           * MatrixReslicedView;
00125 
00126 private:
00127   vtkResliceCursorLineRepresentation(const vtkResliceCursorLineRepresentation&);  //Not implemented
00128   void operator=(const vtkResliceCursorLineRepresentation&);  //Not implemented
00129 };
00130 
00131 #endif