VTK
dox/Infovis/Layout/vtkCirclePackLayout.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003  Program:   Visualization Toolkit
00004  Module:    vtkCirclePackLayout.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  -------------------------------------------------------------------------*/
00047 #ifndef __vtkCirclePackLayout_h
00048 #define __vtkCirclePackLayout_h
00049 
00050 #include "vtkInfovisLayoutModule.h" // For export macro
00051 #include "vtkTreeAlgorithm.h"
00052 
00053 class vtkCirclePackLayoutStrategy;
00054 class vtkDoubleArray;
00055 class vtkDataArray;
00056 class vtkTree;
00057 
00058 class VTKINFOVISLAYOUT_EXPORT vtkCirclePackLayout : public vtkTreeAlgorithm
00059 {
00060 public:
00061     static vtkCirclePackLayout *New();
00062 
00063     vtkTypeMacro(vtkCirclePackLayout,vtkTreeAlgorithm);
00064     void PrintSelf(ostream& os, vtkIndent indent);
00065 
00067 
00070     vtkGetStringMacro(CirclesFieldName);
00071     vtkSetStringMacro(CirclesFieldName);
00073 
00075 
00077     virtual void SetSizeArrayName(const char* name)
00078     { this->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_VERTICES, name); }
00080 
00082 
00083     vtkGetObjectMacro(LayoutStrategy, vtkCirclePackLayoutStrategy);
00084     void SetLayoutStrategy(vtkCirclePackLayoutStrategy * strategy);
00086 
00091     vtkIdType FindVertex(double pnt[2], double *cinfo=0);
00092 
00095     void GetBoundingCircle(vtkIdType id, double *cinfo);
00096 
00098     virtual unsigned long GetMTime();
00099 
00100 protected:
00101     vtkCirclePackLayout();
00102     ~vtkCirclePackLayout();
00103 
00104     char * CirclesFieldName;
00105     vtkCirclePackLayoutStrategy* LayoutStrategy;
00106 
00107     int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00108 
00109 private:
00110 
00111     vtkCirclePackLayout(const vtkCirclePackLayout&);  // Not implemented.
00112     void operator=(const vtkCirclePackLayout&);  // Not implemented.
00113     void prepareSizeArray(vtkDoubleArray* mySizeArray,
00114                           vtkTree* tree);
00115 };
00116 
00117 #endif