Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00025 #ifndef __vtkKWEBoundingBoxRepresentation2D_h
00026 #define __vtkKWEBoundingBoxRepresentation2D_h
00027
00028 #include "VTKEdgeConfigure.h"
00029 #include "vtkWidgetRepresentation.h"
00030
00031 class vtkHandleRepresentation;
00032 class vtkCellArray;
00033 class vtkPoints;
00034 class vtkPolyData;
00035 class vtkPolyDataMapper;
00036 class vtkTextMapper;
00037 class vtkTextProperty;
00038 class vtkProperty;
00039 class vtkActor2D;
00040 class vtkActor;
00041 class vtkProperty2D;
00042 class vtkProperty;
00043 class vtkImageActorPointPlacer;
00044 class vtkImageActor;
00045 class vtkActor2DCollection;
00046 class vtkCollection;
00047 class vtkImageData;
00048
00049 class VTKEdge_WIDGETS_EXPORT vtkKWEBoundingBoxRepresentation2D : public vtkWidgetRepresentation
00050 {
00051 public:
00053 static vtkKWEBoundingBoxRepresentation2D *New();
00054
00056
00057 vtkTypeRevisionMacro(vtkKWEBoundingBoxRepresentation2D,vtkWidgetRepresentation);
00058 void PrintSelf(ostream& os, vtkIndent indent);
00060
00062
00063 virtual void SetImageActor( vtkImageActor * );
00064 vtkImageActor *GetImageActor();
00066
00068
00075 void SetHandleRepresentation(vtkHandleRepresentation *handle);
00076 vtkHandleRepresentation* GetHandleRepresentation( int handleIndex );
00078
00080
00082 vtkGetObjectMacro(LineProperty,vtkProperty);
00083 vtkGetObjectMacro(SelectedLineProperty,vtkProperty);
00084 virtual void SetSelectedHandleProperty( vtkProperty * );
00085 virtual void SetHoveredHandleProperty( vtkProperty * );
00086 virtual void SetHandleProperty( vtkProperty * );
00088
00090 vtkPolyData * GetPolyData();
00091
00093
00094 int GetExtent( int extents[6] );
00095 void SetExtent( int extents[6] );
00097
00099
00100 virtual void BuildRepresentation();
00101 virtual int ComputeInteractionState(int X, int Y, int modify=0);
00102 virtual void GetActors2D(vtkPropCollection *pc);
00103 virtual void GetActors(vtkPropCollection *pc);
00104 virtual void PlaceWidget(double bounds[6]);
00106
00108
00109 virtual void ReleaseGraphicsResources(vtkWindow *w);
00110 virtual int RenderOverlay(vtkViewport *viewport);
00111 virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00113
00115
00116 vtkSetMacro(InteractionState,int);
00118
00119
00120 enum _InteractionState
00121 {
00122 Outside = 0,
00123 Inside,
00124 RequestResizeBox,
00125 Resizing,
00126 BeginDefining,
00127 Defining,
00128 EndDefining
00129 };
00130
00131
00133
00136 vtkSetStringMacro(LabelFormat);
00137 vtkGetStringMacro(LabelFormat);
00139
00141
00142 virtual void SetImageData( vtkImageData * );
00143 vtkGetObjectMacro( ImageData, vtkImageData );
00145
00147
00148 vtkSetMacro( ID, int );
00149 vtkGetMacro( ID, int );
00151
00153 vtkProperty * GetOutlineProperty();
00154
00156
00157 vtkTextProperty * GetWidthTextProperty();
00158 vtkTextProperty * GetHeightTextProperty();
00159 vtkTextProperty * GetIDTextProperty();
00161
00163
00167 vtkSetMacro( Fade, int );
00168 vtkGetMacro( Fade, int );
00170
00172
00173 vtkSetMacro( ShowSliceScaleBar, int );
00175
00177
00178 vtkGetMacro( Unplaced, int );
00180
00181 protected:
00182 vtkKWEBoundingBoxRepresentation2D();
00183 ~vtkKWEBoundingBoxRepresentation2D();
00184
00186 void SetVisibilityInternal( int );
00187
00188 void Translate( const double translation[3],
00189 const double cursorMotionVector[3] );
00190 void PositionHandles();
00191
00192
00193
00194 void SetHandleHighlight( int handleIdx, vtkProperty *property );
00195
00196
00197 void PlaceWidget();
00198
00199
00200 int PlaceWidgetInternal(double bounds[6]);
00201
00202
00203
00204
00205 int Cut();
00206
00207
00208 int Annotate();
00209 int AnnotateScaleBar();
00210
00211 vtkImageActorPointPlacer * PointPlacer;
00212 vtkPolyData * PolyData;
00213 vtkCollection * TextMappers;
00214 vtkActor2DCollection * TextActors;
00215 vtkPolyData * BoxPolyData;
00216 vtkPolyDataMapper * BoxMapper;
00217 vtkActor * BoxActor;
00218 vtkPoints * BoxPoints;
00219 vtkProperty * HandleProperty;
00220 vtkProperty * SelectedHandleProperty;
00221 vtkProperty * HoveredHandleProperty;
00222 vtkProperty * LineProperty;
00223 vtkProperty * SelectedLineProperty;
00224 vtkHandleRepresentation * HandleRepresentation;
00225 vtkHandleRepresentation **HandleRepresentations;
00226 int CurrentHandleIdx;
00227 double MinimumThickness[3];
00228 double PlaceFactor;
00229 double LastEventPosition[2];
00230 char * LabelFormat;
00231 vtkActor * ScaleBarActor;
00232 vtkActor * ScaleBarActor2;
00233 vtkPolyData * ScaleBar;
00234 vtkPolyData * ScaleBar2;
00235 int ShowSliceScaleBar;
00236 int Unplaced;
00237 vtkImageData * ImageData;
00238 int Fade;
00239 int ID;
00240
00241 private:
00242 vtkKWEBoundingBoxRepresentation2D(const vtkKWEBoundingBoxRepresentation2D&);
00243 void operator=(const vtkKWEBoundingBoxRepresentation2D&);
00244
00245 int ComputeOrientation();
00246 int XAxis, YAxis, ZAxis;
00247 double Point1DisplayPosition[2], Point2DisplayPosition[2];
00248 };
00249
00250 #endif
00251