vtkPointSetToLabelHierarchy.h 4.09 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkPointSetToLabelHierarchy.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
/*-------------------------------------------------------------------------
  Copyright 2008 Sandia Corporation.
  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
  the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
20 21 22 23 24 25 26 27 28 29 30
/**
 * @class   vtkPointSetToLabelHierarchy
 * @brief   build a label hierarchy for a graph or point set.
 *
 *
 *
 * Every point in the input vtkPoints object is taken to be an
 * anchor point for a label. Statistics on the input points
 * are used to subdivide an octree referencing the points
 * until the points each octree node contains have a variance
 * close to the node size and a limited population (< 100).
31
 */
32

33 34
#ifndef vtkPointSetToLabelHierarchy_h
#define vtkPointSetToLabelHierarchy_h
35 36

#include "vtkLabelHierarchyAlgorithm.h"
37
#include "vtkRenderingLabelModule.h" // For export macro
38

Jeff Baumes's avatar
Jeff Baumes committed
39 40
class vtkTextProperty;

41
class VTKRENDERINGLABEL_EXPORT vtkPointSetToLabelHierarchy : public vtkLabelHierarchyAlgorithm
42 43 44
{
public:
  static vtkPointSetToLabelHierarchy* New();
45 46
  vtkTypeMacro(vtkPointSetToLabelHierarchy, vtkLabelHierarchyAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent) override;
47

48 49 50 51
  //@{
  /**
   * Set/get the "ideal" number of labels to associate with each node in the output hierarchy.
   */
52 53
  vtkSetMacro(TargetLabelCount, int);
  vtkGetMacro(TargetLabelCount, int);
54
  //@}
55

56 57 58 59
  //@{
  /**
   * Set/get the maximum tree depth in the output hierarchy.
   */
60 61
  vtkSetMacro(MaximumDepth, int);
  vtkGetMacro(MaximumDepth, int);
62
  //@}
63

64 65 66 67
  //@{
  /**
   * Whether to use unicode strings.
   */
68 69 70
  vtkSetMacro(UseUnicodeStrings, bool);
  vtkGetMacro(UseUnicodeStrings, bool);
  vtkBooleanMacro(UseUnicodeStrings, bool);
71
  //@}
72

73 74 75 76
  //@{
  /**
   * Set/get the label array name.
   */
Jeff Baumes's avatar
Jeff Baumes committed
77 78
  virtual void SetLabelArrayName(const char* name);
  virtual const char* GetLabelArrayName();
79
  //@}
Jeff Baumes's avatar
Jeff Baumes committed
80

81 82 83 84
  //@{
  /**
   * Set/get the priority array name.
   */
Jeff Baumes's avatar
Jeff Baumes committed
85 86
  virtual void SetSizeArrayName(const char* name);
  virtual const char* GetSizeArrayName();
87
  //@}
Jeff Baumes's avatar
Jeff Baumes committed
88

89 90 91 92
  //@{
  /**
   * Set/get the priority array name.
   */
Jeff Baumes's avatar
Jeff Baumes committed
93 94
  virtual void SetPriorityArrayName(const char* name);
  virtual const char* GetPriorityArrayName();
95
  //@}
Jeff Baumes's avatar
Jeff Baumes committed
96

97 98 99 100
  //@{
  /**
   * Set/get the icon index array name.
   */
Jeff Baumes's avatar
Jeff Baumes committed
101 102
  virtual void SetIconIndexArrayName(const char* name);
  virtual const char* GetIconIndexArrayName();
103
  //@}
Jeff Baumes's avatar
Jeff Baumes committed
104

105 106 107 108
  //@{
  /**
   * Set/get the text orientation array name.
   */
Jeff Baumes's avatar
Jeff Baumes committed
109 110
  virtual void SetOrientationArrayName(const char* name);
  virtual const char* GetOrientationArrayName();
111
  //@}
Jeff Baumes's avatar
Jeff Baumes committed
112

113 114 115 116
  //@{
  /**
   * Set/get the maximum text width (in world coordinates) array name.
   */
117 118
  virtual void SetBoundedSizeArrayName(const char* name);
  virtual const char* GetBoundedSizeArrayName();
119
  //@}
120

121 122 123 124
  //@{
  /**
   * Set/get the text property assigned to the hierarchy.
   */
Jeff Baumes's avatar
Jeff Baumes committed
125 126
  virtual void SetTextProperty(vtkTextProperty* tprop);
  vtkGetObjectMacro(TextProperty, vtkTextProperty);
127
  //@}
Jeff Baumes's avatar
Jeff Baumes committed
128

129 130
protected:
  vtkPointSetToLabelHierarchy();
131
  ~vtkPointSetToLabelHierarchy() override;
132

133
  int FillInputPortInformation(int port, vtkInformation* info) override;
134

135 136
  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
    vtkInformationVector* outputVector) override;
137 138 139

  int TargetLabelCount;
  int MaximumDepth;
140
  bool UseUnicodeStrings;
Jeff Baumes's avatar
Jeff Baumes committed
141
  vtkTextProperty* TextProperty;
142 143

private:
144 145
  vtkPointSetToLabelHierarchy(const vtkPointSetToLabelHierarchy&) = delete;
  void operator=(const vtkPointSetToLabelHierarchy&) = delete;
146 147
};

148
#endif // vtkPointSetToLabelHierarchy_h