VTK  9.0.1
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 =========================================================================*/
24 #ifndef vtkLabeledContourPolyDataItem_h
25 #define vtkLabeledContourPolyDataItem_h
26 
27 #include "vtkPolyDataItem.h"
28 #include "vtkRect.h" // For vtkRect/vtkVector/vtkTuple
29 #include "vtkRenderingContext2DModule.h" // For export macro
30 #include "vtkSmartPointer.h" // For vtkSmartPointer
31 
32 class vtkActor;
33 class vtkContext2D;
34 class vtkDoubleArray;
35 class vtkRenderer;
36 class vtkTextActor3D;
37 class vtkTextProperty;
39 struct PDILabelHelper;
40 
41 class VTKRENDERINGCONTEXT2D_EXPORT vtkLabeledContourPolyDataItem : public vtkPolyDataItem
42 {
43 public:
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
52  bool Paint(vtkContext2D* painter) override;
53 
61  virtual void SetTextProperty(vtkTextProperty* tprop);
62 
64 
84 
86 
93  virtual void SetTextPropertyMapping(vtkDoubleArray* mapping);
95 
97 
102  vtkSetMacro(LabelVisibility, bool);
103  vtkGetMacro(LabelVisibility, bool);
104  vtkBooleanMacro(LabelVisibility, bool);
106 
108 
112  vtkSetMacro(SkipDistance, double);
113  vtkGetMacro(SkipDistance, double);
115 
116 protected:
119 
120  virtual void ComputeBounds();
121 
122  void Reset();
123 
124  bool CheckInputs();
125  bool CheckRebuild();
127  bool PlaceLabels();
129  virtual bool CreateLabels();
130  bool RenderLabels(vtkContext2D* painter);
131 
134 
135  double SkipDistance;
136 
141 
142  PDILabelHelper** LabelHelpers;
143 
146 
148 
149 private:
151  void operator=(const vtkLabeledContourPolyDataItem&) = delete;
152 
153  struct Private;
154  Private* Internal;
155 };
156 
157 #endif
vtkPolyDataItem.h
vtkLabeledContourPolyDataItem::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLabeledContourPolyDataItem::TextActors
vtkTextActor3D ** TextActors
Definition: vtkLabeledContourPolyDataItem.h:140
vtkLabeledContourPolyDataItem::PlaceLabels
bool PlaceLabels()
vtkLabeledContourPolyDataItem::SetTextProperties
virtual void SetTextProperties(vtkTextPropertyCollection *coll)
The text properties used to label the lines.
vtkLabeledContourPolyDataItem::Reset
void Reset()
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkTextActor3D
An actor that displays text.
Definition: vtkTextActor3D.h:45
vtkLabeledContourPolyDataItem::vtkLabeledContourPolyDataItem
vtkLabeledContourPolyDataItem()
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:33
vtkLabeledContourPolyDataItem::LabelHelpers
PDILabelHelper ** LabelHelpers
Definition: vtkLabeledContourPolyDataItem.h:142
vtkSmartPointer< vtkTextPropertyCollection >
vtkLabeledContourPolyDataItem::LabelBuildTime
vtkTimeStamp LabelBuildTime
Definition: vtkLabeledContourPolyDataItem.h:147
vtkTextPropertyCollection
an ordered list of vtkTextProperty objects.
Definition: vtkTextPropertyCollection.h:34
vtkLabeledContourPolyDataItem::New
static vtkLabeledContourPolyDataItem * New()
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:53
vtkLabeledContourPolyDataItem::SetTextProperty
virtual void SetTextProperty(vtkTextProperty *tprop)
The text property used to label the lines.
vtkLabeledContourPolyDataItem::NumberOfUsedTextActors
vtkIdType NumberOfUsedTextActors
Definition: vtkLabeledContourPolyDataItem.h:139
vtkLabeledContourPolyDataItem::SetTextPropertyMapping
virtual void SetTextPropertyMapping(vtkDoubleArray *mapping)
vtkLabeledContourPolyDataItem::Paint
bool Paint(vtkContext2D *painter) override
Paint event for the item.
vtkLabeledContourPolyDataItem::ComputeBounds
virtual void ComputeBounds()
vtkLabeledContourPolyDataItem::TextPropertyMapping
vtkSmartPointer< vtkDoubleArray > TextPropertyMapping
Definition: vtkLabeledContourPolyDataItem.h:145
vtkLabeledContourPolyDataItem::CheckInputs
bool CheckInputs()
vtkLabeledContourPolyDataItem::ResolveLabels
bool ResolveLabels()
vtkLabeledContourPolyDataItem::LabelVisibility
bool LabelVisibility
Definition: vtkLabeledContourPolyDataItem.h:137
vtkLabeledContourPolyDataItem::GetTextPropertyMapping
virtual vtkDoubleArray * GetTextPropertyMapping()
Values in this array correspond to vtkTextProperty objects in the TextProperties collection.
vtkLabeledContourPolyDataItem::CheckRebuild
bool CheckRebuild()
vtkPolyDataItem
Filter that translate a vtkPolyData 2D mesh into vtkContextItems.
Definition: vtkPolyDataItem.h:34
vtkRect.h
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkLabeledContourPolyDataItem::GetTextProperties
virtual vtkTextPropertyCollection * GetTextProperties()
vtkSmartPointer.h
vtkLabeledContourPolyDataItem::RenderLabels
bool RenderLabels(vtkContext2D *painter)
vtkLabeledContourPolyDataItem::SkipDistance
double SkipDistance
Definition: vtkLabeledContourPolyDataItem.h:135
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:34
vtkLabeledContourPolyDataItem::PrepareRender
bool PrepareRender()
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:59
vtkLabeledContourPolyDataItem::FreeTextActors
bool FreeTextActors()
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:36
vtkLabeledContourPolyDataItem
Filter that translate a vtkPolyData 2D mesh into vtkContextItems.
Definition: vtkLabeledContourPolyDataItem.h:42
vtkLabeledContourPolyDataItem::TextProperties
vtkSmartPointer< vtkTextPropertyCollection > TextProperties
Definition: vtkLabeledContourPolyDataItem.h:144
vtkLabeledContourPolyDataItem::CreateLabels
virtual bool CreateLabels()
vtkLabeledContourPolyDataItem::~vtkLabeledContourPolyDataItem
~vtkLabeledContourPolyDataItem() override
vtkLabeledContourPolyDataItem::AllocateTextActors
bool AllocateTextActors(vtkIdType num)
vtkLabeledContourPolyDataItem::NumberOfTextActors
vtkIdType NumberOfTextActors
Definition: vtkLabeledContourPolyDataItem.h:138