VTK
vtkQtTreeRingLabelMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtTreeRingLabelMapper.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
47 #ifndef vtkQtTreeRingLabelMapper_h
48 #define vtkQtTreeRingLabelMapper_h
49 
50 #include "vtkRenderingQtModule.h" // For export macro
51 #include "vtkLabeledDataMapper.h"
52 
53 class QImage;
54 
56 class vtkCoordinate;
57 class vtkDoubleArray;
58 class vtkPlaneSource;
60 class vtkRenderer;
61 class vtkStringArray;
62 class vtkTexture;
64 class vtkTree;
66 
67 class VTKRENDERINGQT_EXPORT vtkQtTreeRingLabelMapper : public vtkLabeledDataMapper
68 {
69 public:
70  static vtkQtTreeRingLabelMapper *New();
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
75 
78  void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor) override;
79  void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override;
81 
85  virtual vtkTree *GetInputTree();
86 
90  virtual void SetSectorsArrayName(const char* name);
91 
93 
98  void SetLabelTextProperty(vtkTextProperty *p) override;
100  { return this->LabelTextProperty; }
102  { this->Superclass::SetLabelTextProperty(p, type); }
104  { return this->Superclass::GetLabelTextProperty(type); }
106 
108 
111  vtkSetStringMacro(TextRotationArrayName);
112  vtkGetStringMacro(TextRotationArrayName);
114 
119  vtkMTimeType GetMTime() override;
120 
122  {
123  if (this->Renderer != ren)
124  {
125  this->Renderer = ren;
126  this->Modified();
127  }
128  }
129  vtkRenderer* GetRenderer() { return this->Renderer; }
130 
131 protected:
133  ~vtkQtTreeRingLabelMapper() override;
134  void LabelTree(vtkTree *tree, vtkDataArray *sectorInfo,
135  vtkDataArray *numericData, vtkStringArray *stringData, vtkUnicodeStringArray *uStringData,
136  int activeComp, int numComps, vtkViewport* viewport);
137  void GetVertexLabel(vtkIdType vertex, vtkDataArray *numericData,
138  vtkStringArray *stringData,
139  vtkUnicodeStringArray *uStringData,
140  int activeComp, int numComps,
141  char *string, size_t stringSize);
142 
143  //Returns true if the center of the sector is in the window
144  // along with the pixel dimensions (width, height) of the sector
145  bool PointInWindow(double *sinfo, double *newDim, double *textPosDC, vtkViewport *viewport);
146 
157  QImage* QtImage;
158  int WindowSize[2];
159 
160 private:
162  void operator=(const vtkQtTreeRingLabelMapper&) = delete;
163 };
164 
165 
166 #endif
Create image data from a QImage.
draw text labels on a tree map
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetLabelTextProperty(vtkTextProperty *p, int type) override
Set/Get the text property.
Subclass of vtkAbstractArray that holds vtkUnicodeStrings.
static vtkLabeledDataMapper * New()
Instantiate object with %%-#6.3g label format.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
abstract specification for Viewports
Definition: vtkViewport.h:47
a actor that draws 2D data
Definition: vtkActor2D.h:45
a vtkAbstractArray subclass for strings
abstract specification for renderers
Definition: vtkRenderer.h:63
int vtkIdType
Definition: vtkType.h:345
dynamic, self-adjusting array of double
draw text labels at dataset points
vtkTextProperty * GetLabelTextProperty(int type) override
Set/Get the text property.
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetRenderer(vtkRenderer *ren)
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkTextProperty * GetLabelTextProperty() override
Set/Get the text property.
handles properties associated with a texture map
Definition: vtkTexture.h:71
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
virtual void Modified()
Update the modification time for this object.
vtkQImageToImageSource * QtImageSource
represent text properties.
create an array of quadrilaterals located in a plane
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:78
vtkTextureMapToPlane * TextureMapToPlane
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override
Draw the text to the screen at each input point.
vtkPolyDataMapper2D * polyDataMapper
vtkMTimeType GetMTime() override
Return the modified time for this object.
A rooted tree data structure.
Definition: vtkTree.h:60
void RenderOpaqueGeometry(vtkViewport *viewport, vtkActor2D *actor) override
Draw the text to the screen at each input point.
draw vtkPolyData onto the image plane
generate texture coordinates by mapping points to plane
virtual void SetLabelTextProperty(vtkTextProperty *p)
Set/Get the text property.