VTK
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 -------------------------------------------------------------------------*/
00043 #ifndef __vtkQtTreeRingLabelMapper_h
00044 #define __vtkQtTreeRingLabelMapper_h
00045 
00046 #include "vtkRenderingQtModule.h" // For export macro
00047 #include "vtkLabeledDataMapper.h"
00048 
00049 //BTX
00050 class QImage;
00051 //ETX
00052 
00053 class vtkQImageToImageSource;
00054 class vtkCoordinate;
00055 class vtkDoubleArray;
00056 class vtkPlaneSource;
00057 class vtkPolyDataMapper2D;
00058 class vtkRenderer;
00059 class vtkStringArray;
00060 class vtkTexture;
00061 class vtkTextureMapToPlane;
00062 class vtkTree;
00063 class vtkUnicodeStringArray;
00064 
00065 class VTKRENDERINGQT_EXPORT vtkQtTreeRingLabelMapper : public vtkLabeledDataMapper
00066 {
00067 public:
00068   static vtkQtTreeRingLabelMapper *New();
00069   vtkTypeMacro(vtkQtTreeRingLabelMapper,vtkLabeledDataMapper);
00070   void PrintSelf(ostream& os, vtkIndent indent);
00071 
00073 
00074   virtual void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
00075   virtual void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
00077 
00079   virtual vtkTree *GetInputTree();
00080 
00082   virtual void SetSectorsArrayName(const char* name);
00083 
00085 
00088   virtual void SetLabelTextProperty(vtkTextProperty *p);
00089   vtkGetObjectMacro(LabelTextProperty,vtkTextProperty);
00090   virtual void SetLabelTextProperty(vtkTextProperty *p, int type)
00091     { this->Superclass::SetLabelTextProperty(p, type); }
00092   virtual vtkTextProperty* GetLabelTextProperty(int type)
00093     { return this->Superclass::GetLabelTextProperty(type); }
00095 
00097 
00098   vtkSetStringMacro(TextRotationArrayName);
00099   vtkGetStringMacro(TextRotationArrayName);
00101 
00104   virtual unsigned long GetMTime();
00105 
00106   void SetRenderer(vtkRenderer* ren)
00107     {
00108       if (this->Renderer != ren)
00109         {
00110         this->Renderer = ren;
00111         this->Modified();
00112         }
00113     }
00114   vtkRenderer* GetRenderer() { return this->Renderer; }
00115 
00116 protected:
00117   vtkQtTreeRingLabelMapper();
00118   ~vtkQtTreeRingLabelMapper();
00119   void LabelTree(vtkTree *tree, vtkDataArray *sectorInfo,
00120                  vtkDataArray *numericData, vtkStringArray *stringData, vtkUnicodeStringArray *uStringData,
00121                  int activeComp, int numComps, vtkViewport* viewport);
00122   void GetVertexLabel(vtkIdType vertex, vtkDataArray *numericData,
00123                       vtkStringArray *stringData,
00124                       vtkUnicodeStringArray *uStringData,
00125                       int activeComp, int numComps,
00126                       char *string);
00127 
00128   //Returns true if the center of the sector is in the window
00129   // along with the pixel dimensions (width, height)  of the sector
00130   bool PointInWindow(double *sinfo, double *newDim, double *textPosDC, vtkViewport *viewport);
00131 
00132   vtkViewport *CurrentViewPort;
00133   vtkCoordinate *VCoord;
00134   vtkQImageToImageSource* QtImageSource;
00135   vtkPlaneSource* PlaneSource;
00136   vtkRenderer* Renderer;
00137   vtkTextProperty *LabelTextProperty;
00138   vtkTexture* LabelTexture;
00139   vtkTextureMapToPlane* TextureMapToPlane;
00140   char* TextRotationArrayName;
00141   vtkPolyDataMapper2D* polyDataMapper;
00142   QImage* QtImage;
00143   int WindowSize[2];
00144 
00145 private:
00146   vtkQtTreeRingLabelMapper(const vtkQtTreeRingLabelMapper&);  // Not implemented.
00147   void operator=(const vtkQtTreeRingLabelMapper&);  // Not implemented.
00148 };
00149 
00150 
00151 #endif