SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSVTKExport Class Reference

Produce a VTK output to use with Tools like ParaView. More...

#include <MSVTKExport.h>

Static Public Member Functions

static void write (OutputDevice &of, SUMOTime timestep)
 Produce a VTK output to use with Tools like ParaView.

Private Member Functions

 MSVTKExport (const MSVTKExport &)
 Invalidated copy constructor.
MSVTKExportoperator= (const MSVTKExport &)
 Invalidated assignment operator.

Static Private Member Functions

static bool ctype_space (const char c)
 Checks if there is a whitespace.
static std::string getOffset (int nr)
 Get a String with the indexes of all vehicles (needed in the VTk File)
static std::vector< double > getPositions ()
 Get a Vector of the Positions (x,y,z) of each vehicle in the actual timestep.
static std::vector< double > getSpeed ()
 Get a Vector with the speed values of each vehicle in the actual timestep.
static std::string List2String (std::vector< double > input)
 Get a comma separated String from a Vector.
static std::string trim (std::string istring)
 Deletes the whitespaces at the end of a String.

Detailed Description

Produce a VTK output to use with Tools like ParaView.

The class offers a static method, which writes VTK Files for each timestep of the simulation, where at least one vehicle is present.

Todo:

Definition at line 55 of file MSVTKExport.h.

Constructor & Destructor Documentation

MSVTKExport::MSVTKExport ( const MSVTKExport )
private

Invalidated copy constructor.

Member Function Documentation

bool MSVTKExport::ctype_space ( const char  c)
staticprivate

Checks if there is a whitespace.

Definition at line 224 of file MSVTKExport.cpp.

Referenced by trim().

std::string MSVTKExport::getOffset ( int  nr)
staticprivate

Get a String with the indexes of all vehicles (needed in the VTk File)

Definition at line 210 of file MSVTKExport.cpp.

References trim().

Referenced by write().

std::vector< double > MSVTKExport::getPositions ( )
staticprivate

Get a Vector of the Positions (x,y,z) of each vehicle in the actual timestep.

Definition at line 164 of file MSVTKExport.cpp.

References MSNet::getInstance(), MSVehicle::getPosition(), MSNet::getVehicleControl(), MSVehicle::isOnRoad(), MSVehicleControl::loadedVehBegin(), MSVehicleControl::loadedVehEnd(), Position::x(), Position::y(), and Position::z().

Referenced by write().

std::vector< double > MSVTKExport::getSpeed ( )
staticprivate
std::string MSVTKExport::List2String ( std::vector< double >  input)
staticprivate

Get a comma separated String from a Vector.

Definition at line 190 of file MSVTKExport.cpp.

References trim().

Referenced by write().

MSVTKExport& MSVTKExport::operator= ( const MSVTKExport )
private

Invalidated assignment operator.

std::string MSVTKExport::trim ( std::string  istring)
staticprivate

Deletes the whitespaces at the end of a String.

Definition at line 232 of file MSVTKExport.cpp.

References ctype_space().

Referenced by getOffset(), and List2String().

void MSVTKExport::write ( OutputDevice of,
SUMOTime  timestep 
)
static

Produce a VTK output to use with Tools like ParaView.

Parameters
[in]ofThe output device to use
[in]ecThe EdgeControl which holds the edges to write
[in]timestepThe current time step
Exceptions
IOErrorIf an error on writing occurs (!!! not yet implemented)

Definition at line 56 of file MSVTKExport.cpp.

References OutputDevice::closeTag(), getOffset(), getPositions(), getSpeed(), List2String(), and OutputDevice::openTag().

Referenced by MSNet::writeOutput().


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