114 #ifdef CHECK_MEMORY_LEAKS
116 #endif // CHECK_MEMORY_LEAKS
127 if (!oc.
isSet(
"vissim-file")) {
140 : myVissimParent(parent) {}
157 const std::string& excl) {
159 std::string tmp = myRead(from);
165 (tmp.substr(0, 2) ==
"--" || !myVissimParent.admitContinue(tmp))
175 const std::vector<std::string>& excl) {
176 std::vector<std::string> myExcl;
177 std::vector<std::string>::const_iterator i;
178 for (i = excl.begin(); i != excl.end(); i++) {
180 myExcl.push_back(mes);
182 std::string tmp = myRead(from);
188 for (i = myExcl.begin(); i != myExcl.end() && !equals; i++) {
195 (tmp.substr(0, 2) ==
"--" || !myVissimParent.admitContinue(tmp))
205 const std::string& tag) {
212 if (tmp ==
"beschriftung") {
214 if (tmp ==
"keine") {
235 std::istream& from,
const std::string& next) {
236 std::string tmp = readEndSecure(from);
237 std::vector<int> ret;
242 while (tmp !=
"DATAEND" && tmp != next) {
244 tmp = readEndSecure(from);
252 std::istream& from) {
258 std::vector<int> lanes;
259 while (tag !=
"bei") {
260 tag = readEndSecure(from);
263 lanes.push_back(lane - 1);
268 std::vector<int> dummy;
277 if (name[0] ==
'"') {
278 while (name[name.length() - 1] !=
'"') {
281 name = name +
" " + tmp;
283 name = name.substr(1, name.length() - 2);
291 const std::string& name) {
293 while (tag != name) {
300 const std::string& name) {
302 while (tag != name) {
305 while (tag !=
"DATAEND") {
306 tag = readEndSecure(from);
364 std::ifstream strm(options.
getString(
"vissim-file").c_str());
391 while (strm.good() && ok) {
400 while (!parsed && strm.good() && ok) {
403 ToParserMap::iterator j =
myParsers.find((*i).second);
406 ok = parser->
parse(strm);
416 }
while (strm.good() && (line ==
"" || line[0] ==
' ' || line[0] ==
'-'));
void readUntil(std::istream &from, const std::string &name)
Reads from the stream until the keywor occurs.
static void dict_BuildDistricts(NBDistrictCont &dc, NBEdgeCont &ec, NBNodeCont &nc)
Builds the districts.
static void dict_buildNBEdgeConnections(NBEdgeCont &ec)
static void joinBySameEdges(SUMOReal offset)
Tries to joind clusters participating within a node This is done by joining clusters which overlap...
static const RGBColor WHITE
std::string myRead(std::istream &from)
reads from the stream and returns the lower case version of the read value
static void dict_checkEdges2Join()
static void reportUnsetSpeeds()
Writes edges with unset speeds to the warnings message log instance.
std::string readEndSecure(std::istream &from, const std::string &excl="")
as myRead, but returns "DATAEND" when the current field has ended
~NIImporter_Vissim()
destructor
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Importer for networks stored in Vissim format.
VissimSingleTypeParser(NIImporter_Vissim &parent)
Constructor.
virtual ~VissimSingleTypeParser()
Destructor.
virtual bool parse(std::istream &from)=0
Parses a single data type. Returns whether no error occured.
bool readContents(std::istream &strm)
static void closeLoading()
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
static const RGBColor BLACK
#define UNUSED_PARAMETER(x)
static OptionsCont & getOptions()
Retrieves the options.
ToParserMap myParsers
Parsers by element id.
static void dict_CheckEdgeEnds()
static void dict_assignToEdges()
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
void insertKnownElements()
adds name-to-id - relationships of known elements into myKnownElements
ToElemIDMap myKnownElements
Map from element names to their numerical representation.
static void dict_BuildDistrictConnections()
static void setCurrentVirtID(int id)
static const RGBColor GREEN
static const RGBColor GREY
NIVissimExtendedEdgePoint readExtEdgePointDef(std::istream &from)
static void dict_addDisturbances(NBDistrictCont &dc, NBNodeCont &nc, NBEdgeCont &ec)
static void dict_propagateSpeeds()
void load(const OptionsCont &options)
loads the vissim file
A point in 2D or 3D with translation and scaling methods.
NBEdgeCont & getEdgeCont()
Returns the edge container.
ColorMap myColorMap
a map from color names to color definitions
static void buildNodeClusters()
static bool dict_SetSignals(NBTrafficLightLogicCont &tlc, NBEdgeCont &ec)
static const RGBColor MAGENTA
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 word wh...
void postLoadBuild(SUMOReal offset)
static std::string convertUmlaute(std::string str)
Converts german "Umlaute" to their latin-version.
void buildParsers()
adds id-to-parser - relationships of elements to parse into myParsers
static void clearDict()
Clears the dictionary.
static void buildConnectionClusters()
Clusters connections of each edge.
static std::string to_lower_case(std::string str)
Transfers the content to lower case.
static const RGBColor YELLOW
static int _2int(const E *const data)
static const RGBColor RED
static const RGBColor CYAN
NIImporter_Vissim(NBNetBuilder &nb, const std::string &file)
constructor
NBNodeCont & getNodeCont()
Returns the node container.
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...
NBTrafficLightLogicCont & getTLLogicCont()
Returns the traffic light logics container.
static void buildNBNodes(NBNodeCont &nc)
static void dict_SetDisturbances()
NBNetBuilder & myNetBuilder
NBDistrictCont & getDistrictCont()
Returns the districts container.
bool admitContinue(const std::string &tag)
static void dict_buildNBEdges(NBDistrictCont &dc, NBNodeCont &nc, NBEdgeCont &ec, SUMOReal offset)
Builds NBEdges from the VissimEdges within the dictionary.
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
static void dict_BuildDistrictNodes(NBDistrictCont &dc, NBNodeCont &nc)
Builds the nodes that belong to a district.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.