• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

dox/Infovis/vtkSimple2DLayoutStrategy.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSimple2DLayoutStrategy.h,v $
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 -------------------------------------------------------------------------*/
00040 #ifndef __vtkSimple2DLayoutStrategy_h
00041 #define __vtkSimple2DLayoutStrategy_h
00042 
00043 #include "vtkGraphLayoutStrategy.h"
00044 
00045 class vtkFloatArray;
00046 
00047 class VTK_INFOVIS_EXPORT vtkSimple2DLayoutStrategy : public vtkGraphLayoutStrategy 
00048 {
00049 public:
00050   static vtkSimple2DLayoutStrategy *New();
00051 
00052   vtkTypeRevisionMacro(vtkSimple2DLayoutStrategy, vtkGraphLayoutStrategy);
00053   void PrintSelf(ostream& os, vtkIndent indent);
00054 
00056 
00059   vtkSetClampMacro(RandomSeed, int, 0, VTK_LARGE_INTEGER);
00060   vtkGetMacro(RandomSeed, int);
00062 
00064 
00069   vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_LARGE_INTEGER);
00070   vtkGetMacro(MaxNumberOfIterations, int);
00072   
00074 
00078   vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_LARGE_INTEGER);
00079   vtkGetMacro(IterationsPerLayout, int);
00081 
00083 
00086   vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
00087   vtkGetMacro(InitialTemperature, float);
00089   
00091 
00095   vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
00096   vtkGetMacro(CoolDownRate, double);
00098   
00100 
00103   vtkSetMacro(Jitter, bool);
00104   vtkGetMacro(Jitter, bool);
00106   
00108 
00110   vtkSetMacro(RestDistance, float);
00111   vtkGetMacro(RestDistance, float);
00113 
00116   virtual void Initialize();
00117   
00122   virtual void Layout();
00123   
00126   virtual int IsLayoutComplete() {return this->LayoutComplete;}
00127 
00128 protected:
00129   vtkSimple2DLayoutStrategy();
00130   ~vtkSimple2DLayoutStrategy();
00131 
00132   int    MaxNumberOfIterations;  //Maximum number of iterations.
00133   float  InitialTemperature;
00134   float  CoolDownRate;  //Cool-down rate.  Note:  Higher # = Slower rate.
00135 
00136 private:
00137 
00138   //BTX
00139   // An edge consists of two vertices joined together.
00140   // This struct acts as a "pointer" to those two vertices.
00141   typedef struct 
00142   {
00143     vtkIdType from;
00144     vtkIdType to;
00145     float weight;
00146   } vtkLayoutEdge;
00147   
00148   // These are for storage of repulsion and attraction
00149   vtkFloatArray *RepulsionArray;
00150   vtkFloatArray *AttractionArray;
00151   vtkLayoutEdge *EdgeArray;
00152   //ETX
00153   
00154   int RandomSeed;
00155   int IterationsPerLayout;
00156   int TotalIterations;
00157   int LayoutComplete;
00158   float Temp;
00159   float RestDistance;
00160   bool Jitter;
00161 
00162   vtkSimple2DLayoutStrategy(const vtkSimple2DLayoutStrategy&);  // Not implemented.
00163   void operator=(const vtkSimple2DLayoutStrategy&);  // Not implemented.
00164 };
00165 
00166 #endif
00167 

Generated by  doxygen 1.7.1