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

contrib/vtkLegendBoxActor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkLegendBoxActor.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 =========================================================================*/
00068 #ifndef __vtkLegendBoxActor_h
00069 #define __vtkLegendBoxActor_h
00070 
00071 #include "vtkActor2D.h"
00072 #include "vtkTextMapper.h"
00073 
00074 class vtkActor;
00075 class vtkPolyData;
00076 class vtkPolyDataMapper;
00077 class vtkPolyDataMapper2D;
00078 class vtkTransformPolyDataFilter;
00079 class vtkTransform;
00080 
00081 class VTK_EXPORT vtkLegendBoxActor : public vtkActor2D
00082 {
00083 public:
00084   vtkTypeMacro(vtkLegendBoxActor,vtkActor2D);
00085   void PrintSelf(ostream& os, vtkIndent indent);
00086 
00089   static vtkLegendBoxActor *New();
00090 
00092   void SetNumberOfEntries(int num);
00093   int GetNumberOfEntries()
00094     {return this->NumberOfEntries;}
00095 
00104   void SetEntry(int i, vtkPolyData *symbol, const char* string, float color[3]);
00105   void SetEntrySymbol(int i, vtkPolyData *symbol);
00106   void SetEntryString(int i, const char* string);
00107   void SetEntryColor(int i, float color[3]);
00108   void SetEntryColor(int i, float r, float g, float b);
00109   vtkPolyData *GetEntrySymbol(int i);
00110   const char* GetEntryString(int i);
00111   float *GetEntryColor(int i);
00112 
00114   vtkSetMacro(Bold, int);
00115   vtkGetMacro(Bold, int);
00116   vtkBooleanMacro(Bold, int);
00117 
00119   vtkSetMacro(Italic, int);
00120   vtkGetMacro(Italic, int);
00121   vtkBooleanMacro(Italic, int);
00122 
00125   vtkSetMacro(Shadow, int);
00126   vtkGetMacro(Shadow, int);
00127   vtkBooleanMacro(Shadow, int);
00128 
00132   vtkSetMacro(FontFamily, int);
00133   vtkGetMacro(FontFamily, int);
00134   void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00135   void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00136   void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00137 
00140   vtkSetMacro(Border, int);
00141   vtkGetMacro(Border, int);
00142   vtkBooleanMacro(Border, int);
00143 
00150   vtkSetMacro(LockBorder, int);
00151   vtkGetMacro(LockBorder, int);
00152   vtkBooleanMacro(LockBorder, int);
00153 
00156   vtkSetClampMacro(Padding, int, 0, 50);
00157   vtkGetMacro(Padding, int);
00158 
00162   vtkSetMacro(ScalarVisibility,int);
00163   vtkGetMacro(ScalarVisibility,int);
00164   vtkBooleanMacro(ScalarVisibility,int);
00165 
00168   void ShallowCopy(vtkProp *prop);
00169 
00170 //BTX
00175   virtual void ReleaseGraphicsResources(vtkWindow *);
00176 
00180   int RenderOpaqueGeometry(vtkViewport* viewport);
00181   int RenderTranslucentGeometry(vtkViewport* ) {return 0;};
00182   int RenderOverlay(vtkViewport* viewport);
00183 //ETX
00184 
00185 protected:
00186   vtkLegendBoxActor();
00187   ~vtkLegendBoxActor();
00188   vtkLegendBoxActor(const vtkLegendBoxActor&) {};
00189   void operator=(const vtkLegendBoxActor&) {};
00190 
00191   void InitializeEntries();
00192 
00193   int   Bold;
00194   int   Italic;
00195   int   Shadow;
00196   int   FontFamily;
00197   int   Border;
00198   int   Padding;
00199   int   LockBorder;
00200   int   ScalarVisibility;
00201 
00202   // Internal actors, mappers, data to represent the legend
00203   int                        NumberOfEntries;
00204   int                        Size; //allocation size
00205   vtkFloatArray              *Colors;
00206   vtkTextMapper              **TextMapper;
00207   vtkActor2D                 **TextActor;
00208   vtkPolyData                **Symbol;
00209   vtkTransform               **Transform;
00210   vtkTransformPolyDataFilter **SymbolTransform;
00211   vtkPolyDataMapper2D        **SymbolMapper;
00212   vtkActor2D                 **SymbolActor;
00213   vtkPolyData                *BorderPolyData;
00214   vtkPolyDataMapper2D        *BorderMapper;
00215   vtkActor2D                 *BorderActor;
00216 
00217   // Used to control whether the stuff is recomputed
00218   int           LegendEntriesVisible;
00219   int           CachedSize[2];
00220   vtkTimeStamp  BuildTime;
00221 
00222 };
00223 
00224 
00225 #endif
00226 

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