1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
/*=========================================================================
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.kitware.com/VolViewCopyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkKWProbeImageWidget - subclass of vtkKWImageWidget
// .SECTION Description
// vtkKWProbeImageWidget is a subclass of vtkKWImageWidget that
// displays data from a vtkProbeImage as an image.
// See parent class : InteractorStyle to find all event associated with it
// .See Also vtkKWInteractorStyleImageView
#ifndef __vtkKWProbeImageWidget_h
#define __vtkKWProbeImageWidget_h
#include "vtkKWImageWidget.h"
#include "XML/vtkXMLIOBaseMacros.h" // Needed for XML reader/writer macros
class vtkPolyDataAlgorithm;
class vtkImageReslice;
class vtkKWImageMapToWindowLevelColors;
class vtkTransform;
class VTK_EXPORT vtkKWProbeImageWidget : public vtkKWImageWidget
{
public:
// Description:
// Standard New, Type, and PrintSelf methods
static vtkKWProbeImageWidget* New();
vtkTypeRevisionMacro(vtkKWProbeImageWidget, vtkKWImageWidget);
void PrintSelf(ostream &os, vtkIndent indent);
//BTX
vtkKWGetXMLReaderWriterObjectsMacro();
//ETX
// Description:
// Set/get the interaction style.
// Add more interaction mode to the superclass
//BTX
enum
{
INTERACTION_MODE_RESLICE = 1000,
INTERACTION_MODE_ROLL,
INTERACTION_MODE_TRANSLATE
};
//ETX
virtual void SetInteractionModeToReslice()
{ this->SetInteractionMode(INTERACTION_MODE_RESLICE); };
virtual void SetInteractionModeToRoll()
{ this->SetInteractionMode(INTERACTION_MODE_ROLL); };
virtual void SetInteractionModeToTranslate()
{ this->SetInteractionMode(INTERACTION_MODE_TRANSLATE); };
// Description:
// Set / get whether this widget is displaying an image
virtual void SetImageVisibility(int state);
virtual int GetImageVisibility();
vtkBooleanMacro(ImageVisibility, int);
// Description:
// Reset the camera
virtual void ResetCamera();
// Description:
// Render this Widget
virtual void Render();
// Description:
// Given mouse coordinate, compute world coordinate, eventually return
// the id of the renderer if the widget supports multiple renderers
// (see vtkKWRenderWidget::GetNthRenderer,
// vtkKWRenderWidget::GetRendererIndex)
virtual int ComputeWorldCoordinate(int x, int y, double *result, int *id = 0);
// Description:
// Set the probe algorithm that will create input data for this widget.
virtual void SetProbeInputAlgorithm(vtkPolyDataAlgorithm *alg);
vtkGetObjectMacro(ProbeInputAlgorithm, vtkPolyDataAlgorithm);
// Description:
// Give access to internal structures
vtkGetObjectMacro(ImageReslice, vtkImageReslice);
// Description
// Rotate infinite plane of an angle theta.
void RollPlane(double theta);
void TiltPlane(double rxf, double ryf);
void TranslatePlane(double factor);
protected:
vtkKWProbeImageWidget();
~vtkKWProbeImageWidget();
// Description:
// Create the widget
virtual void CreateWidget();
// Description:
// Connects the internal object together given the Input.
// Returns 1 on success, 0 on error or to signal that it is safe to abort
virtual int ConnectInternalPipeline();
// Description:
// Update the display extent according to what part of the Input has to
// be displayed. It is probably the right place to adjust/place the 3D
// widget which position depends on the display extent.
virtual void UpdateDisplayExtent();
// Description:
// Connect ImageMapToRGBA to its input (can be overriden in subclasses)
virtual void ConnectImageMapToRGBA();
// Description:
// Internally recompute equation to go from the plane of the vtkCutter (vtkImplicitPlaneWidget)
// to the expected input of vtkImageReslice
void UpdatePlane();
// Description:
// Configure the event map
virtual void ConfigureEventMap();
// Description:
// Populate the context menu
virtual void PopulateContextMenuWithInteractionEntries(vtkKWMenu*);
vtkPolyDataAlgorithm *ProbeInputAlgorithm;
vtkImageReslice *ImageReslice;
vtkTransform *Transform;
private:
vtkKWProbeImageWidget(const vtkKWProbeImageWidget&); // Not implemented
void operator=(const vtkKWProbeImageWidget&); // Not implemented
};
#endif
|