VTK  9.0.1
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 -------------------------------------------------------------------------*/
44 #ifndef vtkQtTreeRingLabelMapper_h
45 #define vtkQtTreeRingLabelMapper_h
46 
47 #include "vtkLabeledDataMapper.h"
48 #include "vtkRenderingQtModule.h" // For export macro
49 
50 class QImage;
51 
53 class vtkCoordinate;
54 class vtkDoubleArray;
55 class vtkPlaneSource;
57 class vtkRenderer;
58 class vtkStringArray;
59 class vtkTexture;
61 class vtkTree;
63 
64 class VTKRENDERINGQT_EXPORT vtkQtTreeRingLabelMapper : public vtkLabeledDataMapper
65 {
66 public:
67  static vtkQtTreeRingLabelMapper* New();
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
72 
75  void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor) override;
76  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
78 
82  virtual vtkTree* GetInputTree();
83 
87  virtual void SetSectorsArrayName(const char* name);
88 
90 
95  void SetLabelTextProperty(vtkTextProperty* p) override;
96  vtkTextProperty* GetLabelTextProperty() override { return this->LabelTextProperty; }
97  void SetLabelTextProperty(vtkTextProperty* p, int type) override
98  {
99  this->Superclass::SetLabelTextProperty(p, type);
100  }
102  {
103  return this->Superclass::GetLabelTextProperty(type);
104  }
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, vtkDataArray* numericData,
135  vtkStringArray* stringData, vtkUnicodeStringArray* uStringData, int activeComp, int numComps,
136  vtkViewport* viewport);
137  void GetVertexLabel(vtkIdType vertex, vtkDataArray* numericData, vtkStringArray* stringData,
138  vtkUnicodeStringArray* uStringData, int activeComp, int numComps, char* string,
139  size_t stringSize);
140 
141  // Returns true if the center of the sector is in the window
142  // along with the pixel dimensions (width, height) of the sector
143  bool PointInWindow(double* sinfo, double* newDim, double* textPosDC, vtkViewport* viewport);
144 
155  QImage* QtImage;
156  int WindowSize[2];
157 
158 private:
160  void operator=(const vtkQtTreeRingLabelMapper&) = delete;
161 };
162 
163 #endif
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:44
vtkLabeledDataMapper::SetLabelTextProperty
virtual void SetLabelTextProperty(vtkTextProperty *p)
Set/Get the text property.
Definition: vtkLabeledDataMapper.h:175
vtkQtTreeRingLabelMapper::Renderer
vtkRenderer * Renderer
Definition: vtkQtTreeRingLabelMapper.h:149
vtkUnicodeStringArray
Subclass of vtkAbstractArray that holds vtkUnicodeStrings.
Definition: vtkUnicodeStringArray.h:39
vtkLabeledDataMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkQtTreeRingLabelMapper::TextRotationArrayName
char * TextRotationArrayName
Definition: vtkQtTreeRingLabelMapper.h:153
vtkPlaneSource
create an array of quadrilaterals located in a plane
Definition: vtkPlaneSource.h:54
vtkObject::Modified
virtual void Modified()
Update the modification time for this object.
vtkLabeledDataMapper::RenderOpaqueGeometry
void RenderOpaqueGeometry(vtkViewport *viewport, vtkActor2D *actor) override
Draw the text to the screen at each input point.
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkQtTreeRingLabelMapper::PlaneSource
vtkPlaneSource * PlaneSource
Definition: vtkQtTreeRingLabelMapper.h:148
vtkQtTreeRingLabelMapper::GetRenderer
vtkRenderer * GetRenderer()
Definition: vtkQtTreeRingLabelMapper.h:129
vtkTree
A rooted tree data structure.
Definition: vtkTree.h:54
vtkTextureMapToPlane
generate texture coordinates by mapping points to plane
Definition: vtkTextureMapToPlane.h:46
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:65
vtkQtTreeRingLabelMapper::QtImageSource
vtkQImageToImageSource * QtImageSource
Definition: vtkQtTreeRingLabelMapper.h:147
vtkLabeledDataMapper::RenderOverlay
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override
vtkQtTreeRingLabelMapper::VCoord
vtkCoordinate * VCoord
Definition: vtkQtTreeRingLabelMapper.h:146
vtkQtTreeRingLabelMapper::LabelTexture
vtkTexture * LabelTexture
Definition: vtkQtTreeRingLabelMapper.h:151
vtkLabeledDataMapper::GetMTime
vtkMTimeType GetMTime() override
Return the modified time for this object.
vtkQImageToImageSource
Create image data from a QImage.
Definition: vtkQImageToImageSource.h:30
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkLabeledDataMapper::New
static vtkLabeledDataMapper * New()
Instantiate object with %%-#6.3g label format.
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:76
vtkQtTreeRingLabelMapper::SetLabelTextProperty
void SetLabelTextProperty(vtkTextProperty *p, int type) override
Definition: vtkQtTreeRingLabelMapper.h:97
vtkQtTreeRingLabelMapper::QtImage
QImage * QtImage
Definition: vtkQtTreeRingLabelMapper.h:155
vtkQtTreeRingLabelMapper::LabelTextProperty
vtkTextProperty * LabelTextProperty
Definition: vtkQtTreeRingLabelMapper.h:150
vtkQtTreeRingLabelMapper::CurrentViewPort
vtkViewport * CurrentViewPort
Definition: vtkQtTreeRingLabelMapper.h:145
vtkQtTreeRingLabelMapper::GetLabelTextProperty
vtkTextProperty * GetLabelTextProperty(int type) override
Definition: vtkQtTreeRingLabelMapper.h:101
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:33
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkLabeledDataMapper
draw text labels at dataset points
Definition: vtkLabeledDataMapper.h:70
vtkQtTreeRingLabelMapper::polyDataMapper
vtkPolyDataMapper2D * polyDataMapper
Definition: vtkQtTreeRingLabelMapper.h:154
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:67
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:36
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:35
vtkQtTreeRingLabelMapper::TextureMapToPlane
vtkTextureMapToPlane * TextureMapToPlane
Definition: vtkQtTreeRingLabelMapper.h:152
vtkQtTreeRingLabelMapper::SetRenderer
void SetRenderer(vtkRenderer *ren)
Definition: vtkQtTreeRingLabelMapper.h:121
vtkQtTreeRingLabelMapper
draw text labels on a tree map
Definition: vtkQtTreeRingLabelMapper.h:64
vtkLabeledDataMapper.h
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
vtkQtTreeRingLabelMapper::GetLabelTextProperty
vtkTextProperty * GetLabelTextProperty() override
Definition: vtkQtTreeRingLabelMapper.h:96