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  */
41 #ifndef vtkPBGLDistributedGraphHelper_h
42 #define vtkPBGLDistributedGraphHelper_h
43 
44 #include "vtkInfovisParallelModule.h" // For export macro
46 
47 class vtkPBGLDistributedGraphHelperInternals;
48 
49 //BTX
50 namespace boost { namespace graph { namespace distributed {
51  class mpi_process_group;
52 } } }
53 //ETX
54 
55 #if !defined(VTK_LEGACY_REMOVE)
56 class VTKINFOVISPARALLEL_EXPORT vtkPBGLDistributedGraphHelper : public vtkDistributedGraphHelper
57 {
58  public:
60 
63 
70  void Synchronize();
71 
74 
75  //BTX
77 
78  boost::graph::distributed::mpi_process_group GetProcessGroup();
79  //ETX
81 
84  vtkPBGLDistributedGraphHelperInternals *Internals;
85 
86  void PrintSelf(ostream& os, vtkIndent indent);
87 
88  protected:
91 
92  //BTX
93  enum Tags
94  {
95  // Find a vertex by pedigree ID. This always has a reply.
97 
98  // Find the source and target by edge ID. This always has a reply.
100 
101  // Add a vertex with the given pedigree ID.
104 
105  // Add a vertex with the given property array.
108 
109  // Add a back edge; the forward edge has already been added.
112 
113  // Add an edge; don't reply.
116 
117  // Add an edge; return the edge ID.
120 
121  // Add an edge via (pedigree, id); don't reply.
124 
125  // Add an edge via (pedigree, id); return the edge ID.
128 
129  // Add an edge via (id, pedigree); don't reply.
132 
133  // Add an edge via (pedigree, pedigree); don't reply.
135  ADD_UNDIRECTED_EDGE_NN_NO_REPLY_TAG
136 
137  };
138 
140 
145  void AddVertexInternal(vtkVariantArray *propertyArr,
146  vtkIdType *vertex);
148 
151  void AddVertexInternal(const vtkVariant& pedigreeId, vtkIdType *vertex);
152 
154 
158  void AddEdgeInternal(vtkIdType u, vtkIdType v, bool directed,
159  vtkVariantArray *propertyArr,
160  vtkEdgeType *edge);
162 
164 
170  void AddEdgeInternal(const vtkVariant& uPedigreeId, vtkIdType v,
171  bool directed, vtkVariantArray *propertyArr,
172  vtkEdgeType *edge);
174 
176 
182  void AddEdgeInternal(vtkIdType u, const vtkVariant& vPedigreeId,
183  bool directed, vtkVariantArray *propertyArr,
184  vtkEdgeType *edge);
186 
188 
195  void AddEdgeInternal(const vtkVariant& uPedigreeId,
196  const vtkVariant& vPedigreeId,
197  bool directed, vtkVariantArray *propertyArr,
198  vtkEdgeType *edge);
200 
203  vtkIdType FindVertex(const vtkVariant& pedigreeId);
204 
206 
212 
214 
216  void AttachToGraph(vtkGraph *graph);
217  //ETX
219 
220  private:
222  void operator=(const vtkPBGLDistributedGraphHelper&); // Not implemented
223 
224  //BTX
225  friend class vtkPBGLDistributedGraphHelperInternals;
226  //ETX
227 };
228 
229 #endif //VTK_LEGACY_REMOVE
230 #endif // vtkPBGLDistributedGraphHelper_h
helper for the vtkGraph class that allows the graph to be distributed across multiple memory spaces...
virtual void AddEdgeInternal(vtkIdType u, vtkIdType v, bool directed, vtkVariantArray *propertyArr, vtkEdgeType *edge)=0
Forward declaration required for Boost serialization.
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
An array holding vtkVariants.
void PrintSelf(ostream &os, vtkIndent indent)
virtual vtkDistributedGraphHelper * Clone()=0
virtual void AttachToGraph(vtkGraph *graph)
virtual void Synchronize()=0
virtual vtkIdType FindVertex(const vtkVariant &pedigreeId)=0
int vtkIdType
Definition: vtkType.h:275
A atomic type representing the union of many types.
Definition: vtkVariant.h:78
Base class for graph data types.
Definition: vtkGraph.h:288
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkPBGLDistributedGraphHelperInternals * Internals
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
virtual void FindEdgeSourceAndTarget(vtkIdType id, vtkIdType *source, vtkIdType *target)=0
virtual void AddVertexInternal(vtkVariantArray *propertyArr, vtkIdType *vertex)=0
static vtkObject * New()
end namespace boost::graph::distributed