00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00055 #ifndef __vtkDistributedGraphHelper_h
00056 #define __vtkDistributedGraphHelper_h
00057
00058 #include "vtkObject.h"
00059
00060 class vtkDistributedGraphHelperInternals;
00061 struct vtkEdgeType;
00062 class vtkGraph;
00063 class vtkVariant;
00064 class vtkVariantArray;
00065 class vtkInformationIntegerKey;
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 typedef vtkIdType (*vtkVertexPedigreeIdDistribution)
00076 (const vtkVariant& pedigreeId, void* userData);
00077
00078 class VTK_FILTERING_EXPORT vtkDistributedGraphHelper : public vtkObject
00079 {
00080 public:
00081 vtkTypeMacro (vtkDistributedGraphHelper, vtkObject);
00082 void PrintSelf(ostream& os, vtkIndent indent);
00083
00085 vtkIdType GetVertexOwner(vtkIdType v) const;
00086
00089 vtkIdType GetVertexIndex(vtkIdType v) const;
00090
00093 vtkIdType GetEdgeOwner(vtkIdType e_id) const;
00094
00097 vtkIdType GetEdgeIndex(vtkIdType e_id) const;
00098
00101 vtkIdType MakeDistributedId(int owner, vtkIdType local);
00102
00104
00109 void SetVertexPedigreeIdDistribution(vtkVertexPedigreeIdDistribution Func,
00110 void *userData);
00112
00113
00115
00116 vtkIdType GetVertexOwnerByPedigreeId(const vtkVariant& pedigreeId);
00117
00119
00126 virtual void Synchronize() = 0;
00127
00130 virtual vtkDistributedGraphHelper *Clone() = 0;
00131
00133
00138 static vtkInformationIntegerKey * DISTRIBUTEDVERTEXIDS();
00139 static vtkInformationIntegerKey * DISTRIBUTEDEDGEIDS();
00141
00142 protected:
00143 vtkDistributedGraphHelper();
00144 virtual ~vtkDistributedGraphHelper();
00145
00147
00152 virtual void AddVertexInternal(vtkVariantArray *propertyArr,
00153 vtkIdType *vertex) = 0;
00155
00158 virtual void AddVertexInternal(const vtkVariant& pedigreeId, vtkIdType *vertex) = 0;
00159
00161
00165 virtual void AddEdgeInternal(vtkIdType u, vtkIdType v, bool directed,
00166 vtkVariantArray *propertyArr,
00167 vtkEdgeType *edge) = 0;
00169
00171
00177 virtual void AddEdgeInternal(const vtkVariant& uPedigreeId, vtkIdType v,
00178 bool directed, vtkVariantArray *propertyArr,
00179 vtkEdgeType *edge) = 0;
00181
00183
00189 virtual void AddEdgeInternal(vtkIdType u, const vtkVariant& vPedigreeId,
00190 bool directed, vtkVariantArray *propertyArr,
00191 vtkEdgeType *edge) = 0;
00193
00195
00202 virtual void AddEdgeInternal(const vtkVariant& uPedigreeId,
00203 const vtkVariant& vPedigreeId,
00204 bool directed, vtkVariantArray *propertyArr,
00205 vtkEdgeType *edge) = 0;
00207
00211 virtual vtkIdType FindVertex(const vtkVariant& pedigreeId) = 0;
00212
00214
00217 virtual void
00218 FindEdgeSourceAndTarget(vtkIdType id,
00219 vtkIdType *source, vtkIdType *target) = 0;
00221
00224 virtual void AttachToGraph(vtkGraph *graph);
00225
00227 vtkGraph *Graph;
00228
00229
00231 vtkVertexPedigreeIdDistribution VertexDistribution;
00232
00235 void *VertexDistributionUserData;
00236
00238 vtkIdType signBitMask;
00239
00241 vtkIdType highBitShiftMask;
00242
00244 int procBits;
00245
00247
00248 int indexBits;
00249
00251
00252 private:
00253 vtkDistributedGraphHelper(const vtkDistributedGraphHelper&);
00254 void operator=(const vtkDistributedGraphHelper&);
00255
00256
00257 friend class vtkGraph;
00258
00259 };
00260
00261 #endif // __vtkDistributedGraphHelper_h