7 #include <boost/graph/adjacency_list.hpp> 8 #include <boost/graph/depth_first_search.hpp> 9 #include <boost/graph/dijkstra_shortest_paths.hpp> 10 #include <boost/graph/graph_utility.hpp> 11 #include <boost/graph/graphviz.hpp> 12 #include <boost/graph/labeled_graph.hpp> 13 #include <boost/graph/isomorphism.hpp> 14 #include <boost/graph/properties.hpp> 15 #include <boost/graph/topological_sort.hpp> 16 #include <boost/graph/visitors.hpp> 17 #include <boost/utility.hpp> 26 #include <tbb/mutex.h> 29 typedef boost::adjacency_list<boost::setS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_name_t, std::string> >
ObjectGraph_Type;
59 ObjectGraph(std::vector<Core::DocObject*> objs,
bool ignoreLinksToTemporaryObjects =
false);
70 bool recreate(std::vector<const Core::DocObject*> toDelete);
72 std::vector<Core::DocObject*> build_SubGraph(
const std::vector<Core::DocObject*>& featureSet);
78 std::vector<const Core::DocObject*> getTopologicalSorted();
88 std::vector< std::string > getErrors();
92 bool allLinksConnected();
96 ObjectGraph_Type build(
const std::vector<Core::DocObject*>& featureSet, std::map<Object_Vertex, Core::DocObject*>& myFeaturemap);
100 std::set<const Core::DocObject*>& beforeobjects,
103 std::vector<const Core::DocObject*>& beforeobjects,
105 std::unordered_map<Object_Vertex, const Core::DocObject*> _vertex_to_object;
106 std::unordered_map<const Core::DocObject*, Object_Vertex> _object_to_vertex;
108 std::unordered_map<Object_Vertex, const Core::DocObject*> _vertex_to_object_BackLink;
109 std::unordered_map<const Core::DocObject*, Object_Vertex> _object_to_vertex_BackLink;
113 bool _ignoreLinksToTemporaryObjects =
false;
115 std::vector< std::string > mErrors;
133 using RelGraph_Type = boost::adjacency_list<boost::listS, boost::setS, boost::bidirectionalS,NodeInfo,EdgeInfo >;
136 using RelGraph_Link = std::pair<Core::PropertyLinkBaseBase*,Core::DocObject*>;
160 std::vector<RelGraph_Link> RelGraph::getInEdges(
Core::DocObject* docObj);
169 std::unordered_map<size_t,RelGraph_Vertex> _object_to_vertex;
void breakLinks(Core::DocObject *from)
RelGraph * _relGraph
Definition: CoreDocument.h:841
std::pair< Core::PropertyLinkBaseBase *, Core::DocObject * > RelGraph_Link
Definition: GraphBuilder.h:136
void removeObject(Core::DocObject *e)
Removes an object from the document.
Definition: Property.h:268
boost::adjacency_list< boost::setS, boost::vecS, boost::bidirectionalS, boost::property< boost::vertex_name_t, std::string > > ObjectGraph_Type
Definition: GraphBuilder.h:29
RelGraph_Type::vertex_descriptor RelGraph_Vertex
Definition: GraphBuilder.h:134
ObjectGraph_Type::vertex_descriptor Object_Vertex
Definition: GraphBuilder.h:46
std::vector< const Core::DocObject * > getInner(const Core::DocObject *me, std::function< bool(const Core::DocObject *)> *allowToAddObject=0)
Get ALL Links to me, also indirect.
size_t id
Definition: GraphBuilder.h:120
Definition: CoreDocument.h:210
bool addObject(Core::DocObject *e)
Adds an existing object to the document.
boost::adjacency_list< boost::listS, boost::setS, boost::bidirectionalS, NodeInfo, EdgeInfo > RelGraph_Type
Definition: GraphBuilder.h:133
size_t pos
Definition: GraphBuilder.h:121
std::vector< const Core::DocObject * > getBackLinksFromMe(const Core::DocObject *o)
Returns all objects 'o' directly linked from 'o'.
RelGraph_Type::edge_descriptor RelGraph_Edge
Definition: GraphBuilder.h:135
std::vector< const Core::DocObject * > getBackLinksToMe(const Core::DocObject *o)
Returns all objects that directly linked to 'o'.
std::vector< const Core::DocObject * > getOuter(const Core::DocObject *me)
Get ALL Links from me, also indirect.
Definition: GraphBuilder.h:121
Definition: GraphBuilder.h:120
Definition: GraphBuilder.h:138
std::vector< const Core::DocObject * > getLinksFromMe(const Core::DocObject *o)
Returns all objects 'o' directly linked from 'o'.
std::vector< const Core::DocObject * > getLinksToMe(const Core::DocObject *o)
Returns all objects that directly linked to 'o'.
Definition: GraphBuilder.h:52
Definition: DocObject.h:51