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
|
/*=========================================================================
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 vtkKWLightboxWidget
// .SECTION Description
#ifndef __vtkKWLightboxWidget_h
#define __vtkKWLightboxWidget_h
#include "vtkKW2DRenderWidget.h"
#include "XML/vtkXMLIOBaseMacros.h" // Needed for XML reader/writer macros
class vtkActor2D;
class vtkImageActor;
class vtkKWInteractorStyleLightboxView;
class vtkKWImageMapToWindowLevelColors;
class VTK_EXPORT vtkKWLightboxWidget : public vtkKW2DRenderWidget
{
public:
static vtkKWLightboxWidget* New();
vtkTypeRevisionMacro(vtkKWLightboxWidget, vtkKW2DRenderWidget);
void PrintSelf(ostream& os, vtkIndent indent);
//BTX
vtkKWGetXMLReaderWriterObjectsMacro();
//ETX
// Description:
// Control the resolution in images by images of this view
void SetResolution(int i, int j);
vtkGetVector2Macro(Resolution, int);
// Description:
// Get and control the 3D markers, probably all of these routines
// should be removed. The manipulation of markers whould not be done
// at this level, remove with event cleanup.
virtual void SetMarkers3DVisibility(int v);
// Description:
// Slice navigation
virtual void SetSlice(int n);
virtual void IncrementPage();
virtual void DecrementPage();
virtual int GoToDefaultSlice();
// Description:
// Get the interactor style
virtual vtkKWInteractorStyle2DView* GetInteractorStyle();
// Description
// Callbacks
virtual void SliceSelectedCallback(double value);
// 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:
// Enable/Disable linear interpolation
virtual void SetInterpolate(int state);
virtual int GetInterpolate();
// Description:
// Update the color mapping parameters
virtual void UpdateColorMapping();
protected:
vtkKWLightboxWidget();
~vtkKWLightboxWidget();
// 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:
// Update the image map
virtual void UpdateImageMap();
virtual void UpdateResolution();
// Description:
// Create the default renderers inside the render window.
// Superclass can override to create different renderers.
// It is called by Create().
virtual void CreateDefaultRenderers();
// Description:
// Install the renderers inside the render window.
// Superclass can override to install them in a different layout.
// It is called by Create().
virtual void InstallRenderers();
// Description:
// Populate the context menu
virtual void PopulateContextMenuWithOptionEntries(vtkKWMenu*);
virtual void PopulateContextMenuWithCameraEntries(vtkKWMenu*);
int Resolution[2];
int UpdateExtent[6];
vtkActor2D *BoxFrame;
vtkImageActor **Images;
int NumberOfImages;
vtkKWInteractorStyleLightboxView *InteractorStyle;
vtkKWImageMapToWindowLevelColors *InteractiveMap;
private:
vtkKWLightboxWidget(const vtkKWLightboxWidget&); // Not implemented
void operator=(const vtkKWLightboxWidget&); // Not implemented
};
#endif
|