VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class vtkActor;
26 class vtkContext2D;
27 class vtkDoubleArray;
28 class vtkRenderer;
29 class vtkTextActor3D;
30 class vtkTextProperty;
32 struct PDILabelHelper;
33 
34 class VTKRENDERINGCONTEXT2D_EXPORT VTK_MARSHALAUTO vtkLabeledContourPolyDataItem
35  : public vtkPolyDataItem
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
46  bool Paint(vtkContext2D* painter) override;
47 
55  virtual void SetTextProperty(vtkTextProperty* tprop);
56 
58 
75  virtual void SetTextProperties(vtkTextPropertyCollection* coll);
76  virtual vtkTextPropertyCollection* GetTextProperties();
78 
80 
86  virtual vtkDoubleArray* GetTextPropertyMapping();
87  virtual void SetTextPropertyMapping(vtkDoubleArray* mapping);
89 
91 
96  vtkSetMacro(LabelVisibility, bool);
97  vtkGetMacro(LabelVisibility, bool);
98  vtkBooleanMacro(LabelVisibility, bool);
100 
102 
106  vtkSetMacro(SkipDistance, double);
107  vtkGetMacro(SkipDistance, double);
109 
110 protected:
112  ~vtkLabeledContourPolyDataItem() override;
113 
114  virtual void ComputeBounds();
115 
116  void Reset();
117 
118  bool CheckInputs();
119  bool CheckRebuild();
120  bool PrepareRender();
121  bool PlaceLabels();
122  bool ResolveLabels();
123  virtual bool CreateLabels();
124  bool RenderLabels(vtkContext2D* painter);
125 
126  bool AllocateTextActors(vtkIdType num);
127  bool FreeTextActors();
128 
129  double SkipDistance;
130 
135 
136  PDILabelHelper** LabelHelpers;
137 
140 
142 
143 private:
145  void operator=(const vtkLabeledContourPolyDataItem&) = delete;
146 
147  struct Private;
148  Private* Internal;
149 };
150 
151 VTK_ABI_NAMESPACE_END
152 #endif
static vtkPolyDataItem * New()
vtkSmartPointer< vtkTextPropertyCollection > TextProperties
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
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:63
int vtkIdType
Definition: vtkType.h:363
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.
#define VTK_MARSHALAUTO
Filter that translate a vtkPolyData 2D mesh into vtkContextItems.