23 #ifndef NIImporter_Vissim_h
24 #define NIImporter_Vissim_h
85 typedef std::map<std::string, std::list<std::string> >
nodeMap;
507 virtual bool parse(std::istream& from) = 0;
511 std::string
myRead(std::istream& from);
515 const std::string& excl =
"");
518 const std::vector<std::string>& excl);
522 const std::string& tag =
"");
530 const std::string& next);
537 std::string
readName(std::istream& from);
541 bool skipOverreading(std::istream& from,
const std::string& name =
"");
544 void readUntil(std::istream& from,
const std::string& name);
578 typedef std::map<NIVissimElement, VissimSingleTypeParser*>
ToParserMap;
~NIVissimXMLHandler_Zuflussdefinition()
Destructor.
void readUntil(std::istream &from, const std::string &name)
Reads from the stream until the keywor occurs.
int myHierarchyLevel
The current hierarchy level.
NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition & operator=(const NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition &vW)
invalidated assignment operator
NIVissimXMLHandler_Parkplatzdefinition()
Constructor.
NIVissimXMLHandler_Streckendefinition(nodeMap &elemData)
Constructor.
std::string myRead(std::istream &from)
reads from the stream and returns the lower case version of the read value
NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition(nodeMap &elemData)
Constructor.
~NIVissimXMLHandler_Routenentscheidungsdefinition()
Destructor.
std::string readEndSecure(std::istream &from, const std::string &excl="")
as myRead, but returns "DATAEND" when the current field has ended
~NIImporter_Vissim()
destructor
static StringBijection< int >::Entry vissimAttrs[]
The names of VISSIM-XML attributes (for passing to GenericSAXHandler)
NIVissimXMLHandler_Zuflussdefinition()
Constructor.
NIVissimXMLHandler_Parkplatzdefinition & operator=(const NIVissimXMLHandler_Parkplatzdefinition &z)
invalidated assignment operator
int myLastNodeID
ID of the currently parsed node, for reporting mainly.
~NIVissimXMLHandler_Parkplatzdefinition()
Destructor.
~NIVissimXMLHandler_VWunschentscheidungsdefinition()
Destructor.
Importer for networks stored in Vissim format.
VissimSingleTypeParser(NIImporter_Vissim &parent)
Constructor.
virtual ~VissimSingleTypeParser()
Destructor.
NIVissimXMLHandler_ConflictArea & operator=(const NIVissimXMLHandler_ConflictArea &c)
invalidated assignment operator
std::map< std::string, NIVissimElement > ToElemIDMap
Definition of a map from element names to their numerical representation.
NIVissimXMLHandler_Routenentscheidungsdefinition(nodeMap &elemData)
Constructor.
NIVissimXMLHandler_VWunschentscheidungsdefinition & operator=(const NIVissimXMLHandler_VWunschentscheidungsdefinition &vW)
invalidated assignment operator
virtual bool parse(std::istream &from)=0
Parses a single data type. Returns whether no error occured.
bool readContents(std::istream &strm)
~NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition()
Destructor.
int myLastNodeID
ID of the currently parsed node, for reporting mainly.
void myEndElement(int element)
Callback method for a closing tag to implement by derived classes.
int myLastNodeID
ID of the currently parsed node, for reporting mainly.
NIImporter_Vissim & myVissimParent
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
int myHierarchyLevel
The current hierarchy level.
void loadXML(const OptionsCont &options, NBNetBuilder &nb)
ToParserMap myParsers
Parsers by element id.
void insertKnownElements()
adds name-to-id - relationships of known elements into myKnownElements
ToElemIDMap myKnownElements
Map from element names to their numerical representation.
~NIVissimXMLHandler_Fahrzeugklassendefinition()
Destructor.
A handler which converts occuring elements and attributes into enums.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
void myEndElement(int element)
Callback method for a closing tag to implement by derived classes.
bool myInputIsLegacyFormat
NIVissimExtendedEdgePoint readExtEdgePointDef(std::istream &from)
Encapsulated SAX-Attributes.
void load(const OptionsCont &options)
loads the vissim file
int myLastNodeID
ID of the currently parsed node, for reporting mainly.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
A point in 2D or 3D with translation and scaling methods.
static StringBijection< int >::Entry vissimTags[]
The names of VISSIM-XML elements (for passing to GenericSAXHandler)
ColorMap myColorMap
a map from color names to color definitions
~NIVissimXMLHandler_Streckendefinition()
Destructor.
NIImporter_Vissim & operator=(const NIImporter_Vissim &)
Invalidated assignment operator.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
int myLastNodeID
ID of the currently parsed node, for reporting mainly.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
bool isConnector
check if the link is a connector
NIVissimXMLHandler_Routenentscheidungsdefinition & operator=(const NIVissimXMLHandler_Routenentscheidungsdefinition &r)
invalidated assignment operator
Position getPosition(std::istream &from)
returns the 2d-position saved as next within the stream
VissimXMLTag
Numbers representing VISSIM-XML - element names.
NIVissimXMLHandler_Zuflussdefinition & operator=(const NIVissimXMLHandler_Zuflussdefinition &z)
invalidated assignment operator
int myHierarchyLevel
The current hierarchy level.
void myEndElement(int element)
Callback method for a closing tag to implement by derived classes.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
std::string readName(std::istream &from)
Reads the structures name We cannot use the "<<" operator, as names may contain more than one word wh...
void postLoadBuild(SUMOReal offset)
void buildParsers()
adds id-to-parser - relationships of elements to parse into myParsers
NIVissimXMLHandler_Fahrzeugklassendefinition(nodeMap &elemData)
Constructor.
std::map< std::string, RGBColor > ColorMap
definition of a map from color names to color definitions
NIVissimXMLHandler_Streckendefinition & operator=(const NIVissimXMLHandler_Streckendefinition &s)
invalidated assignment operator
std::map< std::string, std::list< std::string > > nodeMap
~NIVissimXMLHandler_ConflictArea()
Destructor.
NIImporter_Vissim(NBNetBuilder &nb, const std::string &file)
constructor
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
VissimSingleTypeParser & operator=(const VissimSingleTypeParser &)
Invalidated assignment operator.
Instance responsible for building networks.
int myHierarchyLevel
The current hierarchy level.
A storage for options typed value containers)
bool skipOverreading(std::istream &from, const std::string &name="")
Overreads the named parameter (if) given and skips the rest until "DATAEND".
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads network definition from the assigned option and stores it in the given network builder...
NIVissimXMLHandler_VWunschentscheidungsdefinition(nodeMap &elemData)
Constructor.
VissimXMLAttr
Numbers representing VISSIM-XML - attributes.
std::map< NIVissimElement, VissimSingleTypeParser * > ToParserMap
Definition of a map from an element's numerical id to his parser.
NBNetBuilder & myNetBuilder
NIVissimXMLHandler_ConflictArea()
Constructor.
void myEndElement(int element)
Callback method for a closing tag to implement by derived classes.
int myHierarchyLevel
The current hierarchy level.
void myEndElement(int element)
Callback method for a closing tag to implement by derived classes.
bool admitContinue(const std::string &tag)
std::string overrideOptionalLabel(std::istream &from, const std::string &tag="")
overrides the optional label definition; returns the next tag as done by readEndSecure ...
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
NIVissimXMLHandler_Fahrzeugklassendefinition & operator=(const NIVissimXMLHandler_Fahrzeugklassendefinition &f)
invalidated assignment operator
std::vector< int > parseAssignedVehicleTypes(std::istream &from, const std::string &next)
parses a listof vehicle types assigned to the current data field One should remeber, that -1 means "all" vehicle types
A class which extracts VISSIM-Routes from a parsed VISSIM-file.