VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/Qt/vtkQtTreeRingLabelMapper.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQtTreeRingLabelMapper.h
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 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00046 #ifndef vtkQtTreeRingLabelMapper_h
00047 #define vtkQtTreeRingLabelMapper_h
00048 
00049 #include "vtkRenderingQtModule.h" // For export macro
00050 #include "vtkLabeledDataMapper.h"
00051 
00052 //BTX
00053 class QImage;
00054 //ETX
00055 
00056 class vtkQImageToImageSource;
00057 class vtkCoordinate;
00058 class vtkDoubleArray;
00059 class vtkPlaneSource;
00060 class vtkPolyDataMapper2D;
00061 class vtkRenderer;
00062 class vtkStringArray;
00063 class vtkTexture;
00064 class vtkTextureMapToPlane;
00065 class vtkTree;
00066 class vtkUnicodeStringArray;
00067 
00068 class VTKRENDERINGQT_EXPORT vtkQtTreeRingLabelMapper : public vtkLabeledDataMapper
00069 {
00070 public:
00071   static vtkQtTreeRingLabelMapper *New();
00072   vtkTypeMacro(vtkQtTreeRingLabelMapper,vtkLabeledDataMapper);
00073   void PrintSelf(ostream& os, vtkIndent indent);
00074 
00076 
00077   virtual void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
00078   virtual void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
00080 
00082   virtual vtkTree *GetInputTree();
00083 
00085   virtual void SetSectorsArrayName(const char* name);
00086 
00088 
00091   virtual void SetLabelTextProperty(vtkTextProperty *p);
00092   vtkGetObjectMacro(LabelTextProperty,vtkTextProperty);
00093   virtual void SetLabelTextProperty(vtkTextProperty *p, int type)
00094     { this->Superclass::SetLabelTextProperty(p, type); }
00095   virtual vtkTextProperty* GetLabelTextProperty(int type)
00096     { return this->Superclass::GetLabelTextProperty(type); }
00098 
00100 
00101   vtkSetStringMacro(TextRotationArrayName);
00102   vtkGetStringMacro(TextRotationArrayName);
00104 
00107   virtual unsigned long GetMTime();
00108 
00109   void SetRenderer(vtkRenderer* ren)
00110     {
00111       if (this->Renderer != ren)
00112         {
00113         this->Renderer = ren;
00114         this->Modified();
00115         }
00116     }
00117   vtkRenderer* GetRenderer() { return this->Renderer; }
00118 
00119 protected:
00120   vtkQtTreeRingLabelMapper();
00121   ~vtkQtTreeRingLabelMapper();
00122   void LabelTree(vtkTree *tree, vtkDataArray *sectorInfo,
00123                  vtkDataArray *numericData, vtkStringArray *stringData, vtkUnicodeStringArray *uStringData,
00124                  int activeComp, int numComps, vtkViewport* viewport);
00125   void GetVertexLabel(vtkIdType vertex, vtkDataArray *numericData,
00126                       vtkStringArray *stringData,
00127                       vtkUnicodeStringArray *uStringData,
00128                       int activeComp, int numComps,
00129                       char *string);
00130 
00131   //Returns true if the center of the sector is in the window
00132   // along with the pixel dimensions (width, height)  of the sector
00133   bool PointInWindow(double *sinfo, double *newDim, double *textPosDC, vtkViewport *viewport);
00134 
00135   vtkViewport *CurrentViewPort;
00136   vtkCoordinate *VCoord;
00137   vtkQImageToImageSource* QtImageSource;
00138   vtkPlaneSource* PlaneSource;
00139   vtkRenderer* Renderer;
00140   vtkTextProperty *LabelTextProperty;
00141   vtkTexture* LabelTexture;
00142   vtkTextureMapToPlane* TextureMapToPlane;
00143   char* TextRotationArrayName;
00144   vtkPolyDataMapper2D* polyDataMapper;
00145   QImage* QtImage;
00146   int WindowSize[2];
00147 
00148 private:
00149   vtkQtTreeRingLabelMapper(const vtkQtTreeRingLabelMapper&);  // Not implemented.
00150   void operator=(const vtkQtTreeRingLabelMapper&);  // Not implemented.
00151 };
00152 
00153 
00154 #endif