21 #ifndef NIImporter_Vissim_h
22 #define NIImporter_Vissim_h
96 virtual bool parse(std::istream& from) = 0;
100 std::string
myRead(std::istream& from);
104 const std::string& excl =
"");
107 const std::vector<std::string>& excl);
111 const std::string& tag =
"");
119 const std::string& next);
126 std::string
readName(std::istream& from);
130 bool skipOverreading(std::istream& from,
const std::string& name =
"");
133 void readUntil(std::istream& from,
const std::string& name);
167 typedef std::map<NIVissimElement, VissimSingleTypeParser*>
ToParserMap;
void readUntil(std::istream &from, const std::string &name)
Reads from the stream until the keywor occurs.
std::string myRead(std::istream &from)
reads from the stream and returns the lower case version of the read value
std::string readEndSecure(std::istream &from, const std::string &excl="")
as myRead, but returns "DATAEND" when the current field has ended
~NIImporter_Vissim()
destructor
Importer for networks stored in Vissim format.
VissimSingleTypeParser(NIImporter_Vissim &parent)
Constructor.
virtual ~VissimSingleTypeParser()
Destructor.
std::map< std::string, NIVissimElement > ToElemIDMap
Definition of a map from element names to their numerical representation.
virtual bool parse(std::istream &from)=0
Parses a single data type. Returns whether no error occured.
bool readContents(std::istream &strm)
NIImporter_Vissim & myVissimParent
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.
NIVissimExtendedEdgePoint readExtEdgePointDef(std::istream &from)
void load(const OptionsCont &options)
loads the vissim file
A point in 2D or 3D with translation and scaling methods.
ColorMap myColorMap
a map from color names to color definitions
NIImporter_Vissim & operator=(const NIImporter_Vissim &)
Invalidated assignment operator.
Position getPosition(std::istream &from)
returns the 2d-position saved as next within the stream
std::string readName(std::istream &from)
Reads the structures name We cannot use the "<<" operator, as names may contain more than one wor...
void postLoadBuild(SUMOReal offset)
void buildParsers()
adds id-to-parser - relationships of elements to parse into myParsers
std::map< std::string, RGBColor > ColorMap
definition of a map from color names to color definitions
NIImporter_Vissim(NBNetBuilder &nb, const std::string &file)
constructor
VissimSingleTypeParser & operator=(const VissimSingleTypeParser &)
Invalidated assignment operator.
Instance responsible for building networks.
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...
std::map< NIVissimElement, VissimSingleTypeParser * > ToParserMap
Definition of a map from an element's numerical id to his parser.
NBNetBuilder & myNetBuilder
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 ...
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