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

Rendering/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 =========================================================================*/
00079 #ifndef __vtkScalarBarActor_h
00080 #define __vtkScalarBarActor_h
00081 
00082 #include "vtkActor2D.h"
00083 #include "vtkScalarsToColors.h"
00084 #include "vtkPolyDataMapper2D.h"
00085 #include "vtkTextMapper.h"
00086 
00087 #define VTK_ORIENT_HORIZONTAL 0
00088 #define VTK_ORIENT_VERTICAL 1
00089 
00090 class VTK_RENDERING_EXPORT vtkScalarBarActor : public vtkActor2D
00091 {
00092 public:
00093   vtkTypeMacro(vtkScalarBarActor,vtkActor2D);
00094   void PrintSelf(ostream& os, vtkIndent indent);
00095 
00100   static vtkScalarBarActor *New();
00101 
00102 
00104 
00105   int RenderOpaqueGeometry(vtkViewport* viewport);
00106   int RenderTranslucentGeometry(vtkViewport*) { return 0; };
00107   int RenderOverlay(vtkViewport* viewport);
00109 
00113   virtual void ReleaseGraphicsResources(vtkWindow *);
00114 
00116 
00119   vtkSetObjectMacro(LookupTable,vtkScalarsToColors);
00120   vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
00122 
00124 
00127   vtkSetClampMacro(MaximumNumberOfColors, int, 2, VTK_LARGE_INTEGER);
00128   vtkGetMacro(MaximumNumberOfColors, int);
00130   
00132 
00133   vtkSetClampMacro(NumberOfLabels, int, 0, 64);
00134   vtkGetMacro(NumberOfLabels, int);
00136   
00138 
00139   vtkSetClampMacro(Orientation,int,VTK_ORIENT_HORIZONTAL, VTK_ORIENT_VERTICAL);
00140   vtkGetMacro(Orientation, int);
00141   void SetOrientationToHorizontal()
00142        {this->SetOrientation(VTK_ORIENT_HORIZONTAL);};
00143   void SetOrientationToVertical() {this->SetOrientation(VTK_ORIENT_VERTICAL);};
00145 
00147 
00148   vtkSetMacro(Bold, int);
00149   vtkGetMacro(Bold, int);
00150   vtkBooleanMacro(Bold, int);
00152 
00154 
00155   vtkSetMacro(Italic, int);
00156   vtkGetMacro(Italic, int);
00157   vtkBooleanMacro(Italic, int);
00159 
00161 
00163   vtkSetMacro(Shadow, int);
00164   vtkGetMacro(Shadow, int);
00165   vtkBooleanMacro(Shadow, int);
00167 
00169 
00172   vtkSetMacro(FontFamily, int);
00173   vtkGetMacro(FontFamily, int);
00174   void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00175   void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00176   void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00178 
00180 
00181   vtkSetStringMacro(LabelFormat);
00182   vtkGetStringMacro(LabelFormat);
00184 
00186 
00187   vtkSetStringMacro(Title);
00188   vtkGetStringMacro(Title);
00190 
00193   void ShallowCopy(vtkProp *prop);
00194 
00195 protected:
00196   vtkScalarBarActor();
00197   ~vtkScalarBarActor();
00198 
00199   vtkScalarsToColors *LookupTable;
00200   int   MaximumNumberOfColors;
00201   int   NumberOfLabels;
00202   int   NumberOfLabelsBuilt;
00203   int   Orientation;
00204   char  *Title;
00205 
00206   int   Bold;
00207   int   Italic;
00208   int   Shadow;
00209   int   FontFamily;
00210   char  *LabelFormat;
00211 
00212 private:
00213   vtkTextMapper *TitleMapper;
00214   vtkActor2D    *TitleActor;
00215 
00216   vtkTextMapper **TextMappers;
00217   vtkActor2D    **TextActors;
00218 
00219   vtkPolyData         *ScalarBar;
00220   vtkPolyDataMapper2D *ScalarBarMapper;
00221   vtkActor2D          *ScalarBarActor;
00222 
00223   vtkTimeStamp  BuildTime;
00224   int LastSize[2];
00225   int LastOrigin[2];
00226 
00227   void SizeTitle(int *titleSize, int *size, vtkViewport *viewport);
00228   void AllocateAndSizeLabels(int *labelSize, int *size,
00229                              vtkViewport *viewport, float *range);
00230 private:
00231   vtkScalarBarActor(const vtkScalarBarActor&);  // Not implemented.
00232   void operator=(const vtkScalarBarActor&);  // Not implemented.
00233 };
00234 
00235 
00236 #endif
00237 

Generated on Thu Mar 28 14:19:34 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001