VTK
vtkPBGLDistributedGraphHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPBGLDistributedGraphHelper.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*
16  * Copyright (C) 2008 The Trustees of Indiana University.
17  * Use, modification and distribution is subject to the Boost Software
18  * License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt)
19  */
40 #ifndef __vtkPBGLDistributedGraphHelper_h
41 #define __vtkPBGLDistributedGraphHelper_h
42 
44 
45 class vtkPBGLDistributedGraphHelperInternals;
46 
47 //BTX
48 namespace boost { namespace graph { namespace distributed {
49  class mpi_process_group;
50 } } }
51 //ETX
52 
54 {
55  public:
57 
60 
67  void Synchronize();
68 
71 
72  //BTX
74 
75  boost::graph::distributed::mpi_process_group GetProcessGroup();
76  //ETX
78 
81  vtkPBGLDistributedGraphHelperInternals *Internals;
82 
83  void PrintSelf(ostream& os, vtkIndent indent);
84 
85  protected:
88 
89  //BTX
90  enum Tags
91  {
92  // Find a vertex by pedigree ID. This always has a reply.
94 
95  // Find the source and target by edge ID. This always has a reply.
97 
98  // Add a vertex with the given pedigree ID.
101 
102  // Add a vertex with the given property array.
105 
106  // Add a back edge; the forward edge has already been added.
109 
110  // Add an edge; don't reply.
113 
114  // Add an edge; return the edge ID.
117 
118  // Add an edge via (pedigree, id); don't reply.
121 
122  // Add an edge via (pedigree, id); return the edge ID.
125 
126  // Add an edge via (id, pedigree); don't reply.
129 
130  // Add an edge via (pedigree, pedigree); don't reply.
132  ADD_UNDIRECTED_EDGE_NN_NO_REPLY_TAG
133 
134  };
135 
137 
142  void AddVertexInternal(vtkVariantArray *propertyArr,
143  vtkIdType *vertex);
145 
148  void AddVertexInternal(const vtkVariant& pedigreeId, vtkIdType *vertex);
149 
151 
155  void AddEdgeInternal(vtkIdType u, vtkIdType v, bool directed,
156  vtkVariantArray *propertyArr,
157  vtkEdgeType *edge);
159 
161 
167  void AddEdgeInternal(const vtkVariant& uPedigreeId, vtkIdType v,
168  bool directed, vtkVariantArray *propertyArr,
169  vtkEdgeType *edge);
171 
173 
179  void AddEdgeInternal(vtkIdType u, const vtkVariant& vPedigreeId,
180  bool directed, vtkVariantArray *propertyArr,
181  vtkEdgeType *edge);
183 
185 
192  void AddEdgeInternal(const vtkVariant& uPedigreeId,
193  const vtkVariant& vPedigreeId,
194  bool directed, vtkVariantArray *propertyArr,
195  vtkEdgeType *edge);
196  // Description:
197  // Try to find the vertex with the given pedigree ID. Returns true and
198  // fills in the vertex ID if the vertex is found, and returns false
199  // otherwise;
200  vtkIdType FindVertex(const vtkVariant& pedigreeId);
202 
204 
210 
212 
214  void AttachToGraph(vtkGraph *graph);
215  //ETX
217 
218  private:
220  void operator=(const vtkPBGLDistributedGraphHelper&); // Not implemented
221 
222  //BTX
223  friend class vtkPBGLDistributedGraphHelperInternals;
224  //ETX
225 };
226 
227 #endif // __vtkPBGLDistributedGraphHelper_h