NIVissimNodeDef_Edges Class Reference

#include <NIVissimNodeDef_Edges.h>

Inheritance diagram for NIVissimNodeDef_Edges:

NIVissimNodeDef NIVissimNodeDef_Poly

Detailed Description

Definition at line 39 of file NIVissimNodeDef_Edges.h.


Public Member Functions

int buildNodeCluster ()
virtual SUMOReal getEdgePosition (int edgeid) const
 NIVissimNodeDef_Edges (int id, const std::string &name, const NIVissimNodeParticipatingEdgeVector &edges)
virtual void searchAndSetConnections ()
virtual ~NIVissimNodeDef_Edges ()

Static Public Member Functions

static void clearDict ()
static void dict_assignConnectionsToNodes ()
static NIVissimNodeDefdictionary (int id)
static bool dictionary (int id, NIVissimNodeDef *o)
static bool dictionary (int id, const std::string &name, const NIVissimNodeParticipatingEdgeVector &edges)
static size_t dictSize ()
static int getMaxID ()

Protected Attributes

NIVissimNodeParticipatingEdgeVector myEdges
int myID
std::string myName

Data Structures

class  id_matches
class  lying_within_match

Constructor & Destructor Documentation

NIVissimNodeDef_Edges::NIVissimNodeDef_Edges ( int  id,
const std::string &  name,
const NIVissimNodeParticipatingEdgeVector edges 
)

Definition at line 52 of file NIVissimNodeDef_Edges.cpp.

Referenced by dictionary().

00054         : NIVissimNodeDef(id, name), myEdges(edges) {}

NIVissimNodeDef_Edges::~NIVissimNodeDef_Edges (  )  [virtual]

Definition at line 57 of file NIVissimNodeDef_Edges.cpp.

References myEdges.

00057                                               {
00058     for (NIVissimNodeParticipatingEdgeVector::iterator i=myEdges.begin(); i!=myEdges.end(); i++) {
00059         delete(*i);
00060     }
00061     myEdges.clear();
00062 }


Member Function Documentation

int NIVissimNodeDef::buildNodeCluster (  )  [inherited]

void NIVissimNodeDef::clearDict (  )  [static, inherited]

Definition at line 131 of file NIVissimNodeDef.cpp.

References NIVissimNodeDef::myDict.

Referenced by NIImporter_Vissim::~NIImporter_Vissim().

00131                            {
00132     for (DictType::iterator i=myDict.begin(); i!=myDict.end(); i++) {
00133         delete(*i).second;
00134     }
00135     myDict.clear();
00136 }

void NIVissimNodeDef::dict_assignConnectionsToNodes (  )  [static, inherited]

Definition at line 116 of file NIVissimNodeDef.cpp.

References NIVissimNodeDef::myDict.

00116                                                {
00117     for (DictType::iterator i=myDict.begin(); i!=myDict.end(); i++) {
00118         (*i).second->searchAndSetConnections();
00119     }
00120 }

NIVissimNodeDef * NIVissimNodeDef::dictionary ( int  id  )  [static, inherited]

Definition at line 73 of file NIVissimNodeDef.cpp.

References NIVissimNodeDef::myDict.

00073                                   {
00074     DictType::iterator i=myDict.find(id);
00075     if (i==myDict.end()) {
00076         return 0;
00077     }
00078     return (*i).second;
00079 }

bool NIVissimNodeDef::dictionary ( int  id,
NIVissimNodeDef o 
) [static, inherited]

Definition at line 58 of file NIVissimNodeDef.cpp.

References NIVissimNodeDef::myDict, and NIVissimNodeDef::myMaxID.

Referenced by NIVissimNodeDef_Poly::dictionary(), dictionary(), and NIVissimConnectionCluster::getPositionForEdge().

00058                                                       {
00059     DictType::iterator i=myDict.find(id);
00060     if (i==myDict.end()) {
00061         myDict[id] = o;
00062         myMaxID = myMaxID > id
00063                   ? myMaxID
00064                   : id;
00065 //        o->computeBounding();
00066         return true;
00067     }
00068     return false;
00069 }

bool NIVissimNodeDef_Edges::dictionary ( int  id,
const std::string &  name,
const NIVissimNodeParticipatingEdgeVector edges 
) [static]

Definition at line 66 of file NIVissimNodeDef_Edges.cpp.

References NIVissimNodeDef::dictionary(), and NIVissimNodeDef_Edges().

Referenced by NIVissimSingleTypeParser_Knotendefinition::parse().

00067                                                                                     {
00068     NIVissimNodeDef_Edges *o = new NIVissimNodeDef_Edges(id, name, edges);
00069     if (!NIVissimNodeDef::dictionary(id, o)) {
00070         delete o;
00071         return false;
00072     }
00073     return true;
00074 }

size_t NIVissimNodeDef::dictSize (  )  [static, inherited]

Definition at line 124 of file NIVissimNodeDef.cpp.

References NIVissimNodeDef::myDict.

00124                           {
00125     return myDict.size();
00126 }

SUMOReal NIVissimNodeDef_Edges::getEdgePosition ( int  edgeid  )  const [virtual]

Implements NIVissimNodeDef.

Definition at line 111 of file NIVissimNodeDef_Edges.cpp.

References NIVissimNodeParticipatingEdge::getFromPos(), NIVissimNodeParticipatingEdge::getID(), NIVissimNodeParticipatingEdge::getToPos(), myEdges, and SUMOReal.

00111                                                        {
00112     for (NIVissimNodeParticipatingEdgeVector::const_iterator i=myEdges.begin(); i!=myEdges.end(); i++) {
00113         NIVissimNodeParticipatingEdge *edge = *i;
00114         if (edge->getID()==edgeid) {
00115             return (edge->getFromPos() + edge->getToPos()) / (SUMOReal) 2.0;
00116         }
00117     }
00118     return -1;
00119 }

int NIVissimNodeDef::getMaxID (  )  [static, inherited]

Definition at line 140 of file NIVissimNodeDef.cpp.

References NIVissimNodeDef::myMaxID.

Referenced by NIImporter_Vissim::postLoadBuild().

00140                           {
00141     return myMaxID;
00142 }

void NIVissimNodeDef_Edges::searchAndSetConnections (  )  [virtual]

Implements NIVissimNodeDef.

Definition at line 78 of file NIVissimNodeDef_Edges.cpp.

References Boundary::add(), NIVissimEdge::dictionary(), NIVissimConnection::dictionary(), NIVissimConnection::getFromGeomPosition(), NIVissimNodeParticipatingEdge::getFromPos(), NIVissimNodeParticipatingEdge::getID(), NIVissimConnection::getToGeomPosition(), NIVissimNodeParticipatingEdge::getToPos(), NIVissimEdge::myConnectionClusters, myEdges, NIVissimNodeDef::myID, and NIVissimConnection::setNodeCluster().

00078                                                {
00079     IntVector connections;
00080     IntVector edges;
00081     Boundary boundary;
00082     for (NIVissimNodeParticipatingEdgeVector::const_iterator i=myEdges.begin(); i!=myEdges.end(); i++) {
00083         NIVissimNodeParticipatingEdge *edge = *i;
00084         NIVissimConnection *c =
00085             NIVissimConnection::dictionary(edge->getID());
00086         NIVissimEdge *e =
00087             NIVissimEdge::dictionary(edge->getID());
00088         if (c!=0) {
00089             connections.push_back(edge->getID());
00090             boundary.add(c->getFromGeomPosition());
00091             boundary.add(c->getToGeomPosition());
00092             c->setNodeCluster(myID);
00093         }
00094         if (e!=0) {
00095             edges.push_back(edge->getID());
00096             boundary.add(e->getGeomPosition(edge->getFromPos()));
00097             boundary.add(e->getGeomPosition(edge->getToPos()));
00098         }
00099     }
00100     NIVissimConnectionCluster *c =
00101         new NIVissimConnectionCluster(connections, boundary, myID, edges);
00102     for (IntVector::iterator j=edges.begin(); j!=edges.end(); j++) {
00103         NIVissimEdge *edge = NIVissimEdge::dictionary(*j);
00104         edge->myConnectionClusters.push_back(c);
00105     }
00106 }


Field Documentation

int NIVissimNodeDef::myID [protected, inherited]

std::string NIVissimNodeDef::myName [protected, inherited]

Definition at line 61 of file NIVissimNodeDef.h.


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

Generated on Wed May 5 00:06:54 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6