| 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 "BoundaryParser.hpp" |
| 11 |
#include "FacesParser.hpp" |
| 12 |
#include "PointsParser.hpp" |
| 13 |
|
| 14 |
#include <lib/base/AliasNamespaces.hpp> |
| 15 |
|
| 16 |
#include <boost/filesystem.hpp> |
| 17 |
#include <boost/python/list.hpp> |
| 18 |
|
| 19 |
#include <memory> |
| 20 |
#include <string> |
| 21 |
|
| 22 |
namespace yade { |
| 23 |
namespace ymport { |
| 24 |
namespace foamfile { |
| 25 |
class PolyMesh { |
| 26 |
public: |
| 27 |
PolyMesh(const std::string& baseDirPath, bool patchAsWall, bool emptyAsWall); |
| 28 |
|
| 29 |
const py::list& facetCoords() const { return m_facetCoords; } |
| 30 |
|
| 31 |
private: |
| 32 |
void buildFacets(bool patchAsWall, bool emptyAsWall); |
| 33 |
|
| 34 |
void error(const char* fmt, ...); |
| 35 |
|
| 36 |
std::string m_baseDirPath; |
| 37 |
|
| 38 |
std::unique_ptr<PointsParser> m_pointsParser { nullptr }; |
| 39 |
std::unique_ptr<FacesParser> m_facesParser { nullptr }; |
| 40 |
std::unique_ptr<BoundaryParser> m_boundaryParser { nullptr }; |
| 41 |
|
| 42 |
std::vector<PointsParser::Point> m_points; |
| 43 |
std::vector<FacesParser::Face> m_faces; |
| 44 |
std::vector<BoundaryParser::Boundary> m_boundaries; |
| 45 |
py::list m_facetCoords; |
| 46 |
}; |
| 47 |
|
| 48 |
} // namespace foamfile |
| 49 |
} // namespace ymport |
| 50 |
} // namespace yade |