digiKam
|
Public Types | |
typedef graph_traits::adjacency_iterator | adjacency_iter |
typedef std::pair< adjacency_iter, adjacency_iter > | adjacency_vertex_range_t |
enum | AdjacencyFlags { OutboundEdges = 1 << 0 , InboundEdges = 1 << 1 , EdgesToLeaf = 1 << 2 , EdgesToRoot = 1 << 3 , AllEdges = InboundEdges | OutboundEdges } |
typedef boost::property_map< GraphContainer, edge_properties_t >::const_type | const_edge_property_map_t |
typedef boost::property_map< GraphContainer, boost::vertex_index_t >::const_type | const_vertex_index_map_t |
typedef boost::property_map< GraphContainer, vertex_properties_t >::const_type | const_vertex_property_map_t |
typedef graph_traits::degree_size_type | degree_t |
typedef graph_traits::edge_iterator | edge_iter |
typedef boost::property_map< GraphContainer, edge_properties_t >::type | edge_property_map_t |
typedef std::pair< edge_iter, edge_iter > | edge_range_t |
typedef graph_traits::edge_descriptor | edge_t |
typedef QPair< Edge, Edge > | EdgePair |
typedef boost::graph_traits< GraphContainer > | graph_traits |
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, boost::property< boost::vertex_index_t, int, boost::property< vertex_properties_t, VertexProperties > >, boost::property< edge_properties_t, EdgeProperties > > | GraphContainer |
enum | GraphCopyFlags { CopyVertexProperties = 1 << 0 , CopyEdgeProperties = 1 << 1 , CopyAllProperties = CopyVertexProperties | CopyEdgeProperties } |
typedef graph_traits::in_edge_iterator | in_edge_iter |
typedef boost::inv_adjacency_iterator_generator< GraphContainer, vertex_t, in_edge_iter >::type | inv_adjacency_iter |
typedef std::pair< inv_adjacency_iter, inv_adjacency_iter > | inv_adjacency_vertex_range_t |
typedef graph_traits::out_edge_iterator | out_edge_iter |
typedef std::pair< out_edge_iter, out_edge_iter > | out_edge_range_t |
enum | ReturnOrder { BreadthFirstOrder , DepthFirstOrder } |
typedef boost::property_map< GraphContainer, boost::vertex_index_t >::type | vertex_index_map_t |
typedef graph_traits::vertex_iterator | vertex_iter |
typedef boost::property_map< GraphContainer, vertex_properties_t >::type | vertex_property_map_t |
typedef std::pair< vertex_iter, vertex_iter > | vertex_range_t |
typedef graph_traits::vertex_descriptor | vertex_t |
typedef QMapForAdaptors< Vertex, int > | VertexIntMap |
typedef boost::associative_property_map< VertexIntMap > | VertexIntMapAdaptor |
typedef QPair< Vertex, Vertex > | VertexPair |
typedef QMapForAdaptors< Vertex, Vertex > | VertexVertexMap |
typedef boost::associative_property_map< VertexVertexMap > | VertexVertexMapAdaptor |
Public Member Functions | |
Edge | addEdge (const Vertex &v1, const Vertex &v2) |
void | addHistory (const DImageHistory &givenHistory, qlonglong extraCurrent=0) |
Vertex | addVertex () |
Vertex | addVertex (const HistoryImageId &id) |
Vertex | addVertex (const ItemInfo &info) |
Vertex | addVertex (const QList< HistoryImageId > &imageIds) |
Vertex | addVertex (const VertexProperties &properties) |
Vertex | addVertex (qlonglong id) |
Vertex | addVertexScanned (qlonglong id) |
QList< Vertex > | adjacentVertices (const Vertex &v, AdjacencyFlags flags=AllEdges) const |
QHash< Vertex, HistoryImageId::Types > | categorize () const |
void | clear () |
Edge | edge (const Vertex &v1, const Vertex &v2) const |
int | edgeCount () const |
QList< VertexPair > | edgePairs () const |
QList< Edge > | edges () const |
QList< Edge > | edges (const Vertex &v, AdjacencyFlags flags=AllEdges) const |
template<class T > | |
Vertex | findVertexByProperties (const T &value) const |
const GraphContainer & | getGraph () const |
bool | hasEdge (const Vertex &v1, const Vertex &v2) const |
bool | hasEdges () const |
bool | hasEdges (const Vertex &v, AdjacencyFlags flags=AllEdges) const |
int | inDegree (const Vertex &v) const |
bool | isConnected (const Vertex &v1, const Vertex &v2) const |
Does not care for direction. More... | |
bool | isEmpty () const |
bool | isLeaf (const Vertex &v) const |
bool | isRoot (const Vertex &v) const |
ItemHistoryGraphData () | |
ItemHistoryGraphData (const HistoryGraph &g) | |
QList< Vertex > | leaves () const |
QList< Vertex > | leavesFrom (const Vertex &v) const |
QList< Vertex > | longestPathTouching (const Vertex &v) const |
template<typename LessThan > | |
QList< Vertex > | longestPathTouching (const Vertex &v, LessThan lessThan) const |
MeaningOfDirection | meaningOfDirection () const |
ItemHistoryGraphData & | operator= (const HistoryGraph &g) |
int | outDegree (const Vertex &v) const |
EdgeProperties & | properties (const Edge &e) |
const EdgeProperties & | properties (const Edge &e) const |
VertexProperties & | properties (const Vertex &v) |
const VertexProperties & | properties (const Vertex &v) const |
EdgeProperties | properties (const Vertex &v1, const Vertex &v2) const |
void | remove (const Vertex &v) |
int | removeNextUnresolvedVertex (int begin) |
QList< Vertex > | roots () const |
QList< Vertex > | rootsOf (const Vertex &v) const |
void | setProperties (const Edge &e, const EdgeProperties &props) |
void | setProperties (const Vertex &v, const VertexProperties &props) |
QMap< Vertex, int > | shortestDistancesFrom (const Vertex &v) const |
QList< Vertex > | shortestPath (const Vertex &v1, const Vertex &v2) const |
Vertex | source (const Edge &e) const |
Vertex | target (const Edge &e) const |
QList< ItemInfo > | toInfoList (const QList< Vertex > &vertices) const |
QList< Vertex > | topologicalSort () const |
Graph | transitiveClosure (GraphCopyFlags flags=CopyAllProperties) const |
Graph | transitiveReduction (QList< Edge > *removedEdges=0, GraphCopyFlags flags=CopyAllProperties) const |
int | vertexCount () const |
NOTE: for "hasAdjacentVertices", simply use hasEdges(v, flags) More... | |
QList< Vertex > | vertices () const |
QList< Vertex > | verticesBreadthFirst (const Vertex &givenRef=Vertex()) const |
template<typename LessThan > | |
QList< Vertex > | verticesDepthFirstSorted (const Vertex &givenRef, LessThan lessThan) const |
QList< Vertex > | verticesDominatedBy (const Vertex &v, const Vertex &root, const QList< Vertex > &presortedVertices) const |
QList< Vertex > | verticesDominatedBy (const Vertex &v, const Vertex &root, ReturnOrder order=BreadthFirstOrder) const |
template<typename LessThan > | |
QList< Vertex > | verticesDominatedByDepthFirstSorted (const Vertex &v, const Vertex &root, LessThan lessThan) const |
Static Public Member Functions | |
template<typename T > | |
static bool | alwaysFalse (const T &, const T &) |
Protected Member Functions | |
void | applyProperties (Vertex &v, const QList< ItemInfo > &infos, const QList< HistoryImageId > &ids) |
void | copyProperties (Graph &other, GraphCopyFlags flags, const std::vector< vertex_t > &copiedVertices) const |
QList< Edge > | edgeDifference (const Graph &other, const std::vector< vertex_t > &copiedVertices) const |
QList< Vertex > | findZeroDegree (bool inOrOut) const |
QList< Vertex > | findZeroDegreeFrom (const Vertex &v, bool inOrOut) const |
QList< Vertex > | listPath (const Vertex &root, const Vertex &target, const VertexVertexMap &predecessors, MeaningOfDirection dir=ParentToChild) const |
QList< Vertex > | mostRemoteNodes (const VertexIntMap &distances) const |
QList< Vertex > | treeFromPredecessors (const Vertex &v, const VertexVertexMap &predecessors) const |
void | treeFromPredecessorsRecursive (const Vertex &v, QList< Vertex > &vertices, const VertexVertexMap &predecessors) const |
Static Protected Member Functions | |
template<typename range_t > | |
static bool | isEmptyRange (const range_t &range) |
template<typename range_t > | |
static QList< Edge > | toEdgeList (const range_t &range) |
template<typename Value , typename range_t > | |
static QList< Value > | toList (const range_t &range) |
template<typename range_t > | |
static QList< Vertex > | toVertexList (const range_t &range) |
Protected Attributes | |
MeaningOfDirection | direction |
GraphContainer | graph |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
a bunch of graph-specific typedefs that make the long boost types manageable
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inline |
|
inlineexplicit |
|
inlineinherited |
References Digikam::Graph< VertexProperties, EdgeProperties >::Edge::isNull().
Referenced by addHistory(), and removeNextUnresolvedVertex().
void Digikam::ItemHistoryGraphData::addHistory | ( | const DImageHistory & | givenHistory, |
qlonglong | extraCurrent = 0 |
||
) |
References Digikam::DImageHistory::Entry::action, Digikam::Graph< VertexProperties, EdgeProperties >::addEdge(), Digikam::Graph< VertexProperties, EdgeProperties >::addVertex(), addVertexScanned(), Digikam::DImageHistory::entries(), Digikam::DImageHistory::isEmpty(), Digikam::Graph< VertexProperties, EdgeProperties >::Vertex::isNull(), Digikam::DImageHistory::Entry::referredImages, and Digikam::Graph< VertexProperties, EdgeProperties >::setProperties().
|
inlineinherited |
Referenced by addHistory(), addVertex(), and applyProperties().
HistoryGraph::Vertex Digikam::ItemHistoryGraphData::addVertex | ( | const HistoryImageId & | id | ) |
HistoryGraph::Vertex Digikam::ItemHistoryGraphData::addVertex | ( | const ItemInfo & | info | ) |
References Digikam::Graph< VertexProperties, EdgeProperties >::addVertex(), applyProperties(), Digikam::Graph< VertexProperties, EdgeProperties >::findVertexByProperties(), Digikam::ItemInfo::historyImageId(), Digikam::Graph< VertexProperties, EdgeProperties >::Vertex::isNull(), and Digikam::ItemInfo::uuid().
HistoryGraph::Vertex Digikam::ItemHistoryGraphData::addVertex | ( | const QList< HistoryImageId > & | imageIds | ) |
|
inlineinherited |
HistoryGraph::Vertex Digikam::ItemHistoryGraphData::addVertex | ( | qlonglong | id | ) |
HistoryGraph::Vertex Digikam::ItemHistoryGraphData::addVertexScanned | ( | qlonglong | id | ) |
References applyProperties(), and Digikam::Graph< VertexProperties, EdgeProperties >::findVertexByProperties().
Referenced by addHistory().
|
inlineinherited |
References Digikam::ParentToChild.
Referenced by Digikam::operator<<().
|
inlinestaticinherited |
|
protected |
QHash< HistoryGraph::Vertex, HistoryImageId::Types > Digikam::ItemHistoryGraphData::categorize | ( | ) | const |
References Digikam::HistoryEdgeProperties::actions, Digikam::HistoryVertexProperties::alwaysMarkedAs(), Digikam::HistoryImageId::Current, Digikam::Graph< VertexProperties, EdgeProperties >::edges(), Digikam::Graph< VertexProperties, EdgeProperties >::EdgesToLeaf, Digikam::FilterAction::ExplicitBranch, Digikam::Graph< VertexProperties, EdgeProperties >::hasEdges(), Digikam::HistoryImageId::Intermediate, Digikam::Graph< VertexProperties, EdgeProperties >::isLeaf(), Digikam::Graph< VertexProperties, EdgeProperties >::isRoot(), Digikam::HistoryVertexProperties::markedAs(), Digikam::HistoryImageId::Original, Digikam::Graph< VertexProperties, EdgeProperties >::properties(), Digikam::HistoryImageId::Source, and Digikam::Graph< VertexProperties, EdgeProperties >::vertices().
|
inlineinherited |
|
inlineprotectedinherited |
According to the given flags and based on the map, copies vertex and edge properties from this to the other graph
References Digikam::Graph< VertexProperties, EdgeProperties >::direction, Digikam::Graph< VertexProperties, EdgeProperties >::edge(), Digikam::Graph< VertexProperties, EdgeProperties >::Vertex::isNull(), Digikam::Graph< VertexProperties, EdgeProperties >::Edge::isNull(), and Digikam::Graph< VertexProperties, EdgeProperties >::setProperties().
|
inlineinherited |
|
inlineinherited |
|
inlineprotectedinherited |
Returns a list of edges of this graph that have been removed in other. copiedVertices maps the vertices of this graph to other.
References Digikam::Graph< VertexProperties, EdgeProperties >::edge(), Digikam::Graph< VertexProperties, EdgeProperties >::Vertex::isNull(), and Digikam::Graph< VertexProperties, EdgeProperties >::Edge::isNull().
|
inlineinherited |
|
inlineinherited |
Referenced by categorize(), and removeNextUnresolvedVertex().
|
inlineinherited |
References Digikam::ParentToChild.
|
inlineinherited |
References value.
Referenced by addVertex(), and addVertexScanned().
|
inlineprotectedinherited |
Finds vertex ids of all vertices with zero in- our out-degree.
|
inlineprotectedinherited |
|
inlineinherited |
Accessing vertices and edges
|
inlineinherited |
|
inlineinherited |
Referenced by categorize().
|
inlineinherited |
References Digikam::ParentToChild.
|
inlineinherited |
|
inlineinherited |
Does not care for direction.
|
inlineinherited |
Referenced by Digikam::operator<<(), and Digikam::ItemHistoryGraph::reduceEdges().
|
inlinestaticprotectedinherited |
|
inlineinherited |
Referenced by categorize().
|
inlineinherited |
Referenced by categorize().
|
inlineinherited |
Returns all leaves, i.e. vertices with no children Takes the graph direction into account.
References Digikam::ParentToChild.
|
inlineinherited |
References Digikam::ParentToChild.
|
inlineprotectedinherited |
Get a list of vertex ids for the path from root to target, using the given predecessors. Depending on MeaningOfDirection, the ids are listed inverted, from target to root.
References Digikam::ParentToChild.
|
inlineinherited |
|
inlineinherited |
References Digikam::ChildToParent, Digikam::Graph< VertexProperties, EdgeProperties >::Path::distances, Digikam::Graph< VertexProperties, EdgeProperties >::Vertex::isNull(), Digikam::Graph< VertexProperties, EdgeProperties >::Path::longestPath(), Digikam::ParentToChild, and Digikam::Graph< VertexProperties, EdgeProperties >::Path::predecessors.
|
inlineinherited |
|
inlineprotectedinherited |
Get the list of vertices with the largest value in the given distance map
|
inline |
|
inlineinherited |
Referenced by Digikam::operator<<().
|
inlineinherited |
References edge_properties.
|
inlineinherited |
References edge_properties.
|
inlineinherited |
References vertex_properties.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
References Digikam::Graph< VertexProperties, EdgeProperties >::Vertex::isNull().
Referenced by removeNextUnresolvedVertex().
int Digikam::ItemHistoryGraphData::removeNextUnresolvedVertex | ( | int | begin | ) |
References Digikam::HistoryEdgeProperties::actions, Digikam::Graph< VertexProperties, EdgeProperties >::addEdge(), Digikam::Graph< VertexProperties, EdgeProperties >::edges(), Digikam::Graph< VertexProperties, EdgeProperties >::EdgesToLeaf, Digikam::Graph< VertexProperties, EdgeProperties >::EdgesToRoot, Digikam::HistoryVertexProperties::infos, Digikam::Graph< VertexProperties, EdgeProperties >::properties(), Digikam::Graph< VertexProperties, EdgeProperties >::remove(), Digikam::Graph< VertexProperties, EdgeProperties >::setProperties(), Digikam::Graph< VertexProperties, EdgeProperties >::source(), Digikam::Graph< VertexProperties, EdgeProperties >::target(), and Digikam::Graph< VertexProperties, EdgeProperties >::vertices().
|
inlineinherited |
Returns all roots, i.e. vertices with no parents. Takes the graph direction into account.
References Digikam::ParentToChild.
|
inlineinherited |
Returns all roots of vertex v. Subset of roots(). I case any leaves have roots that are not roots of v, they will not be contained in this list.
References Digikam::ParentToChild.
|
inlineinherited |
References edge_properties.
|
inlineinherited |
References vertex_properties.
Referenced by addHistory(), Digikam::Graph< VertexProperties, EdgeProperties >::copyProperties(), and removeNextUnresolvedVertex().
|
inlineinherited |
Returns the shortest distances from Vertex to all vertices in the graph. If the value is -1, a vertex is not reachable from v.
References Digikam::Graph< VertexProperties, EdgeProperties >::Path::distances, Digikam::ParentToChild, and Digikam::Graph< VertexProperties, EdgeProperties >::Path::shortestPath().
|
inlineinherited |
Returns the shortestPath between id1 and id2. If s2 is not reachable from s1, the path is searched from s2 to s1. The returned list always starts with s1, contains the intermediate vertices, and ends with s2. If no path is available, an empty list is returned.
References Digikam::ChildToParent, Digikam::Graph< VertexProperties, EdgeProperties >::Vertex::isNull(), Digikam::Graph< VertexProperties, EdgeProperties >::Path::isReachable(), Digikam::Graph< VertexProperties, EdgeProperties >::Path::predecessors, and Digikam::Graph< VertexProperties, EdgeProperties >::Path::shortestPath().
|
inlineinherited |
References Digikam::Graph< VertexProperties, EdgeProperties >::Edge::toEdge().
Referenced by removeNextUnresolvedVertex().
|
inlineinherited |
References Digikam::Graph< VertexProperties, EdgeProperties >::Edge::toEdge().
Referenced by removeNextUnresolvedVertex().
|
inlinestaticprotectedinherited |
|
inline |
|
inlinestaticprotectedinherited |
Returns a list of vertex ids of vertices in the given range
|
inlineinherited |
Returns the vertex ids of this graph, in topological order.
Referenced by Digikam::operator<<().
|
inlinestaticprotectedinherited |
|
inlineinherited |
Returns a copy of this graph with all edges added to form the transitive closure
References Digikam::Graph< VertexProperties, EdgeProperties >::graph.
|
inlineinherited |
Returns a copy of this graph, with edges removed so that the transitive reduction is formed. Optionally, a list of edges of this graph that have been removed in the returned graph is given.
References Digikam::Graph< VertexProperties, EdgeProperties >::graph.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineinherited |
NOTE: for "hasAdjacentVertices", simply use hasEdges(v, flags)
|
inlineinherited |
Referenced by categorize(), Digikam::operator<<(), and removeNextUnresolvedVertex().
|
inlineinherited |
Orders all vertices of the graph in a breadth-first manner. A single vertex is taken as reference to distinguish main root and side paths. Otherwise the first root is taken as reference.
References Digikam::Graph< VertexProperties, EdgeProperties >::GraphSearch::breadthFirstSearch(), Digikam::ChildToParent, Digikam::Graph< VertexProperties, EdgeProperties >::Vertex::isNull(), and Digikam::Graph< VertexProperties, EdgeProperties >::GraphSearch::vertices.
|
inlineinherited |
Orders all vertices of the graph in a depth-first manner. When discovering a vertex, the adjacent vertices are sorted with the given lessThan. A single vertex is taken as starting point. If null, the first root is taken as reference.
References Digikam::ChildToParent, Digikam::Graph< VertexProperties, EdgeProperties >::GraphSearch::depthFirstSearchSorted(), Digikam::Graph< VertexProperties, EdgeProperties >::Vertex::isNull(), and Digikam::Graph< VertexProperties, EdgeProperties >::GraphSearch::vertices.
|
inlineinherited |
For a vertex v reachable from a vertex root returns all vertices dominated by v starting from root. The order is the same as in the given, sorted list of all vertices in this graph (or all vertices expected to be returned. The returned list is the intersection of the dominated vertices and presortedVertices, in order of presortedVertices)
remove all vertices from the DFS of v that are not in the dominated tree
References Digikam::Graph< VertexProperties, EdgeProperties >::DominatorTree::enter(), Digikam::Graph< VertexProperties, EdgeProperties >::Vertex::isNull(), and Digikam::Graph< VertexProperties, EdgeProperties >::DominatorTree::predecessors.
|
inlineinherited |
For a vertex v reachable from a vertex root, returns, in depth-first or breadth-first order, all vertices dominated by v starting from root.
References Digikam::Graph< VertexProperties, EdgeProperties >::GraphSearch::breadthFirstSearch(), Digikam::ChildToParent, Digikam::Graph< VertexProperties, EdgeProperties >::GraphSearch::depthFirstSearch(), Digikam::Graph< VertexProperties, EdgeProperties >::Vertex::isNull(), and Digikam::Graph< VertexProperties, EdgeProperties >::GraphSearch::vertices.
|
inlineinherited |
For a vertex v reachable from a vertex root all vertices dominated by v starting from root. The returned list is in depth-first order, using root as starting point, and when discovering a vertex, sorting the adjacent vertices with the given lessThan.
|
protectedinherited |
|
protectedinherited |