43 #include <mesosim/MELoop.h>
44 #include <mesosim/MESegment.h>
47 #ifdef CHECK_MEMORY_LEAKS
49 #endif // CHECK_MEMORY_LEAKS
58 of.
openTag(
"?xml") <<
" version=\"1.0\" encoding=\"UTF-8\" ?>\n";
59 of.
openTag(
"VTKFile") <<
" type=\"PolyData\" version=\"0.1\" order=\"LittleEndian\" >\n";
60 of.
openTag(
"PolyData") <<
">\n";
62 std::vector<double> speed =
getSpeed();
66 of.
openTag(
"Piece") <<
" NumberOfPoints=\"" << speed.size() <<
67 "\" NumberOfVerts=\"1\" NumberOfLines=\"0\" NumberOfStrips=\"0\" NumberOfPolys=\"0\">\n";
69 of.
openTag(
"PointData") <<
">\n";
89 of.
openTag(
"DataArray") <<
" type=\"Int64\" Name=\"connectivity\" format=\"ascii\" >" <<
getOffset((
int) speed.size());
92 of.
openTag(
"DataArray") <<
" type=\"Int64\" Name=\"offsets\" format=\"ascii\" >" << speed.size();
99 of.
openTag(
"DataArray") <<
" type=\"Int64\" Name=\"connectivity\" format=\"ascii\"";
102 of.
openTag(
"DataArray") <<
" type=\"Int64\" Name=\"offsets\" format=\"ascii\"";
109 of.
openTag(
"DataArray") <<
" type=\"Int64\" Name=\"connectivity\" format=\"ascii\"";
112 of.
openTag(
"DataArray") <<
" type=\"Int64\" Name=\"offsets\" format=\"ascii\"";
119 of.
openTag(
"DataArray") <<
" type=\"Int64\" Name=\"connectivity\" format=\"ascii\"";
122 of.
openTag(
"DataArray") <<
" type=\"Int64\" Name=\"offsets\" format=\"ascii\"";
142 std::vector<double> output;
149 for (; it != end; ++it) {
155 output.push_back(veh->
getSpeed() * 3.6);
166 std::vector<double> output;
173 for (; it != end; ++it) {
192 std::string output =
"";
193 for (
unsigned i = 0; i < input.size(); i++) {
195 std::stringstream ss;
198 ss.precision(::std::numeric_limits<double>::digits10);
199 ss.unsetf(::std::ios::dec);
200 ss.setf(::std::ios::scientific);
202 ss << input[i] <<
" ";
212 std::string output =
"";
213 for (
int i = 0; i < nr; i++) {
215 std::stringstream ss;
225 if (c ==
' ' || c ==
'\t' || c ==
'\r' || c ==
'\n' || c == 11) {
233 bool trimmed =
false;
236 istring.erase(istring.length() - 1);
248 return trim(istring);