VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPBGLDistributedGraphHelper.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) 2008 The Trustees of Indiana University. 00017 * Use, modification and distribution is subject to the Boost Software 00018 * License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt) 00019 */ 00041 #ifndef vtkPBGLDistributedGraphHelper_h 00042 #define vtkPBGLDistributedGraphHelper_h 00043 00044 #include "vtkInfovisParallelModule.h" // For export macro 00045 #include "vtkDistributedGraphHelper.h" 00046 00047 class vtkPBGLDistributedGraphHelperInternals; 00048 00049 //BTX 00050 namespace boost { namespace graph { namespace distributed { 00051 class mpi_process_group; 00052 } } } 00053 //ETX 00054 00055 #if !defined(VTK_LEGACY_REMOVE) 00056 class VTKINFOVISPARALLEL_EXPORT vtkPBGLDistributedGraphHelper : public vtkDistributedGraphHelper 00057 { 00058 public: 00059 vtkTypeMacro(vtkPBGLDistributedGraphHelper,vtkDistributedGraphHelper); 00060 00062 static vtkPBGLDistributedGraphHelper* New(); 00063 00070 void Synchronize(); 00071 00073 vtkDistributedGraphHelper *Clone(); 00074 00075 //BTX 00077 00078 boost::graph::distributed::mpi_process_group GetProcessGroup(); 00079 //ETX 00081 00084 vtkPBGLDistributedGraphHelperInternals *Internals; 00085 00086 void PrintSelf(ostream& os, vtkIndent indent); 00087 00088 protected: 00089 vtkPBGLDistributedGraphHelper(); 00090 ~vtkPBGLDistributedGraphHelper(); 00091 00092 //BTX 00093 enum Tags 00094 { 00095 // Find a vertex by pedigree ID. This always has a reply. 00096 FIND_VERTEX_TAG, 00097 00098 // Find the source and target by edge ID. This always has a reply. 00099 FIND_EDGE_SOURCE_TARGET_TAG, 00100 00101 // Add a vertex with the given pedigree ID. 00102 ADD_VERTEX_NO_REPLY_TAG, 00103 ADD_VERTEX_WITH_REPLY_TAG, 00104 00105 // Add a vertex with the given property array. 00106 ADD_VERTEX_PROPS_NO_REPLY_TAG, 00107 ADD_VERTEX_PROPS_WITH_REPLY_TAG, 00108 00109 // Add a back edge; the forward edge has already been added. 00110 ADD_DIRECTED_BACK_EDGE_TAG, 00111 ADD_UNDIRECTED_BACK_EDGE_TAG, 00112 00113 // Add an edge; don't reply. 00114 ADD_DIRECTED_EDGE_NO_REPLY_TAG, 00115 ADD_UNDIRECTED_EDGE_NO_REPLY_TAG, 00116 00117 // Add an edge; return the edge ID. 00118 ADD_DIRECTED_EDGE_WITH_REPLY_TAG, 00119 ADD_UNDIRECTED_EDGE_WITH_REPLY_TAG, 00120 00121 // Add an edge via (pedigree, id); don't reply. 00122 ADD_DIRECTED_EDGE_NI_NO_REPLY_TAG, 00123 ADD_UNDIRECTED_EDGE_NI_NO_REPLY_TAG, 00124 00125 // Add an edge via (pedigree, id); return the edge ID. 00126 ADD_DIRECTED_EDGE_NI_WITH_REPLY_TAG, 00127 ADD_UNDIRECTED_EDGE_NI_WITH_REPLY_TAG, 00128 00129 // Add an edge via (id, pedigree); don't reply. 00130 ADD_DIRECTED_EDGE_IN_NO_REPLY_TAG, 00131 ADD_UNDIRECTED_EDGE_IN_NO_REPLY_TAG, 00132 00133 // Add an edge via (pedigree, pedigree); don't reply. 00134 ADD_DIRECTED_EDGE_NN_NO_REPLY_TAG, 00135 ADD_UNDIRECTED_EDGE_NN_NO_REPLY_TAG 00136 00137 }; 00138 00140 00145 void AddVertexInternal(vtkVariantArray *propertyArr, 00146 vtkIdType *vertex); 00148 00151 void AddVertexInternal(const vtkVariant& pedigreeId, vtkIdType *vertex); 00152 00154 00158 void AddEdgeInternal(vtkIdType u, vtkIdType v, bool directed, 00159 vtkVariantArray *propertyArr, 00160 vtkEdgeType *edge); 00162 00164 00170 void AddEdgeInternal(const vtkVariant& uPedigreeId, vtkIdType v, 00171 bool directed, vtkVariantArray *propertyArr, 00172 vtkEdgeType *edge); 00174 00176 00182 void AddEdgeInternal(vtkIdType u, const vtkVariant& vPedigreeId, 00183 bool directed, vtkVariantArray *propertyArr, 00184 vtkEdgeType *edge); 00186 00188 00195 void AddEdgeInternal(const vtkVariant& uPedigreeId, 00196 const vtkVariant& vPedigreeId, 00197 bool directed, vtkVariantArray *propertyArr, 00198 vtkEdgeType *edge); 00200 00203 vtkIdType FindVertex(const vtkVariant& pedigreeId); 00204 00206 00209 void FindEdgeSourceAndTarget(vtkIdType id, 00210 vtkIdType *source, vtkIdType *target); 00212 00214 00216 void AttachToGraph(vtkGraph *graph); 00217 //ETX 00219 00220 private: 00221 vtkPBGLDistributedGraphHelper(const vtkPBGLDistributedGraphHelper&); // Not implemented 00222 void operator=(const vtkPBGLDistributedGraphHelper&); // Not implemented 00223 00224 //BTX 00225 friend class vtkPBGLDistributedGraphHelperInternals; 00226 //ETX 00227 }; 00228 00229 #endif //VTK_LEGACY_REMOVE 00230 #endif // vtkPBGLDistributedGraphHelper_h