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

vtkLegendBoxActor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkLegendBoxActor.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 =========================================================================*/
00049 #ifndef __vtkLegendBoxActor_h
00050 #define __vtkLegendBoxActor_h
00051 
00052 #include "vtkActor2D.h"
00053 
00054 class vtkActor;
00055 class vtkDoubleArray;
00056 class vtkPolyData;
00057 class vtkPolyDataMapper2D;
00058 class vtkPolyDataMapper;
00059 class vtkTextMapper;
00060 class vtkTextProperty;
00061 class vtkTransform;
00062 class vtkTransformPolyDataFilter;
00063 class vtkProperty2D;
00064 
00065 class VTK_HYBRID_EXPORT vtkLegendBoxActor : public vtkActor2D
00066 {
00067 public:
00068   vtkTypeRevisionMacro(vtkLegendBoxActor,vtkActor2D);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00070 
00073   static vtkLegendBoxActor *New();
00074 
00076 
00077   void SetNumberOfEntries(int num);
00078   int GetNumberOfEntries()
00079     {return this->NumberOfEntries;}
00081 
00083 
00091   void SetEntry(int i, vtkPolyData *symbol, const char* string, double color[3]);
00092   void SetEntrySymbol(int i, vtkPolyData *symbol);
00093   void SetEntryString(int i, const char* string);
00094   void SetEntryColor(int i, double color[3]);
00095   void SetEntryColor(int i, double r, double g, double b);
00096   vtkPolyData *GetEntrySymbol(int i);
00097   const char* GetEntryString(int i);
00098   double *GetEntryColor(int i);
00100 
00102 
00103   virtual void SetEntryTextProperty(vtkTextProperty *p);
00104   vtkGetObjectMacro(EntryTextProperty,vtkTextProperty);
00106 
00108 
00110   vtkSetMacro(Border, int);
00111   vtkGetMacro(Border, int);
00112   vtkBooleanMacro(Border, int);
00114 
00116 
00122   vtkSetMacro(LockBorder, int);
00123   vtkGetMacro(LockBorder, int);
00124   vtkBooleanMacro(LockBorder, int);
00126 
00128 
00130   vtkSetMacro(Box, int);
00131   vtkGetMacro(Box, int);
00132   vtkBooleanMacro(Box, int);
00134 
00136   vtkProperty2D* GetBoxProperty() { return this->BoxActor->GetProperty(); };
00137 
00139 
00141   vtkSetClampMacro(Padding, int, 0, 50);
00142   vtkGetMacro(Padding, int);
00144 
00146 
00149   vtkSetMacro(ScalarVisibility,int);
00150   vtkGetMacro(ScalarVisibility,int);
00151   vtkBooleanMacro(ScalarVisibility,int);
00153 
00156   void ShallowCopy(vtkProp *prop);
00157 
00158 //BTX
00163   virtual void ReleaseGraphicsResources(vtkWindow *);
00164 
00166 
00169   int RenderOpaqueGeometry(vtkViewport* viewport);
00170   int RenderTranslucentGeometry(vtkViewport* ) {return 0;};
00171   int RenderOverlay(vtkViewport* viewport);
00173 //ETX
00174 
00175 protected:
00176   vtkLegendBoxActor();
00177   ~vtkLegendBoxActor();
00178 
00179   void InitializeEntries();
00180 
00181 
00182   int   Border;
00183   int   Box;
00184   int   Padding;
00185   int   LockBorder;
00186   int   ScalarVisibility;
00187   double BoxOpacity;
00188 
00189   // Internal actors, mappers, data to represent the legend
00190   int                        NumberOfEntries;
00191   int                        Size; //allocation size
00192   vtkDoubleArray              *Colors;
00193   vtkTextMapper              **TextMapper;
00194   vtkActor2D                 **TextActor;
00195   vtkPolyData                **Symbol;
00196   vtkTransform               **Transform;
00197   vtkTransformPolyDataFilter **SymbolTransform;
00198   vtkPolyDataMapper2D        **SymbolMapper;
00199   vtkActor2D                 **SymbolActor;
00200   vtkPolyData                *BorderPolyData;
00201   vtkPolyDataMapper2D        *BorderMapper;
00202   vtkActor2D                 *BorderActor;
00203   vtkPolyData                *BoxPolyData;
00204   vtkPolyDataMapper2D        *BoxMapper;
00205   vtkActor2D                 *BoxActor;
00206   vtkTextProperty            *EntryTextProperty;
00207 
00208   // Used to control whether the stuff is recomputed
00209   int           LegendEntriesVisible;
00210   int           CachedSize[2];
00211   vtkTimeStamp  BuildTime;
00212 
00213 private:
00214   vtkLegendBoxActor(const vtkLegendBoxActor&);  // Not implemented.
00215   void operator=(const vtkLegendBoxActor&);  // Not implemented.
00216 };
00217 
00218 
00219 #endif
00220