VTK
dox/Parallel/vtkPBGLGraphSQLReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPBGLGraphSQLReader.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 (c) Sandia Corporation
00017  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00018 ----------------------------------------------------------------------------*/
00041 #ifndef __vtkPBGLGraphSQLReader_h
00042 #define __vtkPBGLGraphSQLReader_h
00043 
00044 #include "vtkGraphAlgorithm.h"
00045 
00046 class vtkSQLDatabase;
00047 
00048 class VTK_PARALLEL_EXPORT vtkPBGLGraphSQLReader : public vtkGraphAlgorithm
00049 {
00050 public:
00051   static vtkPBGLGraphSQLReader* New();
00052   vtkTypeMacro(vtkPBGLGraphSQLReader,vtkGraphAlgorithm);
00053   void PrintSelf(ostream& os, vtkIndent indent);
00054 
00056 
00058   vtkSetMacro(Directed, bool);
00059   vtkGetMacro(Directed, bool);
00060   vtkBooleanMacro(Directed, bool);
00062 
00064 
00065   virtual void SetDatabase(vtkSQLDatabase* db);
00066   vtkGetObjectMacro(Database, vtkSQLDatabase);
00068 
00070 
00071   vtkSetStringMacro(VertexTable);
00072   vtkGetStringMacro(VertexTable);
00074 
00076 
00077   vtkSetStringMacro(EdgeTable);
00078   vtkGetStringMacro(EdgeTable);
00080 
00082 
00084   vtkSetStringMacro(SourceField);
00085   vtkGetStringMacro(SourceField);
00087 
00089 
00091   vtkSetStringMacro(TargetField);
00092   vtkGetStringMacro(TargetField);
00094 
00096 
00097   vtkSetStringMacro(VertexIdField);
00098   vtkGetStringMacro(VertexIdField);
00100 
00102 
00103   static void GetRange(int rank, int total,
00104     vtkIdType size, vtkIdType& offset, vtkIdType& limit);
00106 
00108 
00109   void SetDistributionUserData(int procs, vtkIdType verts)
00110     { this->DistributionUserData[0] = procs;
00111       this->DistributionUserData[1] = verts; }
00113 
00115 
00117   vtkIdType* GetDistributionUserData()
00118     { return this->DistributionUserData; }
00120 
00121 protected:
00122   vtkPBGLGraphSQLReader();
00123   ~vtkPBGLGraphSQLReader();
00124 
00125   bool Directed;
00126   vtkSQLDatabase* Database;
00127   char* VertexTable;
00128   char* EdgeTable;
00129   char* SourceField;
00130   char* TargetField;
00131   char* VertexIdField;
00132   vtkIdType DistributionUserData[2];
00133 
00134   virtual int RequestData(
00135     vtkInformation*, 
00136     vtkInformationVector**, 
00137     vtkInformationVector*);
00138 
00139   virtual int RequestDataObject(
00140     vtkInformation*, 
00141     vtkInformationVector**, 
00142     vtkInformationVector*);
00143 
00144 private:
00145   vtkPBGLGraphSQLReader(const vtkPBGLGraphSQLReader&); // Not implemented
00146   void operator=(const vtkPBGLGraphSQLReader&);   // Not implemented
00147 };
00148 
00149 #endif
00150