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