VTK
vtkBoostGraphAdapter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBoostGraphAdapter.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 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
30 #ifndef vtkBoostGraphAdapter_h
31 #define vtkBoostGraphAdapter_h
32 
33 #include "vtkAbstractArray.h"
34 #include "vtkDataArray.h"
35 #include "vtkDataObject.h"
36 #include "vtkDirectedGraph.h"
38 #include "vtkDoubleArray.h"
39 #include "vtkFloatArray.h"
40 #include "vtkIdTypeArray.h"
41 #include "vtkInformation.h"
42 #include "vtkIntArray.h"
45 #include "vtkTree.h"
46 #include "vtkUndirectedGraph.h"
47 #include "vtkVariant.h"
48 
49 #include <boost/version.hpp>
50 
51 namespace boost {
52  //===========================================================================
53  // VTK arrays as property maps
54  // These need to be defined before including other boost stuff
55 
56  // Forward declarations are required here, so that we aren't forced
57  // to include boost/property_map.hpp.
58  template<typename> struct property_traits;
59  struct read_write_property_map_tag;
60 
61 #define vtkPropertyMapMacro(T, V) \
62  template <> \
63  struct property_traits<T*> \
64  { \
65  typedef V value_type; \
66  typedef V reference; \
67  typedef vtkIdType key_type; \
68  typedef read_write_property_map_tag category; \
69  }; \
70  \
71  inline property_traits<T*>::reference \
72  get( \
73  T* const & arr, \
74  property_traits<T*>::key_type key) \
75  { \
76  return arr->GetValue(key); \
77  } \
78  \
79  inline void \
80  put( \
81  T* arr, \
82  property_traits<T*>::key_type key, \
83  const property_traits<T*>::value_type & value) \
84  { \
85  arr->InsertValue(key, value); \
86  }
87 
92 
93  // vtkDataArray
94  template<>
96  {
97  typedef double value_type;
98  typedef double reference;
100  typedef read_write_property_map_tag category;
101  };
102 
103  inline double
104  get(vtkDataArray * const& arr, vtkIdType key)
105  {
106  return arr->GetTuple1(key);
107  }
108 
109  inline void
110  put(vtkDataArray *arr, vtkIdType key, const double& value)
111  {
112  arr->SetTuple1(key, value);
113  }
114 
115  // vtkAbstractArray as a property map of vtkVariants
116  template<>
118  {
122  typedef read_write_property_map_tag category;
123  };
124 
125  inline vtkVariant
127  {
128  return arr->GetVariantValue(key);
129  }
130 
131  inline void
133  {
135  }
136 #if defined(_MSC_VER)
137  namespace detail {
140  }
141 #endif
142 }
143 
144 #include <utility> // STL Header
145 
146 #include <boost/config.hpp>
147 #include <boost/graph/adjacency_iterator.hpp>
148 #include <boost/graph/graph_traits.hpp>
149 #include <boost/graph/properties.hpp>
150 #include <boost/iterator/iterator_facade.hpp>
151 
152 // The functions and classes in this file allows the user to
153 // treat a vtkDirectedGraph or vtkUndirectedGraph object
154 // as a boost graph "as is".
155 
156 namespace boost {
157 
159  public iterator_facade<vtk_vertex_iterator,
160  vtkIdType,
161  bidirectional_traversal_tag,
162  const vtkIdType&,
163  vtkIdType>
164  {
165  public:
166  explicit vtk_vertex_iterator(vtkIdType i = 0) : index(i) {}
167 
168  private:
169  const vtkIdType& dereference() const { return index; }
170 
171  bool equal(const vtk_vertex_iterator& other) const
172  { return index == other.index; }
173 
174  void increment() { index++; }
175  void decrement() { index--; }
176 
177  vtkIdType index;
178 
179  friend class iterator_core_access;
180  };
181 
183  public iterator_facade<vtk_edge_iterator,
184  vtkEdgeType,
185  forward_traversal_tag,
186  const vtkEdgeType&,
187  vtkIdType>
188  {
189  public:
190  explicit vtk_edge_iterator(vtkGraph *g = 0, vtkIdType v = 0) :
191  directed(false), vertex(v), lastVertex(v), iter(nullptr), end(nullptr), graph(g)
192  {
193  if (graph)
194  {
195  lastVertex = graph->GetNumberOfVertices();
196  }
197 
198  vtkIdType myRank = -1;
200  = this->graph? this->graph->GetDistributedGraphHelper() : 0;
201  if (helper)
202  {
203  myRank = this->graph->GetInformation()->Get(vtkDataObject::DATA_PIECE_NUMBER());
204  vertex = helper->MakeDistributedId(myRank, vertex);
205  lastVertex = helper->MakeDistributedId(myRank, lastVertex);
206  }
207 
208  if (graph != 0)
209  {
210  directed = (vtkDirectedGraph::SafeDownCast(graph) != 0);
211  while (vertex < lastVertex && this->graph->GetOutDegree(vertex) == 0)
212  {
213  ++vertex;
214  }
215 
216  if (vertex < lastVertex)
217  {
218  // Get the outgoing edges of the first vertex that has outgoing
219  // edges
220  vtkIdType nedges;
221  graph->GetOutEdges(vertex, iter, nedges);
222  if (iter)
223  {
224  end = iter + nedges;
225 
226  if (!directed)
227  {
228  while(// Skip non-local edges
229  (helper && helper->GetEdgeOwner(iter->Id) != myRank)
230  // Skip entirely-local edges where Source > Target
231  || (((helper
232  && myRank == helper->GetVertexOwner(iter->Target))
233  || !helper)
234  && vertex > iter->Target))
235  {
236  this->inc();
237  }
238  }
239  }
240  }
241  else
242  {
243  iter = nullptr;
244  }
245  }
246 
247  RecalculateEdge();
248  }
249 
250  private:
251  const vtkEdgeType& dereference() const
252  {
253  assert(iter);
254  return edge;
255  }
256 
257  bool equal(const vtk_edge_iterator& other) const
258  { return vertex == other.vertex && iter == other.iter; }
259 
260  void increment()
261  {
262  inc();
263  if (!directed)
264  {
265  vtkIdType myRank = -1;
267  = this->graph? this->graph->GetDistributedGraphHelper() : 0;
268  if (helper)
269  {
270  myRank = this->graph->GetInformation()->Get(vtkDataObject::DATA_PIECE_NUMBER());
271  }
272 
273  while (iter != 0
274  && (// Skip non-local edges
275  (helper && helper->GetEdgeOwner(iter->Id) != myRank)
276  // Skip entirely-local edges where Source > Target
277  || (((helper
278  && myRank == helper->GetVertexOwner(iter->Target))
279  || !helper)
280  && vertex > iter->Target)))
281  {
282  inc();
283  }
284  }
285  RecalculateEdge();
286  }
287 
288  void inc()
289  {
290  ++iter;
291  if (iter == end)
292  {
293  // Find a vertex with nonzero out degree.
294  ++vertex;
295  while (vertex < lastVertex && this->graph->GetOutDegree(vertex) == 0)
296  {
297  ++vertex;
298  }
299 
300  if (vertex < lastVertex)
301  {
302  vtkIdType nedges;
303  graph->GetOutEdges(vertex, iter, nedges);
304  end = iter + nedges;
305  }
306  else
307  {
308  iter = nullptr;
309  }
310  }
311  }
312 
313  void RecalculateEdge()
314  {
315  if (iter)
316  {
317  edge = vtkEdgeType(vertex, iter->Target, iter->Id);
318  }
319  }
320 
321  bool directed;
322  vtkIdType vertex;
323  vtkIdType lastVertex;
324  const vtkOutEdgeType * iter;
325  const vtkOutEdgeType * end;
326  vtkGraph *graph;
327  vtkEdgeType edge;
328 
329  friend class iterator_core_access;
330  };
331 
333  public iterator_facade<vtk_out_edge_pointer_iterator,
334  vtkEdgeType,
335  bidirectional_traversal_tag,
336  const vtkEdgeType&,
337  ptrdiff_t>
338  {
339  public:
340  explicit vtk_out_edge_pointer_iterator(vtkGraph *g = 0, vtkIdType v = 0, bool end = false) :
341  vertex(v), iter(nullptr)
342  {
343  if (g)
344  {
345  vtkIdType nedges;
346  g->GetOutEdges(vertex, iter, nedges);
347  if (end)
348  {
349  iter += nedges;
350  }
351  }
352  RecalculateEdge();
353  }
354 
355  private:
356  const vtkEdgeType& dereference() const
357  {
358  assert(iter);
359  return edge;
360  }
361 
362  bool equal(const vtk_out_edge_pointer_iterator& other) const
363  { return iter == other.iter; }
364 
365  void increment()
366  {
367  iter++;
368  RecalculateEdge();
369  }
370 
371  void decrement()
372  {
373  iter--;
374  RecalculateEdge();
375  }
376 
377  void RecalculateEdge()
378  {
379  if (iter)
380  {
381  edge = vtkEdgeType(vertex, iter->Target, iter->Id);
382  }
383  }
384 
385  vtkIdType vertex;
386  const vtkOutEdgeType *iter;
387  vtkEdgeType edge;
388 
389  friend class iterator_core_access;
390  };
391 
393  public iterator_facade<vtk_in_edge_pointer_iterator,
394  vtkEdgeType,
395  bidirectional_traversal_tag,
396  const vtkEdgeType&,
397  ptrdiff_t>
398  {
399  public:
400  explicit vtk_in_edge_pointer_iterator(vtkGraph *g = 0, vtkIdType v = 0, bool end = false) :
401  vertex(v), iter(nullptr)
402  {
403  if (g)
404  {
405  vtkIdType nedges;
406  g->GetInEdges(vertex, iter, nedges);
407  if (end)
408  {
409  iter += nedges;
410  }
411  }
412  RecalculateEdge();
413  }
414 
415  private:
416  const vtkEdgeType& dereference() const
417  {
418  assert(iter);
419  return edge;
420  }
421 
422  bool equal(const vtk_in_edge_pointer_iterator& other) const
423  { return iter == other.iter; }
424 
425  void increment()
426  {
427  iter++;
428  RecalculateEdge();
429  }
430 
431  void decrement()
432  {
433  iter--;
434  RecalculateEdge();
435  }
436 
437  void RecalculateEdge()
438  {
439  if (iter)
440  {
441  edge = vtkEdgeType(iter->Source, vertex, iter->Id);
442  }
443  }
444 
445  vtkIdType vertex;
446  const vtkInEdgeType *iter;
447  vtkEdgeType edge;
448 
449  friend class iterator_core_access;
450  };
451 
452  //===========================================================================
453  // vtkGraph
454  // VertexAndEdgeListGraphConcept
455  // BidirectionalGraphConcept
456  // AdjacencyGraphConcept
457 
459  public virtual bidirectional_graph_tag,
460  public virtual edge_list_graph_tag,
461  public virtual vertex_list_graph_tag,
462  public virtual adjacency_graph_tag { };
463 
464  template <>
465  struct graph_traits<vtkGraph*> {
467  static vertex_descriptor null_vertex() { return -1; }
469  static edge_descriptor null_edge() { return vtkEdgeType(-1, -1, -1); }
472 
475 
476  typedef allow_parallel_edge_tag edge_parallel_category;
481 
482  typedef adjacency_iterator_generator<vtkGraph*,
484  };
485 
486 #if BOOST_VERSION >= 104500
487  template<>
488  struct graph_property_type< vtkGraph* > {
489  typedef no_property type;
490  };
491 #endif
492 
493  template<>
494  struct vertex_property_type< vtkGraph* > {
495  typedef no_property type;
496  };
497 
498  template<>
499  struct edge_property_type< vtkGraph* > {
500  typedef no_property type;
501  };
502 
503 #if BOOST_VERSION >= 104500
504  template<>
505  struct graph_bundle_type< vtkGraph* > {
506  typedef no_property type;
507  };
508 #endif
509 
510  template<>
511  struct vertex_bundle_type< vtkGraph* > {
512  typedef no_property type;
513  };
514 
515  template<>
516  struct edge_bundle_type< vtkGraph* > {
517  typedef no_property type;
518  };
519 
520  inline bool has_no_edges(vtkGraph* g)
521  {
522  return ((g->GetNumberOfEdges() > 0) ? false : true);
523  }
524 
526  vtkGraph* g)
527  {
529  {
531  }
533  {
535  }
536  }
537 
538  //===========================================================================
539  // vtkDirectedGraph
540 
541  template <>
543  {
544  typedef directed_tag directed_category;
545  };
546 
547  // The graph_traits for a const graph are the same as a non-const graph.
548  template <>
549  struct graph_traits<const vtkDirectedGraph*> : graph_traits<vtkDirectedGraph*> { };
550 
551  // The graph_traits for a const graph are the same as a non-const graph.
552  template <>
553  struct graph_traits<vtkDirectedGraph* const> : graph_traits<vtkDirectedGraph*> { };
554 
555 #if BOOST_VERSION >= 104500
556  // Internal graph properties
557  template<>
558  struct graph_property_type< vtkDirectedGraph* >
559  : graph_property_type< vtkGraph* > { };
560 
561  // Internal graph properties
562  template<>
563  struct graph_property_type< vtkDirectedGraph* const >
564  : graph_property_type< vtkGraph* > { };
565 #endif
566 
567  // Internal vertex properties
568  template<>
569  struct vertex_property_type< vtkDirectedGraph* >
571 
572  // Internal vertex properties
573  template<>
574  struct vertex_property_type< vtkDirectedGraph* const >
576 
577  // Internal edge properties
578  template<>
579  struct edge_property_type< vtkDirectedGraph* >
581 
582  // Internal edge properties
583  template<>
584  struct edge_property_type< vtkDirectedGraph* const >
586 
587 #if BOOST_VERSION >= 104500
588  // Internal graph properties
589  template<>
590  struct graph_bundle_type< vtkDirectedGraph* >
591  : graph_bundle_type< vtkGraph* > { };
592 
593  // Internal graph properties
594  template<>
595  struct graph_bundle_type< vtkDirectedGraph* const >
596  : graph_bundle_type< vtkGraph* > { };
597 #endif
598 
599  // Internal vertex properties
600  template<>
601  struct vertex_bundle_type< vtkDirectedGraph* >
603 
604  // Internal vertex properties
605  template<>
606  struct vertex_bundle_type< vtkDirectedGraph* const >
608 
609  // Internal edge properties
610  template<>
611  struct edge_bundle_type< vtkDirectedGraph* >
613 
614  // Internal edge properties
615  template<>
616  struct edge_bundle_type< vtkDirectedGraph* const >
618 
619  //===========================================================================
620  // vtkTree
621 
622  template <>
623  struct graph_traits<vtkTree*> : graph_traits<vtkDirectedGraph*> { };
624 
625  // The graph_traits for a const graph are the same as a non-const graph.
626  template <>
627  struct graph_traits<const vtkTree*> : graph_traits<vtkTree*> { };
628 
629  // The graph_traits for a const graph are the same as a non-const graph.
630  template <>
631  struct graph_traits<vtkTree* const> : graph_traits<vtkTree*> { };
632 
633  //===========================================================================
634  // vtkUndirectedGraph
635  template <>
637  {
638  typedef undirected_tag directed_category;
639  };
640 
641  // The graph_traits for a const graph are the same as a non-const graph.
642  template <>
643  struct graph_traits<const vtkUndirectedGraph*> : graph_traits<vtkUndirectedGraph*> { };
644 
645  // The graph_traits for a const graph are the same as a non-const graph.
646  template <>
647  struct graph_traits<vtkUndirectedGraph* const> : graph_traits<vtkUndirectedGraph*> { };
648 
649 #if BOOST_VERSION >= 104500
650  // Internal graph properties
651  template<>
652  struct graph_property_type< vtkUndirectedGraph* >
653  : graph_property_type< vtkGraph* > { };
654 
655  // Internal graph properties
656  template<>
657  struct graph_property_type< vtkUndirectedGraph* const >
658  : graph_property_type< vtkGraph* > { };
659 #endif
660 
661  // Internal vertex properties
662  template<>
663  struct vertex_property_type< vtkUndirectedGraph* >
665 
666  // Internal vertex properties
667  template<>
668  struct vertex_property_type< vtkUndirectedGraph* const >
670 
671  // Internal edge properties
672  template<>
673  struct edge_property_type< vtkUndirectedGraph* >
675 
676  // Internal edge properties
677  template<>
678  struct edge_property_type< vtkUndirectedGraph* const >
680 
681 #if BOOST_VERSION >= 104500
682  // Internal graph properties
683  template<>
684  struct graph_bundle_type< vtkUndirectedGraph* >
685  : graph_bundle_type< vtkGraph* > { };
686 
687  // Internal graph properties
688  template<>
689  struct graph_bundle_type< vtkUndirectedGraph* const >
690  : graph_bundle_type< vtkGraph* > { };
691 #endif
692 
693  // Internal vertex properties
694  template<>
695  struct vertex_bundle_type< vtkUndirectedGraph* >
697 
698  // Internal vertex properties
699  template<>
700  struct vertex_bundle_type< vtkUndirectedGraph* const >
702 
703  // Internal edge properties
704  template<>
705  struct edge_bundle_type< vtkUndirectedGraph* >
707 
708  // Internal edge properties
709  template<>
710  struct edge_bundle_type< vtkUndirectedGraph* const >
712 
713  //===========================================================================
714  // vtkMutableDirectedGraph
715 
716  template <>
718 
719  // The graph_traits for a const graph are the same as a non-const graph.
720  template <>
722 
723  // The graph_traits for a const graph are the same as a non-const graph.
724  template <>
726 
727 #if BOOST_VERSION >= 104500
728  // Internal graph properties
729  template<>
730  struct graph_property_type< vtkMutableDirectedGraph* >
731  : graph_property_type< vtkDirectedGraph* > { };
732 
733  // Internal graph properties
734  template<>
735  struct graph_property_type< vtkMutableDirectedGraph* const >
736  : graph_property_type< vtkDirectedGraph* > { };
737 #endif
738 
739  // Internal vertex properties
740  template<>
741  struct vertex_property_type< vtkMutableDirectedGraph* >
743 
744  // Internal vertex properties
745  template<>
746  struct vertex_property_type< vtkMutableDirectedGraph* const >
748 
749  // Internal edge properties
750  template<>
751  struct edge_property_type< vtkMutableDirectedGraph* >
753 
754  // Internal edge properties
755  template<>
756  struct edge_property_type< vtkMutableDirectedGraph* const >
758 
759 #if BOOST_VERSION >= 104500
760  // Internal graph properties
761  template<>
762  struct graph_bundle_type< vtkMutableDirectedGraph* >
763  : graph_bundle_type< vtkDirectedGraph* > { };
764 
765  // Internal graph properties
766  template<>
767  struct graph_bundle_type< vtkMutableDirectedGraph* const >
768  : graph_bundle_type< vtkDirectedGraph* > { };
769 #endif
770 
771  // Internal vertex properties
772  template<>
773  struct vertex_bundle_type< vtkMutableDirectedGraph* >
775 
776  // Internal vertex properties
777  template<>
778  struct vertex_bundle_type< vtkMutableDirectedGraph* const >
780 
781  // Internal edge properties
782  template<>
783  struct edge_bundle_type< vtkMutableDirectedGraph* >
785 
786  // Internal edge properties
787  template<>
788  struct edge_bundle_type< vtkMutableDirectedGraph* const >
790 
791  //===========================================================================
792  // vtkMutableUndirectedGraph
793 
794  template <>
796 
797  // The graph_traits for a const graph are the same as a non-const graph.
798  template <>
800 
801  // The graph_traits for a const graph are the same as a non-const graph.
802  template <>
804 
805 #if BOOST_VERSION >= 104500
806  // Internal graph properties
807  template<>
808  struct graph_property_type< vtkMutableUndirectedGraph* >
809  : graph_property_type< vtkUndirectedGraph* > { };
810 
811  // Internal graph properties
812  template<>
813  struct graph_property_type< vtkMutableUndirectedGraph* const >
814  : graph_property_type< vtkUndirectedGraph* > { };
815 #endif
816 
817  // Internal vertex properties
818  template<>
819  struct vertex_property_type< vtkMutableUndirectedGraph* >
821 
822  // Internal vertex properties
823  template<>
824  struct vertex_property_type< vtkMutableUndirectedGraph* const >
826 
827  // Internal edge properties
828  template<>
829  struct edge_property_type< vtkMutableUndirectedGraph* >
831 
832  // Internal edge properties
833  template<>
834  struct edge_property_type< vtkMutableUndirectedGraph* const >
836 
837 #if BOOST_VERSION >= 104500
838  // Internal graph properties
839  template<>
840  struct graph_bundle_type< vtkMutableUndirectedGraph* >
841  : graph_bundle_type< vtkUndirectedGraph* > { };
842 
843  // Internal graph properties
844  template<>
845  struct graph_bundle_type< vtkMutableUndirectedGraph* const >
846  : graph_bundle_type< vtkUndirectedGraph* > { };
847 #endif
848 
849  // Internal vertex properties
850  template<>
851  struct vertex_bundle_type< vtkMutableUndirectedGraph* >
853 
854  // Internal vertex properties
855  template<>
856  struct vertex_bundle_type< vtkMutableUndirectedGraph* const >
858 
859  // Internal edge properties
860  template<>
861  struct edge_bundle_type< vtkMutableUndirectedGraph* >
863 
864  // Internal edge properties
865  template<>
866  struct edge_bundle_type< vtkMutableUndirectedGraph* const >
868 
869  //===========================================================================
870  // API implementation
871  template <>
872  class vertex_property< vtkGraph* > {
873  public:
874  typedef vtkIdType type;
875  };
876 
877  template <>
878  class edge_property< vtkGraph* > {
879  public:
880  typedef vtkIdType type;
881  };
882 } // end namespace boost
883 
886  vtkGraph *)
887 {
888  return e.Source;
889 }
890 
893  vtkGraph *)
894 {
895  return e.Target;
896 }
897 
898 inline std::pair<
902 {
904  vtkIdType start = 0;
906  {
907  int rank =
909  start = helper->MakeDistributedId(rank, start);
910  }
911 
912  return std::make_pair( Iter(start),
913  Iter(start + g->GetNumberOfVertices()) );
914 }
915 
916 inline std::pair<
920 {
922  return std::make_pair( Iter(g), Iter(g, g->GetNumberOfVertices()) );
923 }
924 
925 inline std::pair<
930  vtkGraph *g)
931 {
933  std::pair<Iter, Iter> p = std::make_pair( Iter(g, u), Iter(g, u, true) );
934  return p;
935 }
936 
937 inline std::pair<
942  vtkGraph *g)
943 {
945  std::pair<Iter, Iter> p = std::make_pair( Iter(g, u), Iter(g, u, true) );
946  return p;
947 }
948 
949 inline std::pair<
954  vtkGraph *g)
955 {
958  std::pair<OutEdgeIter, OutEdgeIter> out = out_edges(u, g);
959  return std::make_pair( Iter(out.first, &g), Iter(out.second, &g) );
960 }
961 
964 {
965  return g->GetNumberOfVertices();
966 }
967 
970 {
971  return g->GetNumberOfEdges();
972 }
973 
977  vtkGraph *g)
978 {
979  return g->GetOutDegree(u);
980 }
981 
985  vtkDirectedGraph *g)
986 {
987  return g->GetInDegree(u);
988 }
989 
993  vtkGraph *g)
994 {
995  return g->GetDegree(u);
996 }
997 
1000 {
1001  return g->AddVertex();
1002 }
1003 
1004 inline std::pair<
1006  bool>
1011 {
1013  return std::make_pair(e, true);
1014 }
1015 
1018 {
1019  return g->AddVertex();
1020 }
1021 
1022 inline std::pair<
1024  bool>
1029 {
1031  return std::make_pair(e, true);
1032 }
1033 
1034 namespace boost {
1035  //===========================================================================
1036  // An edge map for vtkGraph.
1037  // This is a common input needed for algorithms.
1038 
1039  struct vtkGraphEdgeMap { };
1040 
1041  template <>
1043  {
1047  typedef readable_property_map_tag category;
1048  };
1049 
1052  vtkGraphEdgeMap vtkNotUsed(arr),
1054  {
1055  return key.Id;
1056  }
1057 
1058  //===========================================================================
1059  // Helper for vtkGraph edge property maps
1060  // Automatically converts boost edge ids to vtkGraph edge ids.
1061 
1062  template<typename PMap>
1064  {
1065  public:
1067  PMap pmap;
1072 
1074  {
1075  return get(pmap, key.Id);
1076  }
1077  };
1078 
1079  template<typename PMap>
1080  inline typename property_traits<PMap>::reference
1083  vtkEdgeType key)
1084  {
1085  return get(helper.pmap, key.Id);
1086  }
1087 
1088  template<typename PMap>
1089  inline void
1092  vtkEdgeType key,
1093  const typename property_traits<PMap>::value_type & value)
1094  {
1095  put(helper.pmap, key.Id, value);
1096  }
1097 
1098  //===========================================================================
1099  // Helper for vtkGraph vertex property maps
1100  // Automatically converts boost vertex ids to vtkGraph vertex ids.
1101 
1102  template<typename PMap>
1104  {
1105  public:
1107  PMap pmap;
1112 
1114  {
1115  return get(pmap, key);
1116  }
1117  };
1118 
1119  template<typename PMap>
1120  inline typename property_traits<PMap>::reference
1123  vtkIdType key)
1124  {
1125  return get(helper.pmap, key);
1126  }
1127 
1128  template<typename PMap>
1129  inline void
1132  vtkIdType key,
1133  const typename property_traits<PMap>::value_type & value)
1134  {
1135  put(helper.pmap, key, value);
1136  }
1137 
1138  //===========================================================================
1139  // An index map for vtkGraph
1140  // This is a common input needed for algorithms
1141 
1142  struct vtkGraphIndexMap { };
1143 
1144  template <>
1146  {
1150  typedef readable_property_map_tag category;
1151  };
1152 
1155  vtkGraphIndexMap vtkNotUsed(arr),
1157  {
1158  return key;
1159  }
1160 
1161  //===========================================================================
1162  // Helper for vtkGraph property maps
1163  // Automatically multiplies the property value by some value (default 1)
1164  template<typename PMap>
1166  {
1167  public:
1168  vtkGraphPropertyMapMultiplier(PMap m, float multi=1) : pmap(m),multiplier(multi){}
1169  PMap pmap;
1170  float multiplier;
1175  };
1176 
1177  template<typename PMap>
1178  inline typename property_traits<PMap>::reference
1181  const typename property_traits<PMap>::key_type & key)
1182  {
1183  return multi.multiplier * get(multi.pmap, key);
1184  }
1185 
1186  template<typename PMap>
1187  inline void
1190  const typename property_traits<PMap>::key_type & key,
1191  const typename property_traits<PMap>::value_type & value)
1192  {
1193  put(multi.pmap, key, value);
1194  }
1195 
1196  // Allow algorithms to automatically extract vtkGraphIndexMap from a
1197  // VTK graph
1198  template<>
1199  struct property_map<vtkGraph*, vertex_index_t>
1200  {
1203  };
1204 
1205  template<>
1206  struct property_map<vtkDirectedGraph*, vertex_index_t>
1208 
1209  template<>
1210  struct property_map<vtkUndirectedGraph*, vertex_index_t>
1212 
1213  inline vtkGraphIndexMap get(vertex_index_t, vtkGraph*) { return vtkGraphIndexMap(); }
1214 
1215  template<>
1216  struct property_map<vtkGraph*, edge_index_t>
1217  {
1220  };
1221 
1222  template<>
1223  struct property_map<vtkDirectedGraph*, edge_index_t>
1225 
1226  template<>
1227  struct property_map<vtkUndirectedGraph*, edge_index_t>
1229 
1230  inline vtkGraphIndexMap get(edge_index_t, vtkGraph*) { return vtkGraphIndexMap(); }
1231 
1232  // property_map specializations for const-qualified graphs
1233  template<>
1234  struct property_map<vtkDirectedGraph* const, vertex_index_t>
1236 
1237  template<>
1238  struct property_map<vtkUndirectedGraph* const, vertex_index_t>
1240 
1241  template<>
1242  struct property_map<vtkDirectedGraph* const, edge_index_t>
1244 
1245  template<>
1246  struct property_map<vtkUndirectedGraph* const, edge_index_t>
1248 } // namespace boost
1249 
1250 #if BOOST_VERSION > 104000
1251 #include <boost/property_map/vector_property_map.hpp>
1252 #else
1253 #include <boost/vector_property_map.hpp>
1254 #endif
1255 
1256 
1257 #endif // vtkBoostGraphAdapter_h
1258 // VTK-HeaderTest-Exclude: vtkBoostGraphAdapter.h
vtkEdgeBase::Id
vtkIdType Id
Definition: vtkGraph.h:255
boost::graph_traits< vtkGraph * >
Definition: vtkBoostGraphAdapter.h:465
out_degree
boost::graph_traits< vtkGraph * >::degree_size_type out_degree(boost::graph_traits< vtkGraph * >::vertex_descriptor u, vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:975
boost::vtkGraphEdgeMap
Definition: vtkBoostGraphAdapter.h:1039
boost::graph_traits< vtkGraph * >::null_edge
static edge_descriptor null_edge()
Definition: vtkBoostGraphAdapter.h:469
boost::remove_edge
void remove_edge(graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:525
vtkAbstractArray::GetVariantValue
virtual vtkVariant GetVariantValue(vtkIdType valueIdx)
Retrieve value from the array as a variant.
vtkVariant.h
vtkMutableDirectedGraph
An editable directed graph.
Definition: vtkMutableDirectedGraph.h:51
edges
std::pair< boost::graph_traits< vtkGraph * >::edge_iterator, boost::graph_traits< vtkGraph * >::edge_iterator > edges(vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:919
boost::put
void put(vtkGraphPropertyMapMultiplier< PMap > multi, const typename property_traits< PMap >::key_type &key, const typename property_traits< PMap >::value_type &value)
Definition: vtkBoostGraphAdapter.h:1188
boost::vtkGraphEdgePropertyMapHelper::key_type
vtkEdgeType key_type
Definition: vtkBoostGraphAdapter.h:1070
vtkDistributedGraphHelper
helper for the vtkGraph class that allows the graph to be distributed across multiple memory spaces.
Definition: vtkDistributedGraphHelper.h:77
vtkMutableDirectedGraph::AddEdge
vtkEdgeType AddEdge(vtkIdType u, vtkIdType v)
Adds a directed edge from u to v, where u and v are vertex indices, and returns a vtkEdgeType structu...
vtkGraph::GetDistributedGraphHelper
vtkDistributedGraphHelper * GetDistributedGraphHelper()
Retrieves the distributed graph helper for this graph.
boost::property_map< vtkUndirectedGraph *, edge_index_t >
Definition: vtkBoostGraphAdapter.h:1227
vtkUndirectedGraph
An undirected graph.
Definition: vtkUndirectedGraph.h:54
boost::vtkGraphEdgePropertyMapHelper::operator[]
reference operator[](const key_type &key) const
Definition: vtkBoostGraphAdapter.h:1073
boost::vtk_vertex_iterator::iterator_core_access
friend class iterator_core_access
Definition: vtkBoostGraphAdapter.h:179
adjacent_vertices
std::pair< boost::graph_traits< vtkGraph * >::adjacency_iterator, boost::graph_traits< vtkGraph * >::adjacency_iterator > adjacent_vertices(boost::graph_traits< vtkGraph * >::vertex_descriptor u, vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:952
boost::property_traits< vtkAbstractArray * >::reference
vtkVariant reference
Definition: vtkBoostGraphAdapter.h:120
vtkMutableUndirectedGraph
An editable undirected graph.
Definition: vtkMutableUndirectedGraph.h:46
boost::vertex_property_type< vtkUndirectedGraph * >
Definition: vtkBoostGraphAdapter.h:663
boost::property_traits
Definition: vtkBoostGraphAdapter.h:58
boost::vtkGraphEdgePropertyMapHelper::vtkGraphEdgePropertyMapHelper
vtkGraphEdgePropertyMapHelper(PMap m)
Definition: vtkBoostGraphAdapter.h:1066
vtkX3D::value
Definition: vtkX3D.h:220
vtkDataArray::SetTuple1
void SetTuple1(vtkIdType tupleIdx, double value)
These methods are included as convenience for the wrappers.
boost::vtkGraphVertexPropertyMapHelper::vtkGraphVertexPropertyMapHelper
vtkGraphVertexPropertyMapHelper(PMap m)
Definition: vtkBoostGraphAdapter.h:1106
vtkX3D::type
Definition: vtkX3D.h:516
vtkIdType
int vtkIdType
Definition: vtkType.h:349
in_edges
std::pair< boost::graph_traits< vtkGraph * >::in_edge_iterator, boost::graph_traits< vtkGraph * >::in_edge_iterator > in_edges(boost::graph_traits< vtkGraph * >::vertex_descriptor u, vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:940
boost::vertex_property_type< vtkDirectedGraph * >
Definition: vtkBoostGraphAdapter.h:569
boost::vtk_edge_iterator::vtk_edge_iterator
vtk_edge_iterator(vtkGraph *g=0, vtkIdType v=0)
Definition: vtkBoostGraphAdapter.h:190
boost::property_traits< vtkAbstractArray * >::category
read_write_property_map_tag category
Definition: vtkBoostGraphAdapter.h:122
boost::vtkGraphVertexPropertyMapHelper::category
property_traits< PMap >::category category
Definition: vtkBoostGraphAdapter.h:1111
vtkMutableUndirectedGraph.h
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:41
boost::property_traits< vtkDataArray * >::category
read_write_property_map_tag category
Definition: vtkBoostGraphAdapter.h:100
boost::graph_traits< vtkDirectedGraph * >
Definition: vtkBoostGraphAdapter.h:542
boost::property_traits< vtkGraphIndexMap >::reference
vtkIdType reference
Definition: vtkBoostGraphAdapter.h:1148
vtkGraph::GetNumberOfVertices
virtual vtkIdType GetNumberOfVertices()
The number of vertices in the graph.
boost::vtkGraphPropertyMapMultiplier::vtkGraphPropertyMapMultiplier
vtkGraphPropertyMapMultiplier(PMap m, float multi=1)
Definition: vtkBoostGraphAdapter.h:1168
boost::edge_property_type< vtkGraph * >
Definition: vtkBoostGraphAdapter.h:499
boost::vtkGraphVertexPropertyMapHelper::value_type
property_traits< PMap >::value_type value_type
Definition: vtkBoostGraphAdapter.h:1108
vtkX3D::key
Definition: vtkX3D.h:257
boost::property_traits< vtkDataArray * >::key_type
vtkIdType key_type
Definition: vtkBoostGraphAdapter.h:99
vtkUndirectedGraph.h
boost::edge_bundle_type< vtkGraph * >::type
no_property type
Definition: vtkBoostGraphAdapter.h:517
vtkTree.h
boost::property_traits< vtkGraphIndexMap >::key_type
vtkIdType key_type
Definition: vtkBoostGraphAdapter.h:1149
boost::vertex_bundle_type< vtkGraph * >
Definition: vtkBoostGraphAdapter.h:511
boost::property_traits< vtkAbstractArray * >::value_type
vtkVariant value_type
Definition: vtkBoostGraphAdapter.h:119
boost::graph_traits< vtkMutableDirectedGraph * >
Definition: vtkBoostGraphAdapter.h:717
boost::vtkGraphPropertyMapMultiplier::multiplier
float multiplier
Definition: vtkBoostGraphAdapter.h:1170
boost::property_traits< vtkGraphEdgeMap >::value_type
vtkIdType value_type
Definition: vtkBoostGraphAdapter.h:1044
detail
Definition: vtkGenericDataArrayLookupHelper.h:31
vtkDirectedGraph
A directed graph.
Definition: vtkDirectedGraph.h:47
boost
Forward declaration required for Boost serialization.
Definition: vtkVariantArray.h:44
vtkGraph::GetNumberOfEdges
virtual vtkIdType GetNumberOfEdges()
The number of edges in the graph.
boost::vtk_edge_iterator::iterator_core_access
friend class iterator_core_access
Definition: vtkBoostGraphAdapter.h:329
vtkInEdgeType
Definition: vtkGraph.h:267
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkMutableDirectedGraph.h
boost::graph_traits< vtkMutableUndirectedGraph * >
Definition: vtkBoostGraphAdapter.h:795
vtkAbstractArray.h
boost::vtk_out_edge_pointer_iterator
Definition: vtkBoostGraphAdapter.h:332
boost::property_map< vtkGraph *, edge_index_t >
Definition: vtkBoostGraphAdapter.h:1216
boost::property_traits< vtkDataArray * >::value_type
double value_type
Definition: vtkBoostGraphAdapter.h:97
vtkDirectedGraph.h
boost::put
void put(vtkDataArray *arr, vtkIdType key, const double &value)
Definition: vtkBoostGraphAdapter.h:110
boost::vertex_bundle_type< vtkGraph * >::type
no_property type
Definition: vtkBoostGraphAdapter.h:512
boost::has_no_edges
bool has_no_edges(vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:520
vtkOutEdgeType::Target
vtkIdType Target
Definition: vtkGraph.h:264
vtkAbstractArray::InsertVariantValue
virtual void InsertVariantValue(vtkIdType valueIdx, vtkVariant value)=0
Insert a value into the array from a variant.
out_edges
std::pair< boost::graph_traits< vtkGraph * >::out_edge_iterator, boost::graph_traits< vtkGraph * >::out_edge_iterator > out_edges(boost::graph_traits< vtkGraph * >::vertex_descriptor u, vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:928
boost::property_traits< vtkGraphIndexMap >::value_type
vtkIdType value_type
Definition: vtkBoostGraphAdapter.h:1147
boost::property_map< vtkGraph *, vertex_index_t >::type
vtkGraphIndexMap type
Definition: vtkBoostGraphAdapter.h:1201
boost::vertex_property_type< vtkGraph * >
Definition: vtkBoostGraphAdapter.h:494
boost::vtkGraphEdgePropertyMapHelper::category
property_traits< PMap >::category category
Definition: vtkBoostGraphAdapter.h:1071
boost::vtkGraphPropertyMapMultiplier::key_type
property_traits< PMap >::key_type key_type
Definition: vtkBoostGraphAdapter.h:1173
boost::vtkGraphPropertyMapMultiplier::category
property_traits< PMap >::category category
Definition: vtkBoostGraphAdapter.h:1174
boost::vertex_bundle_type< vtkUndirectedGraph * >
Definition: vtkBoostGraphAdapter.h:695
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:885
vtkTree
A rooted tree data structure.
Definition: vtkTree.h:60
vtkEdgeType
Definition: vtkGraph.h:276
vtkMutableUndirectedGraph::AddEdge
vtkEdgeType AddEdge(vtkIdType u, vtkIdType v)
Adds an undirected edge from u to v, where u and v are vertex indices, and returns a vtkEdgeType stru...
boost::graph_traits< vtkUndirectedGraph * >::directed_category
undirected_tag directed_category
Definition: vtkBoostGraphAdapter.h:638
boost::vtkGraphVertexPropertyMapHelper::reference
property_traits< PMap >::reference reference
Definition: vtkBoostGraphAdapter.h:1109
boost::vtkGraphVertexPropertyMapHelper::pmap
PMap pmap
Definition: vtkBoostGraphAdapter.h:1107
boost::graph_traits< vtkDirectedGraph * >::directed_category
directed_tag directed_category
Definition: vtkBoostGraphAdapter.h:544
boost::vtkGraphEdgePropertyMapHelper::pmap
PMap pmap
Definition: vtkBoostGraphAdapter.h:1067
boost::property_map< vtkGraph *, edge_index_t >::type
vtkGraphIndexMap type
Definition: vtkBoostGraphAdapter.h:1218
vtkFloatArray.h
vtkDistributedGraphHelper::GetVertexOwner
vtkIdType GetVertexOwner(vtkIdType v) const
Returns owner of vertex v, by extracting top ceil(log2 P) bits of v.
boost::property_map< vtkUndirectedGraph *, vertex_index_t >
Definition: vtkBoostGraphAdapter.h:1210
boost::vtkGraph_traversal_category
Definition: vtkBoostGraphAdapter.h:458
add_edge
std::pair< boost::graph_traits< vtkMutableDirectedGraph * >::edge_descriptor, bool > add_edge(boost::graph_traits< vtkMutableDirectedGraph * >::vertex_descriptor u, boost::graph_traits< vtkMutableDirectedGraph * >::vertex_descriptor v, vtkMutableDirectedGraph *g)
Definition: vtkBoostGraphAdapter.h:1007
boost::vtk_in_edge_pointer_iterator::vtk_in_edge_pointer_iterator
vtk_in_edge_pointer_iterator(vtkGraph *g=0, vtkIdType v=0, bool end=false)
Definition: vtkBoostGraphAdapter.h:400
boost::property_traits< vtkGraphEdgeMap >::key_type
vtkEdgeType key_type
Definition: vtkBoostGraphAdapter.h:1046
boost::graph_traits< vtkGraph * >::vertex_iterator
vtk_vertex_iterator vertex_iterator
Definition: vtkBoostGraphAdapter.h:473
vtkGraph::GetOutDegree
virtual vtkIdType GetOutDegree(vtkIdType v)
The number of outgoing edges from vertex v.
vtkMutableUndirectedGraph::SafeDownCast
static vtkMutableUndirectedGraph * SafeDownCast(vtkObjectBase *o)
vtkGraph::GetInDegree
virtual vtkIdType GetInDegree(vtkIdType v)
The number of incoming edges to vertex v.
boost::get
double get(vtkDataArray *const &arr, vtkIdType key)
Definition: vtkBoostGraphAdapter.h:104
vtkDataObject::DATA_PIECE_NUMBER
static vtkInformationIntegerKey * DATA_PIECE_NUMBER()
boost::vtkGraphEdgePropertyMapHelper::reference
property_traits< PMap >::reference reference
Definition: vtkBoostGraphAdapter.h:1069
boost::vertex_bundle_type< vtkDirectedGraph * >
Definition: vtkBoostGraphAdapter.h:601
vtkDoubleArray.h
vertices
std::pair< boost::graph_traits< vtkGraph * >::vertex_iterator, boost::graph_traits< vtkGraph * >::vertex_iterator > vertices(vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:901
boost::property_traits< vtkGraphEdgeMap >::reference
vtkIdType reference
Definition: vtkBoostGraphAdapter.h:1045
vtkMutableUndirectedGraph::RemoveEdge
void RemoveEdge(vtkIdType e)
Removes the edge from the graph.
boost::property_traits< vtkGraphEdgeMap >::category
readable_property_map_tag category
Definition: vtkBoostGraphAdapter.h:1047
boost::property_map< vtkDirectedGraph *, edge_index_t >
Definition: vtkBoostGraphAdapter.h:1223
vtkGraph::GetDegree
virtual vtkIdType GetDegree(vtkIdType v)
The total of all incoming and outgoing vertices for vertex v.
boost::get
vtkGraphIndexMap get(edge_index_t, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:1230
boost::vtkGraphIndexMap
Definition: vtkBoostGraphAdapter.h:1142
boost::edge_bundle_type< vtkGraph * >
Definition: vtkBoostGraphAdapter.h:516
boost::vtkGraphPropertyMapMultiplier
Definition: vtkBoostGraphAdapter.h:1165
boost::vtkGraphVertexPropertyMapHelper::operator[]
reference operator[](const key_type &key) const
Definition: vtkBoostGraphAdapter.h:1113
vtkDistributedGraphHelper.h
boost::edge_property_type< vtkDirectedGraph * >
Definition: vtkBoostGraphAdapter.h:579
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
vtkX3D::reference
Definition: vtkX3D.h:464
vtkMutableUndirectedGraph::AddVertex
vtkIdType AddVertex()
Adds a vertex to the graph and returns the index of the new vertex.
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:71
boost::vtk_vertex_iterator
Definition: vtkBoostGraphAdapter.h:158
boost::vtk_in_edge_pointer_iterator
Definition: vtkBoostGraphAdapter.h:392
vtkDistributedGraphHelper::MakeDistributedId
vtkIdType MakeDistributedId(int owner, vtkIdType local)
Builds a distributed ID consisting of the given owner and the local ID.
boost::property_traits< vtkAbstractArray * >::key_type
vtkIdType key_type
Definition: vtkBoostGraphAdapter.h:121
vtkIdTypeArray.h
vtkInEdgeType::Source
vtkIdType Source
Definition: vtkGraph.h:273
boost::edge_property_type< vtkUndirectedGraph * >
Definition: vtkBoostGraphAdapter.h:673
boost::property_map< vtkGraph *, edge_index_t >::const_type
vtkGraphIndexMap const_type
Definition: vtkBoostGraphAdapter.h:1219
degree
boost::graph_traits< vtkGraph * >::degree_size_type degree(boost::graph_traits< vtkGraph * >::vertex_descriptor u, vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:991
boost::vtk_out_edge_pointer_iterator::vtk_out_edge_pointer_iterator
vtk_out_edge_pointer_iterator(vtkGraph *g=0, vtkIdType v=0, bool end=false)
Definition: vtkBoostGraphAdapter.h:340
boost::edge_property_type< vtkGraph * >::type
no_property type
Definition: vtkBoostGraphAdapter.h:500
boost::property_traits< vtkDataArray * >::reference
double reference
Definition: vtkBoostGraphAdapter.h:98
add_vertex
boost::graph_traits< vtkMutableDirectedGraph * >::vertex_descriptor add_vertex(vtkMutableDirectedGraph *g)
Definition: vtkBoostGraphAdapter.h:999
boost::vtk_vertex_iterator::vtk_vertex_iterator
vtk_vertex_iterator(vtkIdType i=0)
Definition: vtkBoostGraphAdapter.h:166
boost::graph_traits< vtkGraph * >::in_edge_iterator
vtk_in_edge_pointer_iterator in_edge_iterator
Definition: vtkBoostGraphAdapter.h:471
vtkAbstractArray
Abstract superclass for all arrays.
Definition: vtkAbstractArray.h:78
boost::vtkGraphEdgePropertyMapHelper
Definition: vtkBoostGraphAdapter.h:1063
boost::graph_traits< vtkTree * >
Definition: vtkBoostGraphAdapter.h:623
num_vertices
boost::graph_traits< vtkGraph * >::vertices_size_type num_vertices(vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:963
boost::vtkGraphPropertyMapMultiplier::pmap
PMap pmap
Definition: vtkBoostGraphAdapter.h:1169
boost::graph_traits< vtkGraph * >::out_edge_iterator
vtk_out_edge_pointer_iterator out_edge_iterator
Definition: vtkBoostGraphAdapter.h:470
vtkGraph::GetOutEdges
virtual void GetOutEdges(vtkIdType v, vtkOutEdgeIterator *it)
Initializes the out edge iterator to iterate over all outgoing edges of vertex v.
boost::edge_bundle_type< vtkDirectedGraph * >
Definition: vtkBoostGraphAdapter.h:611
boost::vtkGraphPropertyMapMultiplier::value_type
property_traits< PMap >::value_type value_type
Definition: vtkBoostGraphAdapter.h:1171
boost::vtkGraphVertexPropertyMapHelper
Definition: vtkBoostGraphAdapter.h:1103
vtkIntArray.h
boost::graph_traits< vtkGraph * >::vertices_size_type
vtkIdType vertices_size_type
Definition: vtkBoostGraphAdapter.h:478
boost::graph_traits< vtkGraph * >::edge_descriptor
vtkEdgeType edge_descriptor
Definition: vtkBoostGraphAdapter.h:468
boost::vtkGraphEdgePropertyMapHelper::value_type
property_traits< PMap >::value_type value_type
Definition: vtkBoostGraphAdapter.h:1068
vtkDataArray.h
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:41
vtkDataObject::GetInformation
virtual vtkInformation * GetInformation()
Set/Get the information object associated with this data object.
vtkDirectedGraph::SafeDownCast
static vtkDirectedGraph * SafeDownCast(vtkObjectBase *o)
vtkOutEdgeType
Definition: vtkGraph.h:258
vtkDataObject.h
vtkInformation.h
vtkMutableDirectedGraph::RemoveEdge
void RemoveEdge(vtkIdType e)
Removes the edge from the graph.
boost::graph_traits< vtkGraph * >::edges_size_type
vtkIdType edges_size_type
Definition: vtkBoostGraphAdapter.h:479
boost::edge_property< vtkGraph * >::type
vtkIdType type
Definition: vtkBoostGraphAdapter.h:880
boost::property_map< vtkGraph *, vertex_index_t >::const_type
vtkGraphIndexMap const_type
Definition: vtkBoostGraphAdapter.h:1202
boost::graph_traits< vtkGraph * >::degree_size_type
vtkIdType degree_size_type
Definition: vtkBoostGraphAdapter.h:480
num_edges
boost::graph_traits< vtkGraph * >::edges_size_type num_edges(vtkGraph *g)
Definition: vtkBoostGraphAdapter.h:969
boost::vertex_property< vtkGraph * >::type
vtkIdType type
Definition: vtkBoostGraphAdapter.h:874
boost::graph_traits< vtkGraph * >::null_vertex
static vertex_descriptor null_vertex()
Definition: vtkBoostGraphAdapter.h:467
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:41
boost::graph_traits< vtkGraph * >::vertex_descriptor
vtkIdType vertex_descriptor
Definition: vtkBoostGraphAdapter.h:466
vtkMutableDirectedGraph::SafeDownCast
static vtkMutableDirectedGraph * SafeDownCast(vtkObjectBase *o)
vtkInformation::Get
int Get(vtkInformationIntegerKey *key)
boost::vtk_out_edge_pointer_iterator::iterator_core_access
friend class iterator_core_access
Definition: vtkBoostGraphAdapter.h:389
boost::vtk_edge_iterator
Definition: vtkBoostGraphAdapter.h:182
boost::graph_traits< vtkGraph * >::traversal_category
vtkGraph_traversal_category traversal_category
Definition: vtkBoostGraphAdapter.h:477
boost::graph_traits< vtkUndirectedGraph * >
Definition: vtkBoostGraphAdapter.h:636
vtkGraph
Base class for graph data types.
Definition: vtkGraph.h:287
vtkDistributedGraphHelper::GetEdgeOwner
vtkIdType GetEdgeOwner(vtkIdType e_id) const
Returns owner of edge with ID e_id, by extracting top ceil(log2 P) bits of e_id.
boost::vtkGraphVertexPropertyMapHelper::key_type
vtkIdType key_type
Definition: vtkBoostGraphAdapter.h:1110
boost::property_traits< vtkGraphIndexMap >::category
readable_property_map_tag category
Definition: vtkBoostGraphAdapter.h:1150
target
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:892
boost::edge_bundle_type< vtkUndirectedGraph * >
Definition: vtkBoostGraphAdapter.h:705
boost::graph_traits< vtkGraph * >::edge_iterator
vtk_edge_iterator edge_iterator
Definition: vtkBoostGraphAdapter.h:474
boost::vertex_property_type< vtkGraph * >::type
no_property type
Definition: vtkBoostGraphAdapter.h:495
vtkMutableDirectedGraph::AddVertex
vtkIdType AddVertex()
Adds a vertex to the graph and returns the index of the new vertex.
boost::property_map< vtkDirectedGraph *, vertex_index_t >
Definition: vtkBoostGraphAdapter.h:1206
boost::vtkGraphPropertyMapMultiplier::reference
property_traits< PMap >::reference reference
Definition: vtkBoostGraphAdapter.h:1172
in_degree
boost::graph_traits< vtkDirectedGraph * >::degree_size_type in_degree(boost::graph_traits< vtkDirectedGraph * >::vertex_descriptor u, vtkDirectedGraph *g)
Definition: vtkBoostGraphAdapter.h:983
boost::vtk_in_edge_pointer_iterator::iterator_core_access
friend class iterator_core_access
Definition: vtkBoostGraphAdapter.h:449
vtkDataArray::GetTuple1
double GetTuple1(vtkIdType tupleIdx)
These methods are included as convenience for the wrappers.
boost::graph_traits< vtkGraph * >::edge_parallel_category
allow_parallel_edge_tag edge_parallel_category
Definition: vtkBoostGraphAdapter.h:476
boost::vtkPropertyMapMacro
vtkPropertyMapMacro(vtkIntArray, int) vtkPropertyMapMacro(vtkIdTypeArray
boost::property_map< vtkGraph *, vertex_index_t >
Definition: vtkBoostGraphAdapter.h:1199
boost::graph_traits< vtkGraph * >::adjacency_iterator
adjacency_iterator_generator< vtkGraph *, vertex_descriptor, out_edge_iterator >::type adjacency_iterator
Definition: vtkBoostGraphAdapter.h:483