VTK  9.3.1
vtkLabeledContourPolyDataItem.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkLabeledContourPolyDataItem_h
16 #define vtkLabeledContourPolyDataItem_h
17 
18 #include "vtkPolyDataItem.h"
19 #include "vtkRect.h" // For vtkRect/vtkVector/vtkTuple
20 #include "vtkRenderingContext2DModule.h" // For export macro
21 #include "vtkSmartPointer.h" // For vtkSmartPointer
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkActor;
25 class vtkContext2D;
26 class vtkDoubleArray;
27 class vtkRenderer;
28 class vtkTextActor3D;
29 class vtkTextProperty;
31 struct PDILabelHelper;
32 
33 class VTKRENDERINGCONTEXT2D_EXPORT vtkLabeledContourPolyDataItem : public vtkPolyDataItem
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
40 
44  bool Paint(vtkContext2D* painter) override;
45 
53  virtual void SetTextProperty(vtkTextProperty* tprop);
54 
56 
73  virtual void SetTextProperties(vtkTextPropertyCollection* coll);
74  virtual vtkTextPropertyCollection* GetTextProperties();
76 
78 
84  virtual vtkDoubleArray* GetTextPropertyMapping();
85  virtual void SetTextPropertyMapping(vtkDoubleArray* mapping);
87 
89 
94  vtkSetMacro(LabelVisibility, bool);
95  vtkGetMacro(LabelVisibility, bool);
96  vtkBooleanMacro(LabelVisibility, bool);
98 
100 
104  vtkSetMacro(SkipDistance, double);
105  vtkGetMacro(SkipDistance, double);
107 
108 protected:
110  ~vtkLabeledContourPolyDataItem() override;
111 
112  virtual void ComputeBounds();
113 
114  void Reset();
115 
116  bool CheckInputs();
117  bool CheckRebuild();
118  bool PrepareRender();
119  bool PlaceLabels();
120  bool ResolveLabels();
121  virtual bool CreateLabels();
122  bool RenderLabels(vtkContext2D* painter);
123 
124  bool AllocateTextActors(vtkIdType num);
125  bool FreeTextActors();
126 
127  double SkipDistance;
128 
133 
134  PDILabelHelper** LabelHelpers;
135 
138 
140 
141 private:
143  void operator=(const vtkLabeledContourPolyDataItem&) = delete;
144 
145  struct Private;
146  Private* Internal;
147 };
148 
149 VTK_ABI_NAMESPACE_END
150 #endif
static vtkPolyDataItem * New()
vtkSmartPointer< vtkTextPropertyCollection > TextProperties
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
bool Paint(vtkContext2D *painter) override
Paint event for the item.
record modification and/or execution time
Definition: vtkTimeStamp.h:24
abstract specification for renderers
Definition: vtkRenderer.h:61
int vtkIdType
Definition: vtkType.h:315
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:49
a simple class to control print indentation
Definition: vtkIndent.h:28
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.