Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

imaging/vtkScalarBarActor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkScalarBarActor.h,v $
00005   Language:  C++
00006 
00007 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00008 All rights reserved.
00009 
00010 Redistribution and use in source and binary forms, with or without
00011 modification, are permitted provided that the following conditions are met:
00012 
00013  * Redistributions of source code must retain the above copyright notice,
00014    this list of conditions and the following disclaimer.
00015 
00016  * Redistributions in binary form must reproduce the above copyright notice,
00017    this list of conditions and the following disclaimer in the documentation
00018    and/or other materials provided with the distribution.
00019 
00020  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00021    of any contributors may be used to endorse or promote products derived
00022    from this software without specific prior written permission.
00023 
00024  * Modified source versions must be plainly marked as such, and must not be
00025    misrepresented as being the original software.
00026 
00027 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00028 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00031 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00032 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00033 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00034 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00035 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00036 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 
00038 =========================================================================*/
00078 #ifndef __vtkScalarBarActor_h
00079 #define __vtkScalarBarActor_h
00080 
00081 #include "vtkActor2D.h"
00082 #include "vtkScalarsToColors.h"
00083 #include "vtkPolyDataMapper2D.h"
00084 #include "vtkTextMapper.h"
00085 
00086 #define VTK_ORIENT_HORIZONTAL 0
00087 #define VTK_ORIENT_VERTICAL 1
00088 
00089 class VTK_EXPORT vtkScalarBarActor : public vtkActor2D
00090 {
00091 public:
00092   vtkTypeMacro(vtkScalarBarActor,vtkActor2D);
00093   void PrintSelf(ostream& os, vtkIndent indent);
00094 
00099   static vtkScalarBarActor *New();
00100 
00101 
00103   int RenderOpaqueGeometry(vtkViewport* viewport);
00104   int RenderTranslucentGeometry(vtkViewport*) { return 0; };
00105   int RenderOverlay(vtkViewport* viewport);
00106 
00110   virtual void ReleaseGraphicsResources(vtkWindow *);
00111 
00115   vtkSetObjectMacro(LookupTable,vtkScalarsToColors);
00116   vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
00117 
00121   vtkSetClampMacro(MaximumNumberOfColors, int, 2, VTK_LARGE_INTEGER);
00122   vtkGetMacro(MaximumNumberOfColors, int);
00123   
00125   vtkSetClampMacro(NumberOfLabels, int, 0, 64);
00126   vtkGetMacro(NumberOfLabels, int);
00127   
00129   vtkSetClampMacro(Orientation,int,VTK_ORIENT_HORIZONTAL, VTK_ORIENT_VERTICAL);
00130   vtkGetMacro(Orientation, int);
00131   void SetOrientationToHorizontal()
00132        {this->SetOrientation(VTK_ORIENT_HORIZONTAL);};
00133   void SetOrientationToVertical() {this->SetOrientation(VTK_ORIENT_VERTICAL);};
00134 
00136   vtkSetMacro(Bold, int);
00137   vtkGetMacro(Bold, int);
00138   vtkBooleanMacro(Bold, int);
00139 
00141   vtkSetMacro(Italic, int);
00142   vtkGetMacro(Italic, int);
00143   vtkBooleanMacro(Italic, int);
00144 
00147   vtkSetMacro(Shadow, int);
00148   vtkGetMacro(Shadow, int);
00149   vtkBooleanMacro(Shadow, int);
00150 
00154   vtkSetMacro(FontFamily, int);
00155   vtkGetMacro(FontFamily, int);
00156   void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00157   void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00158   void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00159 
00161   vtkSetStringMacro(LabelFormat);
00162   vtkGetStringMacro(LabelFormat);
00163 
00165   vtkSetStringMacro(Title);
00166   vtkGetStringMacro(Title);
00167 
00170   void ShallowCopy(vtkProp *prop);
00171 
00172 protected:
00173   vtkScalarBarActor();
00174   ~vtkScalarBarActor();
00175   vtkScalarBarActor(const vtkScalarBarActor&) {};
00176   void operator=(const vtkScalarBarActor&) {};
00177 
00178   vtkScalarsToColors *LookupTable;
00179   int   MaximumNumberOfColors;
00180   int   NumberOfLabels;
00181   int   NumberOfLabelsBuilt;
00182   int   Orientation;
00183   char  *Title;
00184 
00185   int Bold;
00186   int   Italic;
00187   int   Shadow;
00188   int   FontFamily;
00189   char  *LabelFormat;
00190 
00191 private:
00192   vtkTextMapper *TitleMapper;
00193   vtkActor2D    *TitleActor;
00194 
00195   vtkTextMapper **TextMappers;
00196   vtkActor2D    **TextActors;
00197 
00198   vtkPolyData         *ScalarBar;
00199   vtkPolyDataMapper2D *ScalarBarMapper;
00200   vtkActor2D          *ScalarBarActor;
00201 
00202   vtkTimeStamp  BuildTime;
00203   int LastSize[2];
00204   int LastOrigin[2];
00205 
00206   void SizeTitle(int *titleSize, int *size, vtkViewport *viewport);
00207   void AllocateAndSizeLabels(int *labelSize, int *size,
00208                              vtkViewport *viewport, float *range);
00209 };
00210 
00211 
00212 #endif
00213 

Generated on Wed Nov 21 12:27:08 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001