VTK  9.2.6
vtkLabeledContourPolyDataItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLabeledContourPolyDataItem.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 =========================================================================*/
27 #ifndef vtkLabeledContourPolyDataItem_h
28 #define vtkLabeledContourPolyDataItem_h
29 
30 #include "vtkPolyDataItem.h"
31 #include "vtkRect.h" // For vtkRect/vtkVector/vtkTuple
32 #include "vtkRenderingContext2DModule.h" // For export macro
33 #include "vtkSmartPointer.h" // For vtkSmartPointer
34 
35 class vtkActor;
36 class vtkContext2D;
37 class vtkDoubleArray;
38 class vtkRenderer;
39 class vtkTextActor3D;
40 class vtkTextProperty;
42 struct PDILabelHelper;
43 
44 class VTKRENDERINGCONTEXT2D_EXPORT vtkLabeledContourPolyDataItem : public vtkPolyDataItem
45 {
46 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
55  bool Paint(vtkContext2D* painter) override;
56 
64  virtual void SetTextProperty(vtkTextProperty* tprop);
65 
67 
84  virtual void SetTextProperties(vtkTextPropertyCollection* coll);
85  virtual vtkTextPropertyCollection* GetTextProperties();
87 
89 
95  virtual vtkDoubleArray* GetTextPropertyMapping();
96  virtual void SetTextPropertyMapping(vtkDoubleArray* mapping);
98 
100 
105  vtkSetMacro(LabelVisibility, bool);
106  vtkGetMacro(LabelVisibility, bool);
107  vtkBooleanMacro(LabelVisibility, bool);
109 
111 
115  vtkSetMacro(SkipDistance, double);
116  vtkGetMacro(SkipDistance, double);
118 
119 protected:
121  ~vtkLabeledContourPolyDataItem() override;
122 
123  virtual void ComputeBounds();
124 
125  void Reset();
126 
127  bool CheckInputs();
128  bool CheckRebuild();
129  bool PrepareRender();
130  bool PlaceLabels();
131  bool ResolveLabels();
132  virtual bool CreateLabels();
133  bool RenderLabels(vtkContext2D* painter);
134 
135  bool AllocateTextActors(vtkIdType num);
136  bool FreeTextActors();
137 
138  double SkipDistance;
139 
144 
145  PDILabelHelper** LabelHelpers;
146 
149 
151 
152 private:
154  void operator=(const vtkLabeledContourPolyDataItem&) = delete;
155 
156  struct Private;
157  Private* Internal;
158 };
159 
160 #endif
static vtkPolyDataItem * New()
vtkSmartPointer< vtkTextPropertyCollection > TextProperties
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
bool Paint(vtkContext2D *painter) override
Paint event for the item.
record modification and/or execution time
Definition: vtkTimeStamp.h:35
abstract specification for renderers
Definition: vtkRenderer.h:72
int vtkIdType
Definition: vtkType.h:332
an ordered list of vtkTextProperty objects.
dynamic, self-adjusting array of double
Filter that translate a vtkPolyData 2D mesh into vtkContextItems.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
a simple class to control print indentation
Definition: vtkIndent.h:39
An actor that displays text.
represent text properties.
vtkSmartPointer< vtkDoubleArray > TextPropertyMapping
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Filter that translate a vtkPolyData 2D mesh into vtkContextItems.