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 
56 #ifndef vtkDistributedGraphHelper_h
57 #define vtkDistributedGraphHelper_h
58 
59 #include "vtkCommonDataModelModule.h" // For export macro
60 #include "vtkObject.h"
61 
62 class vtkDistributedGraphHelperInternals;
63 struct vtkEdgeType;
64 class vtkGraph;
65 class vtkVariant;
66 class vtkVariantArray;
68 
69 // .NAME vtkVertexPedigreeIdDistributionFunction - The type of a
70 // function used to determine how to distribute vertex pedigree IDs
71 // across processors in a vtkGraph. The pedigree ID distribution
72 // function takes the pedigree ID of the vertex and a user-supplied
73 // void pointer and returns a hash value V. A vertex with that
74 // pedigree ID will reside on processor V % P, where P is the number
75 // of processors. This type is used in conjunction with the
76 // vtkDistributedGraphHelper class.
78  (const vtkVariant& pedigreeId, void* userData);
79 
80 class VTKCOMMONDATAMODEL_EXPORT vtkDistributedGraphHelper : public vtkObject
81 {
82  public:
84  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
85 
89  vtkIdType GetVertexOwner(vtkIdType v) const;
90 
94  vtkIdType GetVertexIndex(vtkIdType v) const;
95 
99  vtkIdType GetEdgeOwner(vtkIdType e_id) const;
100 
105  vtkIdType GetEdgeIndex(vtkIdType e_id) const;
106 
110  vtkIdType MakeDistributedId(int owner, vtkIdType local);
111 
119  void SetVertexPedigreeIdDistribution(vtkVertexPedigreeIdDistribution Func,
120  void *userData);
121 
125  vtkIdType GetVertexOwnerByPedigreeId(const vtkVariant& pedigreeId);
126 
135  virtual void Synchronize() = 0;
136 
142  virtual vtkDistributedGraphHelper *Clone() = 0;
143 
145 
152  static vtkInformationIntegerKey * DISTRIBUTEDVERTEXIDS();
153  static vtkInformationIntegerKey * DISTRIBUTEDEDGEIDS();
155 
156  protected:
158  ~vtkDistributedGraphHelper() VTK_OVERRIDE;
159 
167  virtual void AddVertexInternal(vtkVariantArray *propertyArr,
168  vtkIdType *vertex) = 0;
169 
174  virtual void AddVertexInternal(const vtkVariant& pedigreeId, vtkIdType *vertex) = 0;
175 
182  virtual void AddEdgeInternal(vtkIdType u, vtkIdType v, bool directed,
183  vtkVariantArray *propertyArr,
184  vtkEdgeType *edge) = 0;
185 
194  virtual void AddEdgeInternal(const vtkVariant& uPedigreeId, vtkIdType v,
195  bool directed, vtkVariantArray *propertyArr,
196  vtkEdgeType *edge) = 0;
197 
206  virtual void AddEdgeInternal(vtkIdType u, const vtkVariant& vPedigreeId,
207  bool directed, vtkVariantArray *propertyArr,
208  vtkEdgeType *edge) = 0;
209 
219  virtual void AddEdgeInternal(const vtkVariant& uPedigreeId,
220  const vtkVariant& vPedigreeId,
221  bool directed, vtkVariantArray *propertyArr,
222  vtkEdgeType *edge) = 0;
223 
229  virtual vtkIdType FindVertex(const vtkVariant& pedigreeId) = 0;
230 
236  virtual void
237  FindEdgeSourceAndTarget(vtkIdType id,
239 
244  virtual void AttachToGraph(vtkGraph *graph);
245 
249  vtkGraph *Graph;
250 
255 
259  void *VertexDistributionUserData;
260 
264  vtkIdType signBitMask;
265 
269  vtkIdType highBitShiftMask;
270 
274  int procBits;
275 
279  int indexBits;
280 
281  private:
282  vtkDistributedGraphHelper(const vtkDistributedGraphHelper&) VTK_DELETE_FUNCTION;
283  void operator=(const vtkDistributedGraphHelper&) VTK_DELETE_FUNCTION;
284 
285  friend class vtkGraph;
286 
287 };
288 
289 #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:59
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
An array holding vtkVariants.
int vtkIdType
Definition: vtkType.h:287
A atomic type representing the union of many types.
Definition: vtkVariant.h:75
Base class for graph data types.
Definition: vtkGraph.h:287
a simple class to control print indentation
Definition: vtkIndent.h:39
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 *)