| 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 |
#pragma once |
| 9 |
|
| 10 |
#include "Parser.hpp" |
| 11 |
|
| 12 |
#include <vector> |
| 13 |
|
| 14 |
namespace yade { |
| 15 |
namespace ymport { |
| 16 |
namespace foamfile { |
| 17 |
|
| 18 |
class PointsParser final : public Parser { |
| 19 |
public: |
| 20 |
struct Point { |
| 21 |
double x, y, z; |
| 22 |
}; |
| 23 |
|
| 24 |
PointsParser(const boost::filesystem::path& path) |
| 25 |
: Parser(path, "vectorField", "points") |
| 26 |
{ |
| 27 |
} |
| 28 |
|
| 29 |
void parse() override; |
| 30 |
|
| 31 |
const std::vector<Point>& points() const { return m_points; } |
| 32 |
|
| 33 |
private: |
| 34 |
int m_pointsToRead { 0 }; |
| 35 |
std::vector<Point> m_points; |
| 36 |
}; |
| 37 |
|
| 38 |
} // namespace foamfile |
| 39 |
} // namespace ymport |
| 40 |
} // namespace yade |