VTK
dox/Rendering/Label/vtkLabelHierarchy.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkLabelHierarchy.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00063 #ifndef __vtkLabelHierarchy_h
00064 #define __vtkLabelHierarchy_h
00065 
00066 #include "vtkRenderingLabelModule.h" // For export macro
00067 #include "vtkPointSet.h"
00068 
00069 class vtkAbstractArray;
00070 class vtkCamera;
00071 class vtkCoincidentPoints;
00072 class vtkDataArray;
00073 class vtkIntArray;
00074 class vtkLabelHierarchyIterator;
00075 class vtkPoints;
00076 class vtkPolyData;
00077 class vtkRenderer;
00078 class vtkTextProperty;
00079 
00080 class VTKRENDERINGLABEL_EXPORT vtkLabelHierarchy : public vtkPointSet
00081 {
00082 public:
00083   static vtkLabelHierarchy* New();
00084   vtkTypeMacro(vtkLabelHierarchy,vtkPointSet);
00085   virtual void PrintSelf( ostream& os, vtkIndent indent );
00086 
00089   virtual void SetPoints( vtkPoints* );
00090 
00092   virtual void ComputeHierarchy();
00093 
00095 
00097   vtkSetMacro(TargetLabelCount,int);
00098   vtkGetMacro(TargetLabelCount,int);
00100 
00102 
00103   vtkSetMacro(MaximumDepth,int);
00104   vtkGetMacro(MaximumDepth,int);
00106 
00107   //BTX
00109 
00110   enum IteratorType {
00111     FULL_SORT,
00112     QUEUE,
00113     DEPTH_FIRST,
00114     FRUSTUM
00115   };
00116   //ETX
00118 
00120 
00121   virtual void SetTextProperty(vtkTextProperty* tprop);
00122   vtkGetObjectMacro(TextProperty,vtkTextProperty);
00124 
00126 
00127   virtual void SetPriorities(vtkDataArray* arr);
00128   vtkGetObjectMacro(Priorities,vtkDataArray);
00130 
00132 
00133   virtual void SetLabels(vtkAbstractArray* arr);
00134   vtkGetObjectMacro(Labels,vtkAbstractArray);
00136 
00138 
00139   virtual void SetOrientations(vtkDataArray* arr);
00140   vtkGetObjectMacro(Orientations,vtkDataArray);
00142 
00144 
00145   virtual void SetIconIndices(vtkIntArray* arr);
00146   vtkGetObjectMacro(IconIndices,vtkIntArray);
00148 
00150 
00151   virtual void SetSizes(vtkDataArray* arr);
00152   vtkGetObjectMacro(Sizes,vtkDataArray);
00154 
00156 
00158   virtual void SetBoundedSizes(vtkDataArray* arr);
00159   vtkGetObjectMacro(BoundedSizes,vtkDataArray);
00161 
00162   //BTX
00164 
00173   vtkLabelHierarchyIterator* NewIterator(
00174     int type, vtkRenderer* ren, vtkCamera* cam, double frustumPlanes[24], bool positionsAsNormals, float bucketSize[2] );
00175   //ETX
00177 
00187   void GetDiscreteNodeCoordinatesFromWorldPoint( int ijk[3], double pt[3], int level );
00188 
00197   static bool GetPathForNodalCoordinates( int* path, int ijk[3], int level );
00198 
00200 
00201   virtual vtkIdType GetNumberOfCells();
00202   virtual vtkCell* GetCell(vtkIdType);
00203   virtual void GetCell(vtkIdType, vtkGenericCell*);
00204   virtual int GetCellType(vtkIdType);
00205   virtual void GetCellPoints(vtkIdType, vtkIdList*);
00206   virtual void GetPointCells(vtkIdType, vtkIdList*);
00207   virtual vtkIdType FindCell(double*, vtkCell*, vtkIdType, double, int&, double*, double*);
00208   virtual vtkIdType FindCell(double*, vtkCell*, vtkGenericCell*, vtkIdType, double, int&, double*, double*);
00209   virtual int GetMaxCellSize();
00211 
00212   //BTX
00213   class Implementation;
00214   Implementation* GetImplementation() { return this->Impl; }
00215   //ETX
00216 
00218 
00219   vtkGetObjectMacro(CenterPts,vtkPoints);
00221 
00223 
00226   vtkGetObjectMacro(CoincidentPoints,vtkCoincidentPoints);
00228 
00229 protected:
00230   vtkLabelHierarchy();
00231   virtual ~vtkLabelHierarchy();
00232 
00233   int TargetLabelCount;
00234   int MaximumDepth;
00235   vtkDataArray* Priorities;
00236   vtkAbstractArray* Labels;
00237   vtkDataArray* Orientations;
00238   vtkIntArray* IconIndices;
00239   vtkDataArray* Sizes;
00240   vtkDataArray* BoundedSizes;
00241   vtkCoincidentPoints* CoincidentPoints;
00242   vtkPoints* CenterPts;
00243   vtkTextProperty* TextProperty;
00244 
00245   //BTX
00246   Implementation* Impl;
00247 
00248   friend class vtkLabelHierarchyFrustumIterator;
00249   friend class vtkLabelHierarchyFullSortIterator;
00250   friend class implementation;
00251   //ETX
00252 
00253 private:
00254   vtkLabelHierarchy( const vtkLabelHierarchy& ); // Not implemented.
00255   void operator = ( const vtkLabelHierarchy& ); // Not implemented.
00256 };
00257 
00258 #endif // __vtkLabelHierarchy_h