Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GenUGraph.TCC

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------+
00002  | Library QgarLib, graphics analysis and recognition                  |
00003  | Copyright (C) 2002  Qgar Project, LORIA                             |
00004  |                                                                     |
00005  | This library is free software; you can redistribute it and/or       |
00006  | modify it under the terms of the GNU Lesser General Public          |
00007  | License version 2.1, as published by the Free Software Foundation.  |
00008  |                                                                     |
00009  | This library is distributed in the hope that it will be useful,     |
00010  | but WITHOUT ANY WARRANTY; without even the implied warranty of      |
00011  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                |
00012  | See the GNU Lesser General Public License for more details.         |
00013  |                                                                     |
00014  | The GNU Lesser General Public License is included in the file       |
00015  | LICENSE.LGPL, in the root directory of the Qgar packaging. See      |
00016  | http://www.gnu.org/licenses/lgpl.html for the terms of the licence. |
00017  | To receive a paper copy, write to the Free Software Foundation,     |
00018  | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.       |
00019  |                                                                     |
00020  | Contact Project Qgar for any information:                           |
00021  |   LORIA - équipe Qgar                                               |
00022  |   B.P. 239, 54506 Vandoeuvre-lès-Nancy Cedex, France                |
00023  |   email: qgar-contact@loria.fr                                      |
00024  |   http://www.qgar.org/                                              |
00025  *---------------------------------------------------------------------*/
00026 
00027 
00028 /**
00029  * @file   GenUGraph.TCC
00030  * @brief  Implementation of function members of class qgar::GenUGraph.
00031  *
00032  * @author <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Gérald Masini">Gérald Masini</a>
00033  * @date   January 27, 2005  22:32
00034  * @since  Qgar 2.2
00035  */
00036 
00037 
00038 
00039 // STD
00040 #include <algorithm>
00041 #include <list>
00042 // QGAR
00043 #include <qgarlib/GenEdge.H>
00044 #include <qgarlib/GenNode.H>
00045 
00046 
00047 
00048 namespace qgar
00049 {
00050 
00051 
00052 // -------------------------------------------------------------------
00053 // C O N S T R U C T O R S
00054 // -------------------------------------------------------------------
00055 
00056 
00057 // DEFAULT CONSTRUCTOR
00058 
00059 template <class TNODE, class TEDGE>
00060 GenUGraph<TNODE,TEDGE>::GenUGraph()
00061 {
00062   // VOID
00063 }
00064 
00065 
00066 // INITIALIZE FROM (A POINTER TO) A NODE
00067 
00068 template <class TNODE, class TEDGE>
00069 GenUGraph<TNODE,TEDGE>::GenUGraph(GenNode<TNODE,TEDGE>* const aPNode)
00070 {
00071   _nodes.push_back(aPNode);
00072 }
00073 
00074 
00075 // INITIALIZE FROM (A POINTER TO) AN EDGE
00076 
00077 template <class TNODE, class TEDGE>
00078 GenUGraph<TNODE,TEDGE>::GenUGraph(GenEdge<TNODE,TEDGE>* const aPEdge)
00079 {
00080   _edges.push_back(aPEdge);
00081 }
00082 
00083 
00084 // -------------------------------------------------------------------
00085 // D E S T R U C T O R 
00086 // -------------------------------------------------------------------
00087 
00088 
00089 template <class TNODE, class TEDGE>
00090 GenUGraph<TNODE,TEDGE>::~GenUGraph()
00091 {
00092   // Delete nodes
00093   for (typename std::list< GenNode<TNODE,TEDGE>* >::iterator itN = _nodes.begin();
00094        itN != _nodes.end();
00095        ++itN)
00096     {
00097       delete *itN;
00098     }
00099 
00100   // Delete edges
00101   for (typename std::list< GenEdge<TNODE,TEDGE>* >::iterator itE = _edges.begin();
00102        itE != _edges.end();
00103        ++itE)
00104     {
00105       delete *itE;
00106     }
00107 }
00108 
00109 
00110 // -------------------------------------------------------------------
00111 // G R A P H   C H A R A C T E R I S T I C S
00112 // -------------------------------------------------------------------
00113 
00114 
00115 // IS THE GRAPH EMPTY?
00116 
00117 template <class TNODE, class TEDGE>
00118 bool
00119 GenUGraph<TNODE,TEDGE>::empty() const
00120 {
00121   return _nodes.empty() && _edges.empty();
00122 }
00123 
00124 
00125 // RETURN THE NUMBER OF NODES
00126 
00127 template <class TNODE, class TEDGE>
00128 int
00129 GenUGraph<TNODE,TEDGE>::sizeNodes() const
00130 {
00131   return (int) _nodes.size();
00132 }
00133 
00134 
00135 // RETURN THE NUMBER OF EDGES
00136 
00137 template <class TNODE, class TEDGE>
00138 int
00139 GenUGraph<TNODE,TEDGE>::sizeEdges() const
00140 {
00141   return (int) _edges.size();
00142 }
00143 
00144 
00145 // -------------------------------------------------------------------
00146 // N O D E   A C C E S S
00147 // -------------------------------------------------------------------
00148 
00149 
00150 // GET A POINTER TO THE ENTRY NODE
00151 // OR 0 IF THE NODES LIST IS EMPTY
00152 
00153 template <class TNODE, class TEDGE>
00154 inline GenNode<TNODE,TEDGE>*
00155 GenUGraph<TNODE,TEDGE>::pEntryNode() const
00156 {
00157   if (_nodes.empty())
00158     {
00159       return 0;
00160     }
00161   else
00162     {
00163       return _nodes.front();
00164     }
00165 }
00166 
00167 
00168 // GET THE NODES LIST
00169 
00170 template <class TNODE, class TEDGE>
00171 inline std::list< GenNode<TNODE,TEDGE>* >&
00172 GenUGraph<TNODE,TEDGE>::getNodes()
00173 {
00174   return _nodes;
00175 }
00176 
00177 
00178 // GET (A CONSTANT REFERENCE TO) THE NODES LIST
00179 
00180 template <class TNODE, class TEDGE>
00181 inline const std::list< GenNode<TNODE,TEDGE>* >&
00182 GenUGraph<TNODE,TEDGE>::accessNodes() const
00183 {
00184   return _nodes;
00185 }
00186 
00187 
00188 // GET A COPY OF THE NODES LIST
00189 template <class TNODE, class TEDGE>
00190 inline std::list< GenNode<TNODE,TEDGE>* >
00191 GenUGraph<TNODE,TEDGE>::nodes() const
00192 {
00193   return _nodes;
00194 }
00195 
00196 
00197 // -------------------------------------------------------------------
00198 // E D G E   A C C E S S
00199 // -------------------------------------------------------------------
00200 
00201 
00202 // GET A POINTER TO THE ENTRY EDGE
00203 // OR 0 IF THE EDGES LIST IS EMPTY
00204 
00205 template <class TNODE, class TEDGE>
00206 inline GenEdge<TNODE,TEDGE>*
00207 GenUGraph<TNODE,TEDGE>::pEntryEdge() const
00208 {
00209   if (_edges.empty())
00210     {
00211       return 0;
00212     }
00213   else
00214     {
00215       return _edges.front();
00216     }
00217 }
00218 
00219 
00220 // GET THE EDGES LIST
00221 
00222 template <class TNODE, class TEDGE>
00223 inline std::list< GenEdge<TNODE,TEDGE>* >&
00224 GenUGraph<TNODE,TEDGE>::getEdges()
00225 {
00226   return _edges;
00227 }
00228 
00229 
00230 // GET (A CONSTANT REFERENCE TO) THE EDGES LIST
00231 
00232 template <class TNODE, class TEDGE>
00233 inline const std::list< GenEdge<TNODE,TEDGE>* >&
00234 GenUGraph<TNODE,TEDGE>::accessEdges() const
00235 {
00236   return _edges;
00237 }
00238 
00239 
00240 // GET A COPY OF THE EDGES LIST
00241 template <class TNODE, class TEDGE>
00242 inline std::list< GenEdge<TNODE,TEDGE>* >
00243 GenUGraph<TNODE,TEDGE>::edges() const
00244 {
00245   return _edges;
00246 }
00247 
00248 
00249 // -------------------------------------------------------------------
00250 // I N S E R T I O N   O F   C R E A T E D   N O D E S
00251 // -------------------------------------------------------------------
00252 
00253 
00254 // JUST INSERT A NEW NODE CREATED FROM GIVEN DATA AND FLAG
00255 
00256 template <class TNODE, class TEDGE>
00257 inline GenNode<TNODE,TEDGE>*
00258 GenUGraph<TNODE,TEDGE>::addNode(const TNODE& aData, short int aFlag)
00259 {
00260   return addNode(new GenNode<TNODE,TEDGE>(aData, aFlag));
00261 }
00262 
00263 
00264 // INSERT A NEW NODE AND LINK IT TO GIVEN EDGE OF THE GRAPH
00265 
00266 template <class TNODE, class TEDGE>
00267 inline GenNode<TNODE,TEDGE>*
00268 GenUGraph<TNODE,TEDGE>::addNode(GenEdge<TNODE,TEDGE>* const aPEdge,
00269                                 const TNODE& aData,
00270                                 short int aFlag)
00271 {
00272   return addNode(new GenNode<TNODE,TEDGE>(aData, aFlag), aPEdge);
00273 }
00274 
00275 
00276 // INSERT A NEW NODE BETWEEN GIVEN EDGES OF THE GRAPH
00277 
00278 template <class TNODE, class TEDGE>
00279 inline GenNode<TNODE,TEDGE>*
00280 GenUGraph<TNODE,TEDGE>::addNode(GenEdge<TNODE,TEDGE>* const aPEdge1,
00281                                 GenEdge<TNODE,TEDGE>* const aPEdge2,
00282                                 const TNODE& aData,
00283                                 short int aFlag)
00284 {
00285   return addNode(new GenNode<TNODE,TEDGE>(aData, aFlag), aPEdge1, aPEdge2);
00286 }
00287 
00288 
00289 // INSERT A NEW NODE AS SOURCE OF THE GIVEN EDGE
00290 
00291 template <class TNODE, class TEDGE>
00292 inline GenNode<TNODE,TEDGE>*
00293 GenUGraph<TNODE,TEDGE>::addNodeAtSource(GenEdge<TNODE,TEDGE>* const aPEdge,
00294                                         const TNODE& aData,
00295                                         short int aFlag)
00296 {
00297   return addNodeAtSource(new GenNode<TNODE,TEDGE>(aData, aFlag), aPEdge);
00298 }
00299 
00300 
00301 // INSERT A NEW NODE AS TARGET OF THE GIVEN EDGE
00302 
00303 template <class TNODE, class TEDGE>
00304 inline GenNode<TNODE,TEDGE>*
00305 GenUGraph<TNODE,TEDGE>::addNodeAtTarget(GenEdge<TNODE,TEDGE>* const aPEdge,
00306                                         const TNODE& aData,
00307                                         short int aFlag)
00308 {
00309   return addNodeAtTarget(new GenNode<TNODE,TEDGE>(aData, aFlag), aPEdge);
00310 }
00311 
00312 
00313 // -------------------------------------------------------------------
00314 // I N S E R T I O N   O F   E X I S T I N G   N O D E S
00315 // -------------------------------------------------------------------
00316 
00317 
00318 // JUST INSERT A NODE IN THE NODES LIST OF THE GRAPH
00319 
00320 template <class TNODE, class TEDGE>
00321 inline GenNode<TNODE,TEDGE>*
00322 GenUGraph<TNODE,TEDGE>::addNode(GenNode<TNODE,TEDGE>* const aPNode)
00323 {
00324   // The node is inserted at the end of the nodes list of the graph
00325   _nodes.push_back(aPNode);
00326 
00327   return aPNode;
00328 }
00329 
00330 // INSERT A NODE AS SOURCE OR TARGET OF A GIVEN EDGE
00331 
00332 template <class TNODE, class TEDGE>
00333 GenNode<TNODE,TEDGE>*
00334 GenUGraph<TNODE,TEDGE>::addNode(GenNode<TNODE,TEDGE>* const aPNode,
00335                                 GenEdge<TNODE,TEDGE>* const aPEdge)
00336 {
00337   // The edge is inserted in the edges list of the node
00338   aPNode->addEdge(aPEdge);
00339 
00340   // The node becomes the source or target of the edge,
00341   // depending on which one is free
00342   aPEdge->setPNode(aPNode);
00343 
00344   // The node is inserted in the nodes list of the graph
00345   return addNode(aPNode);
00346 }
00347 
00348 
00349 // INSERT A NODE BETWEEN TWO GIVEN EDGES OF THE GRAPH
00350 
00351 template <class TNODE, class TEDGE>
00352 GenNode<TNODE,TEDGE>*
00353 GenUGraph<TNODE,TEDGE>::addNode(GenNode<TNODE,TEDGE>* const aPNode,
00354                                 GenEdge<TNODE,TEDGE>* const aPEdge1,
00355                                 GenEdge<TNODE,TEDGE>* const aPEdge2)
00356 {
00357   // The given edges are included in the edges list of the given node
00358   aPNode->addEdge(aPEdge1);
00359   aPNode->addEdge(aPEdge2);
00360 
00361   // The node becomes the source of a given edge if the source is free
00362   // Otherwise, the node becomes the target
00363   aPEdge1->setPNode(aPNode);
00364   aPEdge2->setPNode(aPNode);
00365 
00366   // The node is inserted in the nodes list of the graph
00367   return addNode(aPNode);
00368 }
00369 
00370 
00371 // INSERT GIVEN NODE AS SOURCE OF GIVEN EDGE OF THE GRAPH
00372  
00373 template <class TNODE, class TEDGE>
00374 GenNode<TNODE,TEDGE>*
00375 GenUGraph<TNODE,TEDGE>::addNodeAtSource(GenNode<TNODE,TEDGE>* const aPNode,
00376                                         GenEdge<TNODE,TEDGE>* const aPEdge)
00377 {
00378   // The given edge is supposed to belong to the current graph.
00379   // It is included in the edges list of the given node.
00380   aPNode->addEdge(aPEdge);
00381 
00382   // The node becomes the source of the given edge
00383   aPEdge->setPSource(aPNode);
00384 
00385   // The node is inserted in the nodes list of the graph
00386   return addNode(aPNode);
00387 }
00388 
00389 
00390 // INSERT GIVEN NODE AS TARGET OF GIVEN EDGE OF THE GRAPH
00391  
00392 template <class TNODE, class TEDGE>
00393 GenNode<TNODE,TEDGE>*
00394 GenUGraph<TNODE,TEDGE>::addNodeAtTarget(GenNode<TNODE,TEDGE>* const aPNode,
00395                                         GenEdge<TNODE,TEDGE>* const aPEdge)
00396 {
00397   // The given edge is supposed to belong to the current graph.
00398   // It is included in the edges list of the given node.
00399   aPNode->addEdge(aPEdge);
00400 
00401   // The node becomes the target of the given edge
00402   aPEdge->setPTarget(aPNode);
00403 
00404   // The node is inserted in the nodes list of the graph
00405   return addNode(aPNode);
00406 }
00407 
00408 
00409 // -------------------------------------------------------------------
00410 // I N S E R T I O N   O F   C R E A T E D   E D G E S
00411 // -------------------------------------------------------------------
00412 
00413 
00414 // INSERT A NEW EDGE CREATED FROM GIVEN DATA AND FLAG
00415 
00416 template <class TNODE, class TEDGE>
00417 inline GenEdge<TNODE,TEDGE>*
00418 GenUGraph<TNODE,TEDGE>::addEdge(const TEDGE& aData,
00419                                 short int aFlag)
00420 {
00421   return addEdge(new GenEdge<TNODE,TEDGE>(aData, aFlag));
00422 }
00423 
00424 
00425 // LINK THE SOURCE OF A NEW EDGE TO A GIVEN NODE OF THE GRAPH
00426 
00427 template <class TNODE, class TEDGE>
00428 inline GenEdge<TNODE,TEDGE>*
00429 GenUGraph<TNODE,TEDGE>::addEdge(GenNode<TNODE,TEDGE>* const aPNode,
00430                                 const TEDGE& aData,       
00431                                 short int aFlag)
00432 {
00433   return addEdge(new GenEdge<TNODE,TEDGE>(aData, aFlag), aPNode);
00434 }
00435 
00436 
00437 // INSERT AN NEW EDGE BETWEEN TWO GIVEN NODES OF THE GRAPH
00438 
00439 template <class TNODE, class TEDGE>
00440 inline GenEdge<TNODE,TEDGE>*
00441 GenUGraph<TNODE,TEDGE>::addEdge(GenNode<TNODE,TEDGE>* const aPSource,
00442                                 GenNode<TNODE,TEDGE>* const aPTarget,
00443                                 const TEDGE& aData,
00444                                 short int aFlag)
00445 {
00446   return addEdge(new GenEdge<TNODE,TEDGE>(aData, aFlag), aPSource, aPTarget);
00447 }
00448 
00449 
00450 // -------------------------------------------------------------------
00451 // I N S E R T I O N   O F   E X I S T I N G   E D G E S
00452 // -------------------------------------------------------------------
00453 
00454 
00455 // JUST INSERT (A POINTER TO) AN EDGE IN THE GRAPH
00456 
00457 template <class TNODE, class TEDGE>
00458 inline GenEdge<TNODE,TEDGE>*
00459 GenUGraph<TNODE,TEDGE>::addEdge(GenEdge<TNODE,TEDGE>* const aPEdge)
00460 {
00461   // The edge is inserted at the end of the edges list of the graph
00462   _edges.push_back(aPEdge);
00463 
00464   return aPEdge;
00465 }
00466 
00467 
00468 // INSERT GIVEN (POINTER TO) EDGE IN THE GRAPH,
00469 // SO AS GIVEN (POINTED) NODE BECOMES ITS SOURCE OR ITS TARGET
00470 
00471 template <class TNODE, class TEDGE>
00472 GenEdge<TNODE,TEDGE>*
00473 GenUGraph<TNODE,TEDGE>::addEdge(GenEdge<TNODE,TEDGE>* const aPEdge,
00474                                 GenNode<TNODE,TEDGE>* const aPNode)
00475 {
00476   // Insert given edge in the edges list of the given node
00477   aPNode->addEdge(aPEdge);
00478 
00479   // The node becomes the source of the given edge if the source is free
00480   // Otherwise, the node becomes the target
00481   aPEdge->setPNode(aPNode);
00482 
00483   // Insert edge in the edges list of the graph
00484   return addEdge(aPEdge);
00485 }
00486 
00487 
00488 // INSERT GIVEN (POINTER TO) EDGE IN THE GRAPH,
00489 // SO AS GIVEN (POINTED) NODEs BECOMES ITS SOURCE AND ITS TARGET
00490 
00491 template <class TNODE, class TEDGE>
00492 GenEdge<TNODE,TEDGE>*
00493 GenUGraph<TNODE,TEDGE>::addEdge(GenEdge<TNODE,TEDGE>* const aPEdge,
00494                                 GenNode<TNODE,TEDGE>* const aPNode1,
00495                                 GenNode<TNODE,TEDGE>* const aPNode2)
00496 {
00497   // Insert given edge in the edges list of the given nodes
00498   aPNode1->addEdge(aPEdge);
00499   aPNode2->addEdge(aPEdge);
00500 
00501   // The first node becomes the source of the given edge
00502   // The second node becomes the target of the given edge
00503   aPEdge->setPSource(aPNode1);
00504   aPEdge->setPTarget(aPNode2);
00505 
00506   // Insert edge in the edges list of the graph
00507   return addEdge(aPEdge);
00508 }
00509 
00510 
00511 // INSERT GIVEN (POINTER TO) EDGE IN THE GRAPH,
00512 // SO AS GIVEN (POINTED) NODE BECOMES ITS SOURCE
00513 
00514 template <class TNODE, class TEDGE>
00515 GenEdge<TNODE,TEDGE>*
00516 GenUGraph<TNODE,TEDGE>::addEdgeBySource(GenEdge<TNODE,TEDGE>* const aPEdge,
00517                                         GenNode<TNODE,TEDGE>* const aPNode)
00518 {
00519   // Insert edge in the edges list of the given node
00520   aPNode->addEdge(aPEdge);
00521 
00522   // Insert node as source of the given edge
00523   aPEdge->setPSource(aPNode);
00524 
00525   // Insert edge in the edges list of the graph
00526   return addEdge(aPEdge);
00527 }
00528 
00529 
00530 // INSERT GIVEN (POINTER TO) EDGE IN THE GRAPH,
00531 // SO AS GIVEN (POINTED)  NODE BECOMES ITS TARGET
00532 
00533 template <class TNODE, class TEDGE>
00534 GenEdge<TNODE,TEDGE>*
00535 GenUGraph<TNODE,TEDGE>::addEdgeByTarget(GenEdge<TNODE,TEDGE>* const aPEdge,
00536                                         GenNode<TNODE,TEDGE>* const aPNode)
00537 {
00538   // Insert edge in the edges list of the given node
00539   aPNode->addEdge(aPEdge);
00540 
00541   // Insert node as target of the given edge
00542   aPEdge->setPTarget(aPNode);
00543 
00544   // Insert edge in the edges list of the graph
00545   return addEdge(aPEdge);
00546 }
00547 
00548 
00549 // -------------------------------------------------------------------
00550 // N O D E   R E M O V A L
00551 // -------------------------------------------------------------------
00552 
00553 
00554 // REMOVE GIVEN (POINTER TO) NODE FROM THE GRAPH,
00555 // AND RETURN IT
00556 
00557 template <class TNODE, class TEDGE>
00558 inline GenNode<TNODE,TEDGE>*
00559 GenUGraph<TNODE,TEDGE>::remove(GenNode<TNODE,TEDGE>* const aPNode)
00560 {
00561   return remove(std::find(_nodes.begin(), _nodes.end(), aPNode));
00562 }
00563 
00564 
00565 // REMOVE (POINTER TO) NODE AT GIVEN POSITION IN THE NODES LIST,
00566 // AND RETURN IT.
00567 
00568 template <class TNODE, class TEDGE>
00569 GenNode<TNODE,TEDGE>*
00570 GenUGraph<TNODE,TEDGE>::remove(typename std::list< GenNode<TNODE,TEDGE>* >::iterator aPos)
00571 {
00572   if (aPos == _nodes.end())
00573     {
00574       return 0;
00575     }
00576   else
00577     {
00578       // Save pointer to the node
00579       GenNode<TNODE,TEDGE>* pn = *aPos;
00580 
00581       // WARNING: Get a copy of the list of adjacent edges
00582       //          as edge removals alter this list
00583       std::list< GenEdge<TNODE,TEDGE>* >  el = (*pn).edges();
00584 
00585       // For each edge adjacent to the node
00586 
00587       for (typename std::list<GenEdge<TNODE,TEDGE>*>::const_iterator itE = el.begin();
00588            itE != el.end();
00589            ++itE)
00590         {
00591           // Remove current edge from the graph,
00592           // and delete it
00593           delete(remove(*itE));
00594         }
00595 
00596       // Remove pointer to node from the nodes list of the graph
00597       _nodes.erase(aPos);
00598       
00599       return pn;
00600     }
00601 }
00602 
00603 
00604 // -------------------------------------------------------------------
00605 // E D G E   R E M O V A L
00606 // -------------------------------------------------------------------
00607 
00608 
00609 // REMOVE GIVEN (POINTER TO) EDGE FROM THE GRAPH,
00610 // AND RETURN IT
00611 
00612 template <class TNODE, class TEDGE>
00613 inline GenEdge<TNODE,TEDGE>*
00614 GenUGraph<TNODE,TEDGE>::remove(GenEdge<TNODE,TEDGE>* const aPEdge)
00615 {
00616   return remove(std::find(_edges.begin(), _edges.end(), aPEdge));
00617 }
00618 
00619 
00620 // REMOVE (POINTER TO) EDGE AT GIVEN POSITION IN THE EDGES LIST,
00621 // AND RETURN IT
00622 
00623 template <class TNODE, class TEDGE>
00624 GenEdge<TNODE,TEDGE>*
00625 GenUGraph<TNODE,TEDGE>::remove(typename std::list<GenEdge<TNODE,TEDGE>*>::iterator aPos)
00626 {
00627   if (aPos == _edges.end())
00628     {
00629       return 0;
00630     }
00631   else
00632     {
00633       // Save pointer to the edge
00634       GenEdge<TNODE,TEDGE>* pe = *aPos;
00635       
00636       // Remove pointer from the edges list of the graph
00637       _edges.erase(aPos);
00638       
00639       // Remove pointer from edges lists of source and target nodes
00640       (pe->pSource())->removeEdge(pe);
00641       return (pe->pTarget())->removeEdge(pe);
00642     }
00643 }
00644 
00645 
00646 // -------------------------------------------------------------------
00647 
00648 
00649 } // namespace qgar