![]() |
MAGiC
V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
|
#include <hypergraphlib_graph.h>
Types publics | |
typedef std::map< int, Arc * > | MapArcsById |
typedef std::map< int, Node * > | MapNodesById |
Fonctions membres publiques | |
~Graph () | |
Graph (int __id=0) | |
Graph (const Graph &__G, int __clone=1, int __reverse=0) | |
Graph (const Graph &__G, const std::set< Node * > &) | |
Graph (const Graph &__G, const std::vector< Node * > &__nodes) | |
Node * | GetNode (int) const |
Node * | MergeNodes (Node *__A, Node *__B, int __id, bool __keepNodes=false) |
Node * | MergeNodes (int __A, int __B, int __id, bool __keepNodes=false) |
Arc * | GetArc (int) const |
int | RemoveNode (int __id) |
int | RemoveNode (Node *) |
int | RemoveArc (int __id) |
int | RemoveArc (Arc *) |
Node * | AddNode (int __id=0) |
Arc * | AddArc (const std::vector< int > &, int __id) |
Arc * | AddArc (const int __id, int __rank,...) |
Arc * | AddArc (const int __id, const std::multimap< int, Node * > &__nodes) |
int | CheckFreeNodeId (int __id) const |
int | CheckFreeArcId (int __id) const |
int | GetMaxArcId () |
int | GetMaxNodeId () |
const MapArcsById & | GetArcs () const |
const MapNodesById & | GetNodes () const |
void | CheckIntegrity () const |
void | Filaments (std::vector< std::vector< int > > &__filaments) |
bool | IsCycle () const |
bool | IsCycle (const std::vector< Node * > &__nodes) const |
Arc * | DuplicateArc (int __id, int __dupId) |
Arc * | DuplicateArc (Arc *__arc, int __dupId) |
![]() | |
GraphObject (const Graph *__owner, const int __id) | |
GraphObject (const GraphObject &, const Graph *__owner) | |
int | Id () const |
const Graph * | Owner () const |
void * | GetUserData () const |
void | SetUserData (void *) |
void * | GetUserData (unsigned i) const |
void | SetUserData (unsigned i, void *) |
Attributs protégés | |
MapArcsById | _arcs |
MapNodesById | _nodes |
![]() | |
const Graph * | _owner |
const int | _id |
std::map< int, void * > | _userData |
Définition à la ligne 58 du fichier hypergraphlib_graph.h.
typedef std::map< int, Arc * > HypergraphLib::Graph::MapArcsById |
Définition à la ligne 60 du fichier hypergraphlib_graph.h.
typedef std::map< int, Node * > HypergraphLib::Graph::MapNodesById |
Définition à la ligne 61 du fichier hypergraphlib_graph.h.
HypergraphLib::Graph::~Graph | ( | ) |
Définition à la ligne 44 du fichier hypergraphlib_graph.cpp.
HypergraphLib::Graph::Graph | ( | int | __id = 0 | ) |
Constructor
Définition à la ligne 38 du fichier hypergraphlib_graph.cpp.
HypergraphLib::Graph::Graph | ( | const Graph & | __G, |
int | __clone = 1 , |
||
int | __reverse = 0 |
||
) |
copy constructor
Définition à la ligne 65 du fichier hypergraphlib_graph.cpp.
Références _arcs, _nodes, HypergraphLib::Arc::Add(), et HypergraphLib::Arc::Nodes().
subgraph constructor
Définition à la ligne 90 du fichier hypergraphlib_graph.cpp.
Références _arcs, _nodes, a, AddArc(), AddNode(), HypergraphLib::GraphObject::GetUserData(), HypergraphLib::GraphObject::Id(), HypergraphLib::Arc::Nodes(), et HypergraphLib::GraphObject::SetUserData().
Définition à la ligne 127 du fichier hypergraphlib_graph.cpp.
Références _arcs, _nodes, a, AddArc(), AddNode(), HypergraphLib::GraphObject::GetUserData(), HypergraphLib::GraphObject::Id(), HypergraphLib::Arc::Nodes(), et HypergraphLib::GraphObject::SetUserData().
Arc * HypergraphLib::Graph::AddArc | ( | const int | __id, |
int | __rank, | ||
... | |||
) |
Add an arc that links __rank Nodes Together, and affects the ID __id to the new arc Example : AddArc(123, 3, 4, 54, 5); creates arc ID=123, Rank=3, Nodes=4;54;5
Définition à la ligne 335 du fichier hypergraphlib_graph.cpp.
Références _arcs, a, HypergraphLib::Node::Add(), et GetNode().
Arc * HypergraphLib::Graph::AddArc | ( | const std::vector< int > & | __nodeIds, |
int | __id | ||
) |
Add an arc returns 0 if successful
Définition à la ligne 378 du fichier hypergraphlib_graph.cpp.
Références _arcs, a, HypergraphLib::Node::Add(), et GetNode().
Référencé par CAD4FE::MCBody::ContractEdgeToVertex(), CAD4FE::MCBody::CreateMCVertex(), DuplicateArc(), CAD4FE::MCAA::FaceBoundaryMesh(), Graph(), CAD4FE::MCBody::InitHyperGraphs(), CAD4FE::ShortestPath::InitializeAdjacencyGraph(), et CAD4FE::MCBody::SuppressMCVertex().
Node * HypergraphLib::Graph::AddNode | ( | int | __id = 0 | ) |
Add one node
Définition à la ligne 278 du fichier hypergraphlib_graph.cpp.
Références _nodes.
Référencé par CAD4FE::MCAA::FaceBoundaryMesh(), Graph(), CAD4FE::MCBody::InitHyperGraphs(), CAD4FE::ShortestPath::InitializeAdjacencyGraph(), MergeNodes(), et CAD4FE::MCBody::SplitEdge().
int HypergraphLib::Graph::CheckFreeArcId | ( | int | __id | ) | const |
Checks if the ID already exists in the Arcs of the graph, if it already exists, it get the first free one starting from the lowest ID of the arcs.
return : the ID
int HypergraphLib::Graph::CheckFreeNodeId | ( | int | __id | ) | const |
Checks if the ID already exists in the Nodes of the graph, if it already exists, it get the first free one starting from the lowest ID of the nodes.
return : the ID
void HypergraphLib::Graph::CheckIntegrity | ( | ) | const |
DEBUGGING PURPOSES Verifies the integrity of the Graph :
Définition à la ligne 458 du fichier hypergraphlib_graph.cpp.
Références GetArc(), GetArcs(), GetNode(), et GetNodes().
Référencé par RemoveNode().
Définition à la ligne 170 du fichier hypergraphlib_graph.cpp.
Références AddArc(), et HypergraphLib::Arc::Nodes().
Arc * HypergraphLib::Graph::DuplicateArc | ( | int | __id, |
int | __dupId | ||
) |
duplicate an arc, use the second argument to set the id of the new arc
Définition à la ligne 164 du fichier hypergraphlib_graph.cpp.
Références GetArc().
Référencé par CAD4FE::MCBody::SplitEdge().
void HypergraphLib::Graph::Filaments | ( | std::vector< std::vector< int > > & | __filaments | ) |
Extract filaments of the graph
Arc * HypergraphLib::Graph::GetArc | ( | int | __id | ) | const |
Get one arc by ID
Définition à la ligne 188 du fichier hypergraphlib_graph.cpp.
Références _arcs.
Référencé par CheckIntegrity(), CAD4FE::MCBody::Contains(), CAD4FE::MCBody::ContractEdgeToVertex(), CAD4FE::LocalEdgeCriteria::DeletionScore(), DuplicateArc(), CAD4FE::MCBody::Edge_GetAdjacentFaces(), CAD4FE::MCBody::ExportBRep(), CAD4FE::MCBody::GetMCVertex(), CAD4FE::EdgeCollapseCriteria::GetScore(), CAD4FE::VertexCriteria::GetScore(), CAD4FE::MCBody::Graph_SetUserData(), CAD4FE::ShortestPath::InitializeAdjacencyGraph(), CAD4FE::MCBody::MergeVertices(), CAD4FE::MCAA::Node_Segment_Same_Face(), CAD4FE::MCAA::SplitEdge(), CAD4FE::MCBody::SplitEdge(), CAD4FE::MCBody::SuppressMCEdge(), CAD4FE::MCBody::SuppressMCVertex(), CAD4FE::VertexCriteria::Update(), CAD4FE::MCBody::Vertex_GetAdjacentEdges(), et CAD4FE::MCBody::Vertex_GetAdjacentFaces().
|
inline |
Get the array of arcs by ID
Définition à la ligne 171 du fichier hypergraphlib_graph.h.
Référencé par CheckIntegrity(), CAD4FE::MCAA::CollapseMCEdgeToMCVertex(), CAD4FE::MCBody::GetFEVCount(), IsCycle(), CAD4FE::MCAA::Simplify2(), CAD4FE::MCAA::SimplifyEdgeCollapse(), et V().
int HypergraphLib::Graph::GetMaxArcId | ( | ) |
Returns the maximum value of the arcs' IDs of this graph
Définition à la ligne 324 du fichier hypergraphlib_graph.cpp.
Références _arcs.
int HypergraphLib::Graph::GetMaxNodeId | ( | ) |
Returns the maximum value of the nodes' IDs of this graph
Définition à la ligne 329 du fichier hypergraphlib_graph.cpp.
Références _nodes.
Node * HypergraphLib::Graph::GetNode | ( | int | __id | ) | const |
Get one node by ID
Définition à la ligne 175 du fichier hypergraphlib_graph.cpp.
Références _nodes.
Référencé par AddArc(), HypergraphLib::Arc::Arc(), CheckIntegrity(), CAD4FE::MCBody::Contains(), CAD4FE::MCBody::ContractEdgeToVertex(), HypergraphLib::Dijkstra(), CAD4FE::MCBody::Edge_GetVertices(), CAD4FE::MCBody::Face_G10SubGraph(), CAD4FE::MCBody::Face_GetAdjacentEdges(), CAD4FE::MCBody::Face_GetMCVertices(), CAD4FE::MCAA::FaceBoundaryMesh(), HypergraphLib::Filaments(), CAD4FE::MCBody::GetMCEdge(), CAD4FE::MCBody::GetMCFace(), CAD4FE::MCBody::Graph_SetUserData(), CAD4FE::ShortestPath::InitializeAdjacencyGraph(), MergeNodes(), CAD4FE::MCAA::NodeConstrictedSection(), CAD4FE::MCBody::SplitEdge(), CAD4FE::MCAA::SuppressMCVertex(), et CAD4FE::MCBody::SuppressMCVertex().
|
inline |
Get the array of nodes by ID
Définition à la ligne 178 du fichier hypergraphlib_graph.h.
Référencé par CheckIntegrity(), HypergraphLib::Dijkstra(), CAD4FE::MCBody::Face_GetCycles(), HypergraphLib::Filaments(), CAD4FE::ShortestPath::Find(), HypergraphLib::FindSCC(), CAD4FE::MCBody::GetFEVCount(), NeatoGraph(), CAD4FE::MCAA::NodeConstrictedSection(), et CAD4FE::MCAA::Simplify2().
bool HypergraphLib::Graph::IsCycle | ( | ) | const |
Tests wether the graph is a cycle or not
Définition à la ligne 524 du fichier hypergraphlib_graph.cpp.
Références _arcs, _nodes, et GetArcs().
Référencé par HypergraphLib::dfsCycle().
bool HypergraphLib::Graph::IsCycle | ( | const std::vector< Node * > & | __nodes | ) | const |
Définition à la ligne 536 du fichier hypergraphlib_graph.cpp.
Références HypergraphLib::Node::GetNbArcsToNode(), et HypergraphLib::Node::IsAdjacentToNode().
Node * HypergraphLib::Graph::MergeNodes | ( | int | __A, |
int | __B, | ||
int | __id, | ||
bool | __keepNodes = false |
||
) |
Définition à la ligne 399 du fichier hypergraphlib_graph.cpp.
Références GetNode(), et MergeNodes().
Node * HypergraphLib::Graph::MergeNodes | ( | Node * | __A, |
Node * | __B, | ||
int | __id, | ||
bool | __keepNodes = false |
||
) |
Merge two nodes if __keepNodes = true, then the 2 initial nodes are kept
Merge two nodes.
This merge is implemented by creating a new node C, and replacing node A by node C in all arcs incident to A, and node B by node C in all arcs incident to B.
(If there exist two arcs X–A and X–B, it will result two parallel arcs X–C. Any arc A–B will result in a loop-arc C–C).
Then nodes A and B will be removed from the graph.
Définition à la ligne 421 du fichier hypergraphlib_graph.cpp.
Références HypergraphLib::Node::Add(), AddNode(), HypergraphLib::Node::IncidentArcs(), et RemoveNode().
Référencé par CAD4FE::MCBody::ContractEdgeToVertex(), MergeNodes(), CAD4FE::MCBody::SuppressMCEdge(), et CAD4FE::MCBody::SuppressMCVertex().
int HypergraphLib::Graph::RemoveArc | ( | Arc * | __arc | ) |
Remove one Arc, and all its references in its nodes
Définition à la ligne 245 du fichier hypergraphlib_graph.cpp.
Références HypergraphLib::GraphObject::Id(), et RemoveArc().
int HypergraphLib::Graph::RemoveArc | ( | int | __id | ) |
Remove one Arc, and all its references in its nodes
Définition à la ligne 250 du fichier hypergraphlib_graph.cpp.
Références _arcs, HypergraphLib::Arc::Nodes(), et HypergraphLib::Arc::Remove().
Référencé par CAD4FE::MCBody::ContractEdgeToVertex(), CAD4FE::MCBody::MergeVertices(), RemoveArc(), CAD4FE::MCBody::SplitEdge(), CAD4FE::MCBody::SuppressMCEdge(), et CAD4FE::MCBody::SuppressMCVertex().
int HypergraphLib::Graph::RemoveNode | ( | int | __id | ) |
Remove one node, and all its references in its incident arcs
Définition à la ligne 229 du fichier hypergraphlib_graph.cpp.
Références _nodes.
Référencé par CAD4FE::MCBody::ContractEdgeToVertex(), MergeNodes(), CAD4FE::MCBody::SplitEdge(), et CAD4FE::MCBody::SuppressMCEdge().
int HypergraphLib::Graph::RemoveNode | ( | Node * | __node | ) |
Remove one node, and all its references in its incident arcs
Définition à la ligne 201 du fichier hypergraphlib_graph.cpp.
Références _nodes, CheckIntegrity(), HypergraphLib::GraphObject::Id(), et HypergraphLib::Node::IncidentArcs().
|
protected |
Définition à la ligne 211 du fichier hypergraphlib_graph.h.
Référencé par AddArc(), GetArc(), GetMaxArcId(), Graph(), IsCycle(), RemoveArc(), et ~Graph().
|
protected |
Définition à la ligne 212 du fichier hypergraphlib_graph.h.
Référencé par AddNode(), GetMaxNodeId(), GetNode(), Graph(), IsCycle(), RemoveNode(), et ~Graph().