VTK  9.2.5
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 
87 
89 
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:
122 
123  virtual void ComputeBounds();
124 
125  void Reset();
126 
127  bool CheckInputs();
128  bool CheckRebuild();
130  bool PlaceLabels();
132  virtual bool CreateLabels();
133  bool RenderLabels(vtkContext2D* painter);
134 
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
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:161
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:77
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:119
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:182
An actor that displays text.
an ordered list of vtkTextProperty objects.
represent text properties.
record modification and/or execution time
Definition: vtkTimeStamp.h:55
int vtkIdType
Definition: vtkType.h:332