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

Hybrid/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 =========================================================================*/
00066 #ifndef __vtkLegendBoxActor_h
00067 #define __vtkLegendBoxActor_h
00068 
00069 #include "vtkActor2D.h"
00070 #include "vtkTextMapper.h"
00071 
00072 class vtkActor;
00073 class vtkPolyData;
00074 class vtkPolyDataMapper;
00075 class vtkPolyDataMapper2D;
00076 class vtkTransformPolyDataFilter;
00077 class vtkTransform;
00078 
00079 class VTK_HYBRID_EXPORT vtkLegendBoxActor : public vtkActor2D
00080 {
00081 public:
00082   vtkTypeMacro(vtkLegendBoxActor,vtkActor2D);
00083   void PrintSelf(ostream& os, vtkIndent indent);
00084 
00087   static vtkLegendBoxActor *New();
00088 
00090 
00091   void SetNumberOfEntries(int num);
00092   int GetNumberOfEntries()
00093     {return this->NumberOfEntries;}
00095 
00097 
00105   void SetEntry(int i, vtkPolyData *symbol, const char* string, float color[3]);
00106   void SetEntrySymbol(int i, vtkPolyData *symbol);
00107   void SetEntryString(int i, const char* string);
00108   void SetEntryColor(int i, float color[3]);
00109   void SetEntryColor(int i, float r, float g, float b);
00110   vtkPolyData *GetEntrySymbol(int i);
00111   const char* GetEntryString(int i);
00112   float *GetEntryColor(int i);
00114 
00116 
00117   vtkSetMacro(Bold, int);
00118   vtkGetMacro(Bold, int);
00119   vtkBooleanMacro(Bold, int);
00121 
00123 
00124   vtkSetMacro(Italic, int);
00125   vtkGetMacro(Italic, int);
00126   vtkBooleanMacro(Italic, int);
00128 
00130 
00132   vtkSetMacro(Shadow, int);
00133   vtkGetMacro(Shadow, int);
00134   vtkBooleanMacro(Shadow, int);
00136 
00138 
00141   vtkSetMacro(FontFamily, int);
00142   vtkGetMacro(FontFamily, int);
00143   void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00144   void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00145   void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00147 
00149 
00151   vtkSetMacro(Border, int);
00152   vtkGetMacro(Border, int);
00153   vtkBooleanMacro(Border, int);
00155 
00157 
00163   vtkSetMacro(LockBorder, int);
00164   vtkGetMacro(LockBorder, int);
00165   vtkBooleanMacro(LockBorder, int);
00167 
00169 
00171   vtkSetClampMacro(Padding, int, 0, 50);
00172   vtkGetMacro(Padding, int);
00174 
00176 
00179   vtkSetMacro(ScalarVisibility,int);
00180   vtkGetMacro(ScalarVisibility,int);
00181   vtkBooleanMacro(ScalarVisibility,int);
00183 
00186   void ShallowCopy(vtkProp *prop);
00187 
00188 //BTX
00193   virtual void ReleaseGraphicsResources(vtkWindow *);
00194 
00196 
00199   int RenderOpaqueGeometry(vtkViewport* viewport);
00200   int RenderTranslucentGeometry(vtkViewport* ) {return 0;};
00201   int RenderOverlay(vtkViewport* viewport);
00203 //ETX
00204 
00205 protected:
00206   vtkLegendBoxActor();
00207   ~vtkLegendBoxActor();
00208 
00209   void InitializeEntries();
00210 
00211   int   Bold;
00212   int   Italic;
00213   int   Shadow;
00214   int   FontFamily;
00215   int   Border;
00216   int   Padding;
00217   int   LockBorder;
00218   int   ScalarVisibility;
00219 
00220   // Internal actors, mappers, data to represent the legend
00221   int                        NumberOfEntries;
00222   int                        Size; //allocation size
00223   vtkFloatArray              *Colors;
00224   vtkTextMapper              **TextMapper;
00225   vtkActor2D                 **TextActor;
00226   vtkPolyData                **Symbol;
00227   vtkTransform               **Transform;
00228   vtkTransformPolyDataFilter **SymbolTransform;
00229   vtkPolyDataMapper2D        **SymbolMapper;
00230   vtkActor2D                 **SymbolActor;
00231   vtkPolyData                *BorderPolyData;
00232   vtkPolyDataMapper2D        *BorderMapper;
00233   vtkActor2D                 *BorderActor;
00234 
00235   // Used to control whether the stuff is recomputed
00236   int           LegendEntriesVisible;
00237   int           CachedSize[2];
00238   vtkTimeStamp  BuildTime;
00239 
00240 private:
00241   vtkLegendBoxActor(const vtkLegendBoxActor&);  // Not implemented.
00242   void operator=(const vtkLegendBoxActor&);  // Not implemented.
00243 };
00244 
00245 
00246 #endif
00247 

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