| 1 |
/************************************************************************* |
| 2 |
* 2022 Tóth János * |
| 3 |
* * |
| 4 |
* This program is free software; it is licensed under the terms of the * |
| 5 |
* GNU General Public License v2 or later. See file LICENSE for details. * |
| 6 |
*************************************************************************/ |
| 7 |
|
| 8 |
#include "PointsParser.hpp" |
| 9 |
#include "VerifyMacros.hpp" |
| 10 |
|
| 11 |
namespace yade { |
| 12 |
namespace ymport { |
| 13 |
namespace foamfile { |
| 14 |
|
| 15 |
void PointsParser::parse() |
| 16 |
{ |
| 17 |
m_pointsToRead = getInt(); |
| 18 |
|
| 19 |
expect({ '(' }); |
| 20 |
|
| 21 |
double x, y, z; |
| 22 |
|
| 23 |
m_points.reserve(m_pointsToRead); |
| 24 |
|
| 25 |
for (int i = 0; i < m_pointsToRead; i++) { |
| 26 |
expect({ '(' }); |
| 27 |
x = getNumber(); |
| 28 |
y = getNumber(); |
| 29 |
z = getNumber(); |
| 30 |
|
| 31 |
m_points.emplace_back(Point { x, y, z }); |
| 32 |
|
| 33 |
expect({ ')' }); |
| 34 |
} |
| 35 |
|
| 36 |
expect({ ')' }); |
| 37 |
} |
| 38 |
|
| 39 |
} // namespace foamfile |
| 40 |
} // namespace ymport |
| 41 |
} // namespace yade |