Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkScalarBarActor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkScalarBarActor.h,v $
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 =========================================================================*/
00070 #ifndef __vtkScalarBarActor_h
00071 #define __vtkScalarBarActor_h
00072 
00073 #include "vtkActor2D.h"
00074 
00075 class vtkPolyData;
00076 class vtkPolyDataMapper2D;
00077 class vtkScalarsToColors;
00078 class vtkTextMapper;
00079 class vtkTextProperty;
00080 
00081 #define VTK_ORIENT_HORIZONTAL 0
00082 #define VTK_ORIENT_VERTICAL 1
00083 
00084 class VTK_RENDERING_EXPORT vtkScalarBarActor : public vtkActor2D
00085 {
00086 public:
00087   vtkTypeRevisionMacro(vtkScalarBarActor,vtkActor2D);
00088   void PrintSelf(ostream& os, vtkIndent indent);
00089 
00093   static vtkScalarBarActor *New();
00094 
00096 
00097   int RenderOpaqueGeometry(vtkViewport* viewport);
00098   int RenderTranslucentGeometry(vtkViewport*) { return 0; };
00099   int RenderOverlay(vtkViewport* viewport);
00101 
00105   virtual void ReleaseGraphicsResources(vtkWindow *);
00106 
00108 
00111   virtual void SetLookupTable(vtkScalarsToColors*);
00112   vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
00114 
00116 
00119   vtkSetClampMacro(MaximumNumberOfColors, int, 2, VTK_LARGE_INTEGER);
00120   vtkGetMacro(MaximumNumberOfColors, int);
00122   
00124 
00125   vtkSetClampMacro(NumberOfLabels, int, 0, 64);
00126   vtkGetMacro(NumberOfLabels, int);
00128   
00130 
00131   vtkSetClampMacro(Orientation,int,VTK_ORIENT_HORIZONTAL, VTK_ORIENT_VERTICAL);
00132   vtkGetMacro(Orientation, int);
00133   void SetOrientationToHorizontal()
00134        {this->SetOrientation(VTK_ORIENT_HORIZONTAL);};
00135   void SetOrientationToVertical() {this->SetOrientation(VTK_ORIENT_VERTICAL);};
00137 
00139 
00140   virtual void SetTitleTextProperty(vtkTextProperty *p);
00141   vtkGetObjectMacro(TitleTextProperty,vtkTextProperty);
00143   
00145 
00146   virtual void SetLabelTextProperty(vtkTextProperty *p);
00147   vtkGetObjectMacro(LabelTextProperty,vtkTextProperty);
00149     
00151 
00152   vtkSetStringMacro(LabelFormat);
00153   vtkGetStringMacro(LabelFormat);
00155 
00157 
00158   vtkSetStringMacro(Title);
00159   vtkGetStringMacro(Title);
00161 
00164   void ShallowCopy(vtkProp *prop);
00165 
00166 protected:
00167   vtkScalarBarActor();
00168   ~vtkScalarBarActor();
00169 
00170   vtkScalarsToColors *LookupTable;
00171   vtkTextProperty *TitleTextProperty;
00172   vtkTextProperty *LabelTextProperty;
00173 
00174   int   MaximumNumberOfColors;
00175   int   NumberOfLabels;
00176   int   NumberOfLabelsBuilt;
00177   int   Orientation;
00178   char  *Title;
00179   char  *LabelFormat;
00180 
00181   vtkTextMapper **TextMappers;
00182   virtual void AllocateAndSizeLabels(int *labelSize, int *size,
00183                                      vtkViewport *viewport, double *range);
00184 
00185 private:
00186   vtkTextMapper *TitleMapper;
00187   vtkActor2D    *TitleActor;
00188 
00189   vtkActor2D    **TextActors;
00190 
00191   vtkPolyData         *ScalarBar;
00192   vtkPolyDataMapper2D *ScalarBarMapper;
00193   vtkActor2D          *ScalarBarActor;
00194 
00195   vtkTimeStamp  BuildTime;
00196   int LastSize[2];
00197   int LastOrigin[2];
00198 
00199   void SizeTitle(int *titleSize, int *size, vtkViewport *viewport);
00200 
00201 private:
00202   vtkScalarBarActor(const vtkScalarBarActor&);  // Not implemented.
00203   void operator=(const vtkScalarBarActor&);  // Not implemented.
00204 };
00205 
00206 
00207 #endif
00208