VTK  9.3.0
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 
76 
78 
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:
111 
112  virtual void ComputeBounds();
113 
114  void Reset();
115 
116  bool CheckInputs();
117  bool CheckRebuild();
119  bool PlaceLabels();
121  virtual bool CreateLabels();
122  bool RenderLabels(vtkContext2D* painter);
123 
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
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:50
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:29
Filter that translate a vtkPolyData 2D mesh into vtkContextItems.
virtual void SetTextPropertyMapping(vtkDoubleArray *mapping)
Values in this array correspond to vtkTextProperty objects in the TextProperties collection.
virtual void SetTextProperty(vtkTextProperty *tprop)
The text property used to label the lines.
bool AllocateTextActors(vtkIdType num)
vtkSmartPointer< vtkDoubleArray > TextPropertyMapping
vtkSmartPointer< vtkTextPropertyCollection > TextProperties
virtual void SetTextProperties(vtkTextPropertyCollection *coll)
The text properties used to label the lines.
bool RenderLabels(vtkContext2D *painter)
static vtkLabeledContourPolyDataItem * New()
virtual vtkTextPropertyCollection * GetTextProperties()
The text properties used to label the lines.
bool Paint(vtkContext2D *painter) override
Paint event for the item.
virtual vtkDoubleArray * GetTextPropertyMapping()
Values in this array correspond to vtkTextProperty objects in the TextProperties collection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkLabeledContourPolyDataItem() override
Filter that translate a vtkPolyData 2D mesh into vtkContextItems.
abstract specification for renderers
Definition: vtkRenderer.h:62
An actor that displays text.
an ordered list of vtkTextProperty objects.
represent text properties.
record modification and/or execution time
Definition: vtkTimeStamp.h:25
int vtkIdType
Definition: vtkType.h:315