VTK
vtkDistributedGraphHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDistributedGraphHelper.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  */
20 
55 #ifndef vtkDistributedGraphHelper_h
56 #define vtkDistributedGraphHelper_h
57 
58 #include "vtkCommonDataModelModule.h" // For export macro
59 #include "vtkObject.h"
60 
61 class vtkDistributedGraphHelperInternals;
62 struct vtkEdgeType;
63 class vtkGraph;
64 class vtkVariant;
65 class vtkVariantArray;
67 
68 // .NAME vtkVertexPedigreeIdDistributionFunction - The type of a
69 // function used to determine how to distribute vertex pedigree IDs
70 // across processors in a vtkGraph. The pedigree ID distribution
71 // function takes the pedigree ID of the vertex and a user-supplied
72 // void pointer and returns a hash value V. A vertex with that
73 // pedigree ID will reside on processor V % P, where P is the number
74 // of processors. This type is used in conjunction with the
75 // vtkDistributedGraphHelper class.
77  (const vtkVariant& pedigreeId, void* userData);
78 
80 {
81  public:
83  void PrintSelf(ostream& os, vtkIndent indent);
84 
86  vtkIdType GetVertexOwner(vtkIdType v) const;
87 
90  vtkIdType GetVertexIndex(vtkIdType v) const;
91 
94  vtkIdType GetEdgeOwner(vtkIdType e_id) const;
95 
98  vtkIdType GetEdgeIndex(vtkIdType e_id) const;
99 
102  vtkIdType MakeDistributedId(int owner, vtkIdType local);
103 
104  //BTX
106 
111  void SetVertexPedigreeIdDistribution(vtkVertexPedigreeIdDistribution Func,
112  void *userData);
113  //ETX
115 
117  vtkIdType GetVertexOwnerByPedigreeId(const vtkVariant& pedigreeId);
118 
125  virtual void Synchronize() = 0;
126 
129  virtual vtkDistributedGraphHelper *Clone() = 0;
130 
132 
137  static vtkInformationIntegerKey * DISTRIBUTEDVERTEXIDS();
138  static vtkInformationIntegerKey * DISTRIBUTEDEDGEIDS();
140 
141  protected:
143  virtual ~vtkDistributedGraphHelper();
144 
146 
151  virtual void AddVertexInternal(vtkVariantArray *propertyArr,
152  vtkIdType *vertex) = 0;
154 
157  virtual void AddVertexInternal(const vtkVariant& pedigreeId, vtkIdType *vertex) = 0;
158 
160 
164  virtual void AddEdgeInternal(vtkIdType u, vtkIdType v, bool directed,
165  vtkVariantArray *propertyArr,
166  vtkEdgeType *edge) = 0;
168 
170 
176  virtual void AddEdgeInternal(const vtkVariant& uPedigreeId, vtkIdType v,
177  bool directed, vtkVariantArray *propertyArr,
178  vtkEdgeType *edge) = 0;
180 
182 
188  virtual void AddEdgeInternal(vtkIdType u, const vtkVariant& vPedigreeId,
189  bool directed, vtkVariantArray *propertyArr,
190  vtkEdgeType *edge) = 0;
192 
194 
201  virtual void AddEdgeInternal(const vtkVariant& uPedigreeId,
202  const vtkVariant& vPedigreeId,
203  bool directed, vtkVariantArray *propertyArr,
204  vtkEdgeType *edge) = 0;
206 
210  virtual vtkIdType FindVertex(const vtkVariant& pedigreeId) = 0;
211 
213 
216  virtual void
217  FindEdgeSourceAndTarget(vtkIdType id,
220 
223  virtual void AttachToGraph(vtkGraph *graph);
224 
227 
228  //BTX
231 
235 
238 
241 
243  int procBits;
244 
246 
248  //ETX
250 
251  private:
252  vtkDistributedGraphHelper(const vtkDistributedGraphHelper&); // Not implemented
253  void operator=(const vtkDistributedGraphHelper&); // Not implemented
254 
255  //BTX
256  friend class vtkGraph;
257  //ETX
258 };
259 
260 #endif // vtkDistributedGraphHelper_h
helper for the vtkGraph class that allows the graph to be distributed across multiple memory spaces...
abstract base class for most VTK objects
Definition: vtkObject.h:61
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
An array holding vtkVariants.
int vtkIdType
Definition: vtkType.h:247
A atomic type representing the union of many types.
Definition: vtkVariant.h:78
Base class for graph data types.
Definition: vtkGraph.h:288
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkVertexPedigreeIdDistribution VertexDistribution
a simple class to control print indentation
Definition: vtkIndent.h:38
Key for integer values in vtkInformation.
vtkIdType(* vtkVertexPedigreeIdDistribution)(const vtkVariant &pedigreeId, void *userData)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTKCOMMONDATAMODEL_EXPORT