1 /*========================================================================= 2 3 Program: Visualization Toolkit 4 Module: vtkPointSetToLabelHierarchy.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 =========================================================================*/ 15 /*------------------------------------------------------------------------- 16 Copyright 2008 Sandia Corporation. 17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 18 the U.S. Government retains certain rights in this software. 19 -------------------------------------------------------------------------*/ 20 // .NAME vtkPointSetToLabelHierarchy - build a label hierarchy for a graph or point set. 21 // 22 // .SECTION Description 23 // 24 // Every point in the input vtkPoints object is taken to be an 25 // anchor point for a label. Statistics on the input points 26 // are used to subdivide an octree referencing the points 27 // until the points each octree node contains have a variance 28 // close to the node size and a limited population (< 100). 29 30 #ifndef vtkPointSetToLabelHierarchy_h 31 #define vtkPointSetToLabelHierarchy_h 32 33 #include "vtkRenderingLabelModule.h" // For export macro 34 #include "vtkLabelHierarchyAlgorithm.h" 35 36 class vtkTextProperty; 37 38 class VTKRENDERINGLABEL_EXPORT vtkPointSetToLabelHierarchy : public vtkLabelHierarchyAlgorithm 39 { 40 public: 41 static vtkPointSetToLabelHierarchy* New(); 42 vtkTypeMacro(vtkPointSetToLabelHierarchy,vtkLabelHierarchyAlgorithm); 43 virtual void PrintSelf( ostream& os, vtkIndent indent ); 44 45 // Description: 46 // Set/get the "ideal" number of labels to associate with each node in the output hierarchy. 47 vtkSetMacro(TargetLabelCount,int); 48 vtkGetMacro(TargetLabelCount,int); 49 50 // Description: 51 // Set/get the maximum tree depth in the output hierarchy. 52 vtkSetMacro(MaximumDepth,int); 53 vtkGetMacro(MaximumDepth,int); 54 55 // Description: 56 // Whether to use unicode strings. 57 vtkSetMacro(UseUnicodeStrings,bool); 58 vtkGetMacro(UseUnicodeStrings,bool); 59 vtkBooleanMacro(UseUnicodeStrings,bool); 60 61 // Description: 62 // Set/get the label array name. 63 virtual void SetLabelArrayName(const char* name); 64 virtual const char* GetLabelArrayName(); 65 66 // Description: 67 // Set/get the priority array name. 68 virtual void SetSizeArrayName(const char* name); 69 virtual const char* GetSizeArrayName(); 70 71 // Description: 72 // Set/get the priority array name. 73 virtual void SetPriorityArrayName(const char* name); 74 virtual const char* GetPriorityArrayName(); 75 76 // Description: 77 // Set/get the icon index array name. 78 virtual void SetIconIndexArrayName(const char* name); 79 virtual const char* GetIconIndexArrayName(); 80 81 // Description: 82 // Set/get the text orientation array name. 83 virtual void SetOrientationArrayName(const char* name); 84 virtual const char* GetOrientationArrayName(); 85 86 // Description: 87 // Set/get the maximum text width (in world coordinates) array name. 88 virtual void SetBoundedSizeArrayName(const char* name); 89 virtual const char* GetBoundedSizeArrayName(); 90 91 // Description: 92 // Set/get the text property assigned to the hierarchy. 93 virtual void SetTextProperty(vtkTextProperty* tprop); 94 vtkGetObjectMacro(TextProperty, vtkTextProperty); 95 96 protected: 97 vtkPointSetToLabelHierarchy(); 98 virtual ~vtkPointSetToLabelHierarchy(); 99 100 virtual int FillInputPortInformation( int port, vtkInformation* info ); 101 102 virtual int RequestData( 103 vtkInformation* request, 104 vtkInformationVector** inputVector, 105 vtkInformationVector* outputVector ); 106 107 int TargetLabelCount; 108 int MaximumDepth; 109 bool UseUnicodeStrings; 110 vtkTextProperty* TextProperty; 111 112 private: 113 vtkPointSetToLabelHierarchy( const vtkPointSetToLabelHierarchy& ); // Not implemented. 114 void operator = ( const vtkPointSetToLabelHierarchy& ); // Not implemented. 115 }; 116 117 #endif // vtkPointSetToLabelHierarchy_h 118