Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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 47 of file MSVTKExport.h.

Constructor & Destructor Documentation

◆ MSVTKExport()

MSVTKExport::MSVTKExport ( const MSVTKExport )
private

Invalidated copy constructor.

Member Function Documentation

◆ ctype_space()

bool MSVTKExport::ctype_space ( const char  c)
staticprivate

Checks if there is a whitespace.

Definition at line 164 of file MSVTKExport.cpp.

Referenced by trim().

Here is the caller graph for this function:

◆ getOffset()

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

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

Definition at line 150 of file MSVTKExport.cpp.

References trim().

Referenced by write().

Here is the caller graph for this function:

◆ getPositions()

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 104 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().

Here is the caller graph for this function:

◆ getSpeed()

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

Get a Vector with the speed values of each vehicle in the actual timestep.

Definition at line 80 of file MSVTKExport.cpp.

References MSNet::getInstance(), MSVehicle::getLane(), MSVehicle::getPositionOnLane(), MSLane::getShape(), MSVehicle::getSpeed(), MSNet::getVehicleControl(), MSVehicle::isOnRoad(), MSVehicleControl::loadedVehBegin(), MSVehicleControl::loadedVehEnd(), and PositionVector::positionAtOffset().

Referenced by write().

Here is the caller graph for this function:

◆ List2String()

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

Get a comma separated String from a Vector.

Definition at line 130 of file MSVTKExport.cpp.

References trim().

Referenced by write().

Here is the caller graph for this function:

◆ operator=()

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

Invalidated assignment operator.

◆ trim()

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

Deletes the whitespaces at the end of a String.

Definition at line 172 of file MSVTKExport.cpp.

References ctype_space(), and trim().

Referenced by getOffset(), List2String(), and trim().

Here is the caller graph for this function:

◆ write()

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 41 of file MSVTKExport.cpp.

References getOffset(), getPositions(), getSpeed(), and List2String().

Referenced by MSNet::writeOutput().

Here is the caller graph for this function:

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