VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkResliceImageViewerMeasurements.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 =========================================================================*/ 00025 #ifndef __vtkResliceImageViewerMeasurements_h 00026 #define __vtkResliceImageViewerMeasurements_h 00027 00028 #include "vtkObject.h" 00029 00030 class vtkResliceImageViewer; 00031 class vtkAbstractWidget; 00032 class vtkCallbackCommand; 00033 class vtkCollection; 00034 class vtkDistanceWidget; 00035 class vtkAngleWidget; 00036 class vtkBiDimensionalWidget; 00037 class vtkHandleRepresentation; 00038 class vtkHandleWidget; 00039 class vtkCaptionWidget; 00040 class vtkContourWidget; 00041 class vtkSeedWidget; 00042 00043 class VTK_WIDGETS_EXPORT vtkResliceImageViewerMeasurements : public vtkObject 00044 { 00045 public: 00046 00048 00049 static vtkResliceImageViewerMeasurements *New(); 00050 vtkTypeMacro(vtkResliceImageViewerMeasurements,vtkObject); 00051 void PrintSelf(ostream& os, vtkIndent indent); 00053 00055 virtual void Render(); 00056 00058 00059 virtual void AddItem(vtkAbstractWidget *); 00060 virtual void RemoveItem(vtkAbstractWidget *); 00061 virtual void RemoveAllItems(); 00063 00065 00069 vtkSetClampMacro(ProcessEvents, int, 0, 1); 00070 vtkGetMacro(ProcessEvents, int); 00071 vtkBooleanMacro(ProcessEvents, int); 00073 00075 00076 vtkSetMacro( Tolerance, double ); 00077 vtkGetMacro( Tolerance, double ); 00079 00081 00083 virtual void SetResliceImageViewer( vtkResliceImageViewer * ); 00084 vtkGetObjectMacro( ResliceImageViewer, vtkResliceImageViewer ); 00086 00089 virtual void Update(); 00090 00091 protected: 00092 vtkResliceImageViewerMeasurements(); 00093 ~vtkResliceImageViewerMeasurements(); 00094 00096 00097 bool IsItemOnReslicedPlane( vtkAbstractWidget * w ); 00098 bool IsWidgetOnReslicedPlane( vtkDistanceWidget * w ); 00099 bool IsWidgetOnReslicedPlane( vtkAngleWidget * w ); 00100 bool IsWidgetOnReslicedPlane( vtkBiDimensionalWidget * w ); 00101 bool IsWidgetOnReslicedPlane( vtkCaptionWidget * w ); 00102 bool IsWidgetOnReslicedPlane( vtkContourWidget * w ); 00103 bool IsWidgetOnReslicedPlane( vtkSeedWidget * w ); 00104 bool IsWidgetOnReslicedPlane( vtkHandleWidget * w ); 00105 bool IsPointOnReslicedPlane( vtkHandleRepresentation * h ); 00106 bool IsPositionOnReslicedPlane( double p[3] ); 00108 00109 // Handles the events; centralized here for all widgets. 00110 static void ProcessEventsHandler(vtkObject* object, unsigned long event, 00111 void* clientdata, void* calldata); 00112 00113 vtkResliceImageViewer * ResliceImageViewer; 00114 vtkCollection * WidgetCollection; 00115 00116 // Handle the visibility of the measurements. 00117 vtkCallbackCommand * EventCallbackCommand; // 00118 00119 // Flag indicating if we should handle events. 00120 // On by default. 00121 int ProcessEvents; 00122 00123 // Tolerance for Point-in-plane computation 00124 double Tolerance; 00125 00126 private: 00127 vtkResliceImageViewerMeasurements(const vtkResliceImageViewerMeasurements&); // Not implemented. 00128 void operator=(const vtkResliceImageViewerMeasurements&); // Not implemented. 00129 }; 00130 00131 #endif