Krita Source Code Documentation
Loading...
Searching...
No Matches
KisLazyFillGraph Class Reference

#include <kis_lazy_fill_graph.h>

Classes

struct  EdgeIndexBin
 
struct  traversal_category
 
struct  VertexDescriptor
 

Public Types

typedef transform_iterator< adjacent_vertex_function, degree_iteratoradjacency_iterator
 
typedef kis_detail::lazy_fill_graph_adjacent_vertex_at< typeadjacent_vertex_function
 
typedef counting_iterator< degree_size_typedegree_iterator
 
typedef EdgeIndex degree_size_type
 
typedef directed_tag directed_category
 
typedef std::pair< vertex_descriptor, vertex_descriptoredge_descriptor
 
typedef kis_detail::lazy_fill_graph_edge_at< typeedge_function
 
typedef counting_iterator< edges_size_typeedge_index_iterator
 
typedef transform_iterator< edge_function, edge_index_iteratoredge_iterator
 
typedef disallow_parallel_edge_tag edge_parallel_category
 
typedef long EdgeIndex
 
enum  EdgeIndexBinId {
  HORIZONTAL , HORIZONTAL_REVERSED , VERTICAL , VERTICAL_REVERSED ,
  LABEL_A , LABEL_A_REVERSED , LABEL_B , LABEL_B_REVERSED
}
 
typedef EdgeIndex edges_size_type
 
typedef kis_detail::lazy_fill_graph_out_edge_at< typeout_edge_function
 
typedef transform_iterator< out_edge_function, degree_iteratorout_edge_iterator
 
typedef KisLazyFillGraph type
 
typedef VertexDescriptor vertex_descriptor
 
typedef kis_detail::lazy_fill_graph_vertex_at< KisLazyFillGraphvertex_function
 
typedef counting_iterator< vertices_size_typevertex_index_iterator
 
typedef transform_iterator< vertex_function, vertex_index_iteratorvertex_iterator
 
typedef long VertexIndex
 
typedef VertexIndex vertices_size_type
 

Public Member Functions

edge_descriptor edge_at (edges_size_type edge_index) const
 
edges_size_type index_of (edge_descriptor edge) const
 
vertices_size_type index_of (vertex_descriptor vertex) const
 
 KisLazyFillGraph ()
 
 KisLazyFillGraph (const QRect &mainRect, const KisRegion &aLabelRegion, const KisRegion &bLabelRegion)
 
edges_size_type num_edges () const
 
vertices_size_type num_vertices () const
 
degree_size_type out_degree (vertex_descriptor vertex) const
 
edge_descriptor out_edge_at (vertex_descriptor vertex, degree_size_type out_edge_index) const
 
QRect rect () const
 
QSize size () const
 
vertex_descriptor vertex_at (vertices_size_type vertex_index) const
 
 ~KisLazyFillGraph ()
 

Static Public Member Functions

static vertex_descriptor null_vertex ()
 

Public Attributes

QRect m_aLabelArea
 
QVector< QRect > m_aLabelRects
 
vertices_size_type m_aReversedEdgesStart
 
QRect m_bLabelArea
 
QVector< QRect > m_bLabelRects
 
vertices_size_type m_bReversedEdgesStart
 
QVector< EdgeIndexBinm_edgeBins
 
vertices_size_type m_height
 
QRect m_mainArea
 
vertices_size_type m_numAEdges
 
vertices_size_type m_numBEdges
 
vertices_size_type m_numEdges
 
vertices_size_type m_numVertices
 
vertices_size_type m_width
 
vertices_size_type m_x
 
vertices_size_type m_y
 

Static Private Member Functions

static bool findInRects (const QVector< QRect > &rects, const QPoint &pt)
 
static vertices_size_type numVacantEdges (const vertex_descriptor &vertex, const QRect &rc)
 

Friends

std::pair< typename type::adjacency_iterator, typename type::adjacency_iteratoradjacent_vertices (typename type::vertex_descriptor vertex, const type &graph)
 
std::pair< typename type::edge_descriptor, bool > edge (typename type::vertex_descriptor source_vertex, typename type::vertex_descriptor destination_vertex, const type &graph)
 
type::edge_descriptor edge_at (typename type::edges_size_type edge_index, const type &graph)
 
std::pair< typename type::edge_iterator, typename type::edge_iteratoredges (const type &graph)
 
lazy_fill_graph_index_map< type, typename type::edge_descriptor, typename type::edges_size_typeget (edge_index_t, const type &graph)
 
type::edges_size_type get (edge_index_t, const type &graph, typename type::edge_descriptor edge)
 
lazy_fill_graph_reverse_edge_map< typename type::edge_descriptorget (edge_reverse_t, const type &graph)
 
lazy_fill_graph_index_map< type, typename type::vertex_descriptor, typename type::vertices_size_typeget (vertex_index_t, const type &graph)
 
type::vertices_size_type get (vertex_index_t, const type &graph, typename type::vertex_descriptor vertex)
 
template<typename Graph , typename Descriptor , typename Index >
struct lazy_fill_graph_index_map
 
template<typename Descriptor >
struct lazy_fill_graph_reverse_edge_map
 
type::edges_size_type num_edges (const type &graph)
 
type::vertices_size_type num_vertices (const type &graph)
 
QDebug operator<< (QDebug dbg, const KisLazyFillGraph::edge_descriptor &e)
 
QDebug operator<< (QDebug dbg, const KisLazyFillGraph::vertex_descriptor &v)
 
type::degree_size_type out_degree (typename type::vertex_descriptor vertex, const type &graph)
 
type::edge_descriptor out_edge_at (typename type::vertex_descriptor vertex, typename type::degree_size_type out_edge_index, const type &graph)
 
std::pair< typename type::out_edge_iterator, typename type::out_edge_iteratorout_edges (typename type::vertex_descriptor vertex, const type &graph)
 
type::vertex_descriptor vertex (typename type::vertices_size_type vertex_index, const type &graph)
 
std::pair< typename type::vertex_iterator, typename type::vertex_iteratorvertices (const type &graph)
 

Detailed Description

Definition at line 234 of file kis_lazy_fill_graph.h.

Member Typedef Documentation

◆ adjacency_iterator

◆ adjacent_vertex_function

◆ degree_iterator

Definition at line 293 of file kis_lazy_fill_graph.h.

◆ degree_size_type

◆ directed_category

Definition at line 302 of file kis_lazy_fill_graph.h.

◆ edge_descriptor

◆ edge_function

◆ edge_index_iterator

Definition at line 288 of file kis_lazy_fill_graph.h.

◆ edge_iterator

Definition at line 290 of file kis_lazy_fill_graph.h.

◆ edge_parallel_category

typedef disallow_parallel_edge_tag KisLazyFillGraph::edge_parallel_category

Definition at line 303 of file kis_lazy_fill_graph.h.

◆ EdgeIndex

Definition at line 241 of file kis_lazy_fill_graph.h.

◆ edges_size_type

◆ out_edge_function

◆ out_edge_iterator

Definition at line 295 of file kis_lazy_fill_graph.h.

◆ type

◆ vertex_descriptor

◆ vertex_function

◆ vertex_index_iterator

Definition at line 283 of file kis_lazy_fill_graph.h.

◆ vertex_iterator

Definition at line 285 of file kis_lazy_fill_graph.h.

◆ VertexIndex

Definition at line 240 of file kis_lazy_fill_graph.h.

◆ vertices_size_type

Member Enumeration Documentation

◆ EdgeIndexBinId

Enumerator
HORIZONTAL 
HORIZONTAL_REVERSED 
VERTICAL 
VERTICAL_REVERSED 
LABEL_A 
LABEL_A_REVERSED 
LABEL_B 
LABEL_B_REVERSED 

Definition at line 399 of file kis_lazy_fill_graph.h.

Constructor & Destructor Documentation

◆ KisLazyFillGraph() [1/2]

KisLazyFillGraph::KisLazyFillGraph ( )
inline

Definition at line 320 of file kis_lazy_fill_graph.h.

320{}

◆ KisLazyFillGraph() [2/2]

KisLazyFillGraph::KisLazyFillGraph ( const QRect & mainRect,
const KisRegion & aLabelRegion,
const KisRegion & bLabelRegion )
inline

Definition at line 322 of file kis_lazy_fill_graph.h.

325 : m_x(mainRect.x()),
326 m_y(mainRect.y()),
327 m_width(mainRect.width()),
328 m_height(mainRect.height())
329 {
330 m_mainArea = mainRect;
331 m_aLabelArea = aLabelRegion.boundingRect();
332 m_bLabelArea = bLabelRegion.boundingRect();
333
334 m_aLabelRects = aLabelRegion.rects();
335 m_bLabelRects = bLabelRegion.rects();
336
339
341
342 m_edgeBins << EdgeIndexBin(0, m_mainArea.adjusted(0, 0, -1, 0), HORIZONTAL);
343 m_edgeBins << EdgeIndexBin(m_edgeBins.last(), m_mainArea.adjusted(0, 0, -1, 0), HORIZONTAL_REVERSED);
344
345 m_edgeBins << EdgeIndexBin(m_edgeBins.last(), m_mainArea.adjusted(0, 0, 0, -1), VERTICAL);
346 m_edgeBins << EdgeIndexBin(m_edgeBins.last(), m_mainArea.adjusted(0, 0, 0, -1), VERTICAL_REVERSED);
347
348 Q_FOREACH (const QRect &rc, m_aLabelRects) {
349 m_edgeBins << EdgeIndexBin(m_edgeBins.last(), rc, LABEL_A);
350 }
351
352 // out_edge_at relies on the sequential layout of reversed edges of one type
353 m_aReversedEdgesStart = m_edgeBins.last().last() + 1;
354
355 Q_FOREACH (const QRect &rc, m_aLabelRects) {
356 m_edgeBins << EdgeIndexBin(m_edgeBins.last(), rc, LABEL_A_REVERSED);
357 }
358
359 m_numAEdges = m_edgeBins.last().last() + 1 - m_aReversedEdgesStart;
360
361 Q_FOREACH (const QRect &rc, m_bLabelRects) {
362 m_edgeBins << EdgeIndexBin(m_edgeBins.last(), rc, LABEL_B);
363 }
364
365 // out_edge_at relies on the sequential layout of reversed edges of one type
366 m_bReversedEdgesStart = m_edgeBins.last().last() + 1;
367
368 Q_FOREACH (const QRect &rc, m_bLabelRects) {
369 m_edgeBins << EdgeIndexBin(m_edgeBins.last(), rc, LABEL_B_REVERSED);
370 }
371
372 m_numBEdges = m_edgeBins.last().last() + 1 - m_bReversedEdgesStart;
373
374 m_numEdges = m_edgeBins.last().last() + 1;
375 }
vertices_size_type m_aReversedEdgesStart
QVector< QRect > m_aLabelRects
QVector< EdgeIndexBin > m_edgeBins
vertices_size_type m_width
vertices_size_type m_numEdges
vertices_size_type m_numBEdges
vertices_size_type m_numVertices
vertices_size_type m_x
vertices_size_type m_numAEdges
vertices_size_type m_height
vertices_size_type m_bReversedEdgesStart
QVector< QRect > m_bLabelRects
vertices_size_type m_y
QRect boundingRect() const
QVector< QRect > rects() const
#define KIS_ASSERT(cond)
Definition kis_assert.h:33

References KisRegion::boundingRect(), HORIZONTAL, HORIZONTAL_REVERSED, KIS_ASSERT, LABEL_A, LABEL_A_REVERSED, LABEL_B, LABEL_B_REVERSED, m_aLabelArea, m_aLabelRects, m_aReversedEdgesStart, m_bLabelArea, m_bLabelRects, m_bReversedEdgesStart, m_edgeBins, m_height, m_mainArea, m_numAEdges, m_numBEdges, m_numEdges, m_numVertices, m_width, KisRegion::rects(), VERTICAL, and VERTICAL_REVERSED.

◆ ~KisLazyFillGraph()

KisLazyFillGraph::~KisLazyFillGraph ( )
inline

Definition at line 377 of file kis_lazy_fill_graph.h.

377 {
378
379 }

Member Function Documentation

◆ edge_at()

edge_descriptor KisLazyFillGraph::edge_at ( edges_size_type edge_index) const
inline

Definition at line 636 of file kis_lazy_fill_graph.h.

636 {
637
638 int binIndex = 0;
639
640 while (binIndex < m_edgeBins.size() &&
641 !m_edgeBins[binIndex].contains(edge_index)) {
642
643 binIndex++;
644 }
645
646 if (binIndex >= m_edgeBins.size()) {
647 return edge_descriptor();
648 }
649
650 return m_edgeBins[binIndex].edgeAt(edge_index);
651 }
std::pair< vertex_descriptor, vertex_descriptor > edge_descriptor

References m_edgeBins.

◆ findInRects()

static bool KisLazyFillGraph::findInRects ( const QVector< QRect > & rects,
const QPoint & pt )
inlinestaticprivate

Definition at line 690 of file kis_lazy_fill_graph.h.

690 {
691 bool result = false;
692
693 auto it = rects.constBegin();
694 for (; it != rects.constEnd(); ++it) {
695
696 if (it->contains(pt)) {
697 result = true;
698 break;
699 }
700 }
701 return result;
702 }

◆ index_of() [1/2]

edges_size_type KisLazyFillGraph::index_of ( edge_descriptor edge) const
inline

Definition at line 654 of file kis_lazy_fill_graph.h.

654 {
655 edges_size_type index = -1;
656
657 auto it = m_edgeBins.constBegin();
658 for (; it != m_edgeBins.constEnd(); ++it) {
659
660 index = it->indexOf(edge);
661 if (index >= 0) break;
662 }
663
664 return index;
665 }
friend std::pair< typename type::edge_descriptor, bool > edge(typename type::vertex_descriptor source_vertex, typename type::vertex_descriptor destination_vertex, const type &graph)

References edge, and m_edgeBins.

◆ index_of() [2/2]

vertices_size_type KisLazyFillGraph::index_of ( vertex_descriptor vertex) const
inline

Definition at line 597 of file kis_lazy_fill_graph.h.

597 {
598 vertices_size_type vertex_index = -1;
599
600 switch (vertex.type) {
602 vertex_index = vertex.x - m_x + (vertex.y - m_y) * m_width;
603 break;
605 vertex_index = m_numVertices - 2;
606 break;
608 vertex_index = m_numVertices - 1;
609 break;
610 }
611
612 return vertex_index;
613 }
friend type::vertex_descriptor vertex(typename type::vertices_size_type vertex_index, const type &graph)
VertexIndex vertices_size_type

References KisLazyFillGraph::VertexDescriptor::LABEL_A, KisLazyFillGraph::VertexDescriptor::LABEL_B, m_numVertices, m_width, m_x, m_y, KisLazyFillGraph::VertexDescriptor::NORMAL, KisLazyFillGraph::VertexDescriptor::type, vertex, KisLazyFillGraph::VertexDescriptor::x, and KisLazyFillGraph::VertexDescriptor::y.

◆ null_vertex()

static vertex_descriptor KisLazyFillGraph::null_vertex ( )
inlinestatic

Definition at line 310 of file kis_lazy_fill_graph.h.

311 {
312 vertex_descriptor maxed_out_vertex(
313 std::numeric_limits<vertices_size_type>::max(),
314 std::numeric_limits<vertices_size_type>::max(),
316
317 return (maxed_out_vertex);
318 }
VertexDescriptor vertex_descriptor

References KisLazyFillGraph::VertexDescriptor::NORMAL.

◆ num_edges()

edges_size_type KisLazyFillGraph::num_edges ( ) const
inline

Definition at line 592 of file kis_lazy_fill_graph.h.

592 {
593 return (m_numEdges);
594 }

References m_numEdges.

◆ num_vertices()

vertices_size_type KisLazyFillGraph::num_vertices ( ) const
inline

Definition at line 587 of file kis_lazy_fill_graph.h.

587 {
588 return (m_numVertices);
589 }

References m_numVertices.

◆ numVacantEdges()

static vertices_size_type KisLazyFillGraph::numVacantEdges ( const vertex_descriptor & vertex,
const QRect & rc )
inlinestaticprivate

Definition at line 668 of file kis_lazy_fill_graph.h.

668 {
669 vertices_size_type vacantEdges = 4;
670
671 if (vertex.x == rc.x()) {
672 vacantEdges--;
673 }
674
675 if (vertex.y == rc.y()) {
676 vacantEdges--;
677 }
678
679 if (vertex.x == rc.right()) {
680 vacantEdges--;
681 }
682
683 if (vertex.y == rc.bottom()) {
684 vacantEdges--;
685 }
686
687 return vacantEdges;
688 }

References vertex, KisLazyFillGraph::VertexDescriptor::x, and KisLazyFillGraph::VertexDescriptor::y.

◆ out_degree()

degree_size_type KisLazyFillGraph::out_degree ( vertex_descriptor vertex) const
inline

Definition at line 705 of file kis_lazy_fill_graph.h.

705 {
706 degree_size_type out_edge_count = 0;
707 if (index_of(vertex) < 0) return out_edge_count;
708
709 switch (vertex.type) {
711 out_edge_count = numVacantEdges(vertex, m_mainArea);
712
713 const QPoint pt = QPoint(vertex.x, vertex.y);
714
715 if (m_aLabelArea.contains(pt) && findInRects(m_aLabelRects, pt)) {
716 out_edge_count++;
717 }
718
719 if (m_bLabelArea.contains(pt) && findInRects(m_bLabelRects, pt)) {
720 out_edge_count++;
721 }
722
723 break;
724 }
726 out_edge_count = m_numAEdges;
727 break;
729 out_edge_count = m_numBEdges;
730 break;
731 }
732
733 return (out_edge_count);
734 }
static bool findInRects(const QVector< QRect > &rects, const QPoint &pt)
static vertices_size_type numVacantEdges(const vertex_descriptor &vertex, const QRect &rc)
vertices_size_type index_of(vertex_descriptor vertex) const

References findInRects(), index_of(), KisLazyFillGraph::VertexDescriptor::LABEL_A, KisLazyFillGraph::VertexDescriptor::LABEL_B, m_aLabelArea, m_aLabelRects, m_bLabelArea, m_bLabelRects, m_mainArea, m_numAEdges, m_numBEdges, KisLazyFillGraph::VertexDescriptor::NORMAL, numVacantEdges(), KisLazyFillGraph::VertexDescriptor::type, vertex, KisLazyFillGraph::VertexDescriptor::x, and KisLazyFillGraph::VertexDescriptor::y.

◆ out_edge_at()

edge_descriptor KisLazyFillGraph::out_edge_at ( vertex_descriptor vertex,
degree_size_type out_edge_index ) const
inline

Definition at line 738 of file kis_lazy_fill_graph.h.

739 {
740
741 const QPoint pt = QPoint(vertex.x, vertex.y);
742 vertex_descriptor dst_vertex = vertex;
743
744 switch (vertex.type) {
746 if (vertex.x > m_mainArea.x() && !out_edge_index--) {
747 dst_vertex.x--;
748 } else if (vertex.y > m_mainArea.y() && !out_edge_index--) {
749 dst_vertex.y--;
750 } else if (vertex.x < m_mainArea.right() && !out_edge_index--) {
751 dst_vertex.x++;
752 } else if (vertex.y < m_mainArea.bottom() && !out_edge_index--) {
753 dst_vertex.y++;
754 } else if (m_aLabelArea.contains(pt) && findInRects(m_aLabelRects, pt) && !out_edge_index--) {
756 } else if (m_bLabelArea.contains(pt) && findInRects(m_bLabelRects, pt) && !out_edge_index--) {
758 } else {
759 dbgImage << ppVar(vertex) << ppVar(out_edge_index) << ppVar(out_degree(vertex));
760 qFatal("Wrong edge sub-index");
761 }
762 break;
765 dst_vertex = edge.second;
766 break;
767 }
770 dst_vertex = edge.second;
771 break;
772 }
773 }
774
775 return std::make_pair(vertex, dst_vertex);
776 }
friend type::degree_size_type out_degree(typename type::vertex_descriptor vertex, const type &graph)
friend type::edge_descriptor edge_at(typename type::edges_size_type edge_index, const type &graph)
#define ppVar(var)
Definition kis_debug.h:155
#define dbgImage
Definition kis_debug.h:46

References dbgImage, edge, edge_at, findInRects(), KisLazyFillGraph::VertexDescriptor::LABEL_A, KisLazyFillGraph::VertexDescriptor::LABEL_B, m_aLabelArea, m_aLabelRects, m_aReversedEdgesStart, m_bLabelArea, m_bLabelRects, m_bReversedEdgesStart, m_mainArea, KisLazyFillGraph::VertexDescriptor::NORMAL, out_degree, ppVar, KisLazyFillGraph::VertexDescriptor::type, vertex, KisLazyFillGraph::VertexDescriptor::x, and KisLazyFillGraph::VertexDescriptor::y.

◆ rect()

QRect KisLazyFillGraph::rect ( ) const
inline

Definition at line 382 of file kis_lazy_fill_graph.h.

382{ return QRect(m_x, m_y, m_width, m_height); }

References m_height, m_width, m_x, and m_y.

◆ size()

QSize KisLazyFillGraph::size ( ) const
inline

Definition at line 381 of file kis_lazy_fill_graph.h.

381{ return QSize(m_width, m_height); }

References m_height, and m_width.

◆ vertex_at()

vertex_descriptor KisLazyFillGraph::vertex_at ( vertices_size_type vertex_index) const
inline

Friends And Related Symbol Documentation

◆ adjacent_vertices

std::pair< typename type::adjacency_iterator, typename type::adjacency_iterator > adjacent_vertices ( typename type::vertex_descriptor vertex,
const type & graph )
friend

Definition at line 849 of file kis_lazy_fill_graph.h.

850 {
851 typedef typename type::degree_iterator degree_iterator;
854
855 return (std::make_pair
858 adjacency_iterator(degree_iterator(graph.out_degree(vertex)),
860 }
transform_iterator< adjacent_vertex_function, degree_iterator > adjacency_iterator
counting_iterator< degree_size_type > degree_iterator
kis_detail::lazy_fill_graph_adjacent_vertex_at< type > adjacent_vertex_function

◆ edge

std::pair< typename type::edge_descriptor, bool > edge ( typename type::vertex_descriptor source_vertex,
typename type::vertex_descriptor destination_vertex,
const type & graph )
friend

Definition at line 867 of file kis_lazy_fill_graph.h.

869 {
870
871 std::pair<typename type::edge_descriptor, bool> edge_exists =
872 std::make_pair(std::make_pair(source_vertex, destination_vertex), false);
873
874 const edges_size_type index = graph.index_of(edge_exists.first);
875
876 edge_exists.second = index >= 0;
877
878 return edge_exists;
879 }

◆ edge_at

type::edge_descriptor edge_at ( typename type::edges_size_type edge_index,
const type & graph )
friend

Definition at line 891 of file kis_lazy_fill_graph.h.

892 {
893 return (graph.edge_at(edge_index));
894 }

◆ edges

std::pair< typename type::edge_iterator, typename type::edge_iterator > edges ( const type & graph)
friend

Definition at line 898 of file kis_lazy_fill_graph.h.

898 {
900 typedef typename type::edge_function edge_function;
901 typedef typename type::edge_iterator edge_iterator;
902
903 return (std::make_pair
905 edge_function(&graph)),
906 edge_iterator(edge_index_iterator(graph.num_edges()),
907 edge_function(&graph))));
908 }
kis_detail::lazy_fill_graph_edge_at< type > edge_function
transform_iterator< edge_function, edge_index_iterator > edge_iterator
counting_iterator< edges_size_type > edge_index_iterator

◆ get [1/5]

lazy_fill_graph_index_map< type, typename type::edge_descriptor, typename type::edges_size_type > get ( edge_index_t ,
const type & graph )
friend

Definition at line 949 of file kis_lazy_fill_graph.h.

949 {
951 type,
952 typename type::edge_descriptor,
953 typename type::edges_size_type>(graph));
954 }
KisLazyFillGraph type

◆ get [2/5]

type::edges_size_type get ( edge_index_t ,
const type & graph,
typename type::edge_descriptor edge )
friend

Definition at line 925 of file kis_lazy_fill_graph.h.

927 {
928
929 type::edges_size_type index = graph.index_of(edge);
930 LF_SANITY_ASSERT(index >= 0);
931 return index;
932 }
#define LF_SANITY_ASSERT(x)

◆ get [3/5]

lazy_fill_graph_reverse_edge_map< typename type::edge_descriptor > get ( edge_reverse_t ,
const type & graph )
friend

Definition at line 958 of file kis_lazy_fill_graph.h.

958 {
959 Q_UNUSED(graph);
961 typename type::edge_descriptor>());
962 }

◆ get [4/5]

lazy_fill_graph_index_map< type, typename type::vertex_descriptor, typename type::vertices_size_type > get ( vertex_index_t ,
const type & graph )
friend

Definition at line 938 of file kis_lazy_fill_graph.h.

938 {
940 type,
942 typename type::vertices_size_type>(graph));
943 }

◆ get [5/5]

type::vertices_size_type get ( vertex_index_t ,
const type & graph,
typename type::vertex_descriptor vertex )
friend

Definition at line 915 of file kis_lazy_fill_graph.h.

917 {
918
919 type::vertices_size_type index = graph.index_of(vertex);
920 LF_SANITY_ASSERT(index >= 0);
921 return index;
922 }

◆ lazy_fill_graph_index_map

template<typename Graph , typename Descriptor , typename Index >
friend struct lazy_fill_graph_index_map
friend

Definition at line 967 of file kis_lazy_fill_graph.h.

◆ lazy_fill_graph_reverse_edge_map

template<typename Descriptor >
friend struct lazy_fill_graph_reverse_edge_map
friend

Definition at line 970 of file kis_lazy_fill_graph.h.

◆ num_edges

type::edges_size_type num_edges ( const type & graph)
friend

Definition at line 886 of file kis_lazy_fill_graph.h.

886 {
887 return (graph.num_edges());
888 }

◆ num_vertices

type::vertices_size_type num_vertices ( const type & graph)
friend

Definition at line 799 of file kis_lazy_fill_graph.h.

799 {
800 return (graph.num_vertices());
801 }

◆ operator<< [1/2]

QDebug operator<< ( QDebug dbg,
const KisLazyFillGraph::edge_descriptor & e )
friend

Definition at line 1009 of file kis_lazy_fill_graph.h.

1009 {
1012
1013 dbg.nospace() << "(" << src << " -> " << dst << ")";
1014 return dbg.space();
1015}

◆ operator<< [2/2]

QDebug operator<< ( QDebug dbg,
const KisLazyFillGraph::vertex_descriptor & v )
friend

Definition at line 999 of file kis_lazy_fill_graph.h.

999 {
1000 const QString type =
1003 v.type == KisLazyFillGraph::vertex_descriptor::LABEL_B ? "label_B" : "<unknown>";
1004
1005 dbg.nospace() << "(" << v.x << ", " << v.y << ", " << type << ")";
1006 return dbg.space();
1007}
qreal v

◆ out_degree

type::degree_size_type out_degree ( typename type::vertex_descriptor vertex,
const type & graph )
friend

Definition at line 830 of file kis_lazy_fill_graph.h.

832 {
833 return (graph.out_degree(vertex));
834 }

◆ out_edge_at

type::edge_descriptor out_edge_at ( typename type::vertex_descriptor vertex,
typename type::degree_size_type out_edge_index,
const type & graph )
friend

Definition at line 837 of file kis_lazy_fill_graph.h.

839 {
840 return (graph.out_edge_at(vertex, out_edge_index));
841 }

◆ out_edges

std::pair< typename type::out_edge_iterator, typename type::out_edge_iterator > out_edges ( typename type::vertex_descriptor vertex,
const type & graph )
friend

Definition at line 816 of file kis_lazy_fill_graph.h.

817 {
818 typedef typename type::degree_iterator degree_iterator;
821
822 return (std::make_pair
824 out_edge_function(vertex, &graph)),
825 out_edge_iterator(degree_iterator(graph.out_degree(vertex)),
826 out_edge_function(vertex, &graph))));
827 }
transform_iterator< out_edge_function, degree_iterator > out_edge_iterator
kis_detail::lazy_fill_graph_out_edge_at< type > out_edge_function

◆ vertex

type::vertex_descriptor vertex ( typename type::vertices_size_type vertex_index,
const type & graph )
friend

Definition at line 804 of file kis_lazy_fill_graph.h.

805 {
806
807 return (graph.vertex_at(vertex_index));
808 }

◆ vertices

std::pair< typename type::vertex_iterator, typename type::vertex_iterator > vertices ( const type & graph)
friend

Definition at line 786 of file kis_lazy_fill_graph.h.

786 {
787 typedef typename type::vertex_iterator vertex_iterator;
788 typedef typename type::vertex_function vertex_function;
790
791 return (std::make_pair
793 vertex_function(&graph)),
794 vertex_iterator(vertex_index_iterator(graph.num_vertices()),
795 vertex_function(&graph))));
796 }
counting_iterator< vertices_size_type > vertex_index_iterator
transform_iterator< vertex_function, vertex_index_iterator > vertex_iterator
kis_detail::lazy_fill_graph_vertex_at< KisLazyFillGraph > vertex_function

Member Data Documentation

◆ m_aLabelArea

QRect KisLazyFillGraph::m_aLabelArea

Definition at line 577 of file kis_lazy_fill_graph.h.

◆ m_aLabelRects

QVector<QRect> KisLazyFillGraph::m_aLabelRects

Definition at line 581 of file kis_lazy_fill_graph.h.

◆ m_aReversedEdgesStart

vertices_size_type KisLazyFillGraph::m_aReversedEdgesStart

Definition at line 394 of file kis_lazy_fill_graph.h.

◆ m_bLabelArea

QRect KisLazyFillGraph::m_bLabelArea

Definition at line 578 of file kis_lazy_fill_graph.h.

◆ m_bLabelRects

QVector<QRect> KisLazyFillGraph::m_bLabelRects

Definition at line 582 of file kis_lazy_fill_graph.h.

◆ m_bReversedEdgesStart

vertices_size_type KisLazyFillGraph::m_bReversedEdgesStart

Definition at line 395 of file kis_lazy_fill_graph.h.

◆ m_edgeBins

QVector<EdgeIndexBin> KisLazyFillGraph::m_edgeBins

Definition at line 575 of file kis_lazy_fill_graph.h.

◆ m_height

vertices_size_type KisLazyFillGraph::m_height

Definition at line 389 of file kis_lazy_fill_graph.h.

◆ m_mainArea

QRect KisLazyFillGraph::m_mainArea

Definition at line 579 of file kis_lazy_fill_graph.h.

◆ m_numAEdges

vertices_size_type KisLazyFillGraph::m_numAEdges

Definition at line 396 of file kis_lazy_fill_graph.h.

◆ m_numBEdges

vertices_size_type KisLazyFillGraph::m_numBEdges

Definition at line 397 of file kis_lazy_fill_graph.h.

◆ m_numEdges

vertices_size_type KisLazyFillGraph::m_numEdges

Definition at line 392 of file kis_lazy_fill_graph.h.

◆ m_numVertices

vertices_size_type KisLazyFillGraph::m_numVertices

Definition at line 391 of file kis_lazy_fill_graph.h.

◆ m_width

vertices_size_type KisLazyFillGraph::m_width

Definition at line 388 of file kis_lazy_fill_graph.h.

◆ m_x

vertices_size_type KisLazyFillGraph::m_x

Definition at line 385 of file kis_lazy_fill_graph.h.

◆ m_y

vertices_size_type KisLazyFillGraph::m_y

Definition at line 386 of file kis_lazy_fill_graph.h.


The documentation for this class was generated from the following file: