Debian Codegraph @

py/ymport/foamfile/FacesParser.hpp

raw
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 FacesParser final : public Parser {
19 public:
20 struct Face {
21 std::size_t v0, v1, v2, v3;
22 };
23
24 FacesParser(const boost::filesystem::path& path, std::size_t numberOfPoints)
25 : Parser(path, "faceList", "faces")
26 , m_numberOfPoints(numberOfPoints)
27 {
28 }
29
30 void parse() override;
31
32 const std::vector<Face>& faces() const { return m_faces; }
33
34 private:
35 int m_facesToRead { 0 };
36 std::size_t m_numberOfPoints;
37 std::vector<Face> m_faces;
38 };
39
40 } // namespace foamfile
41 } // namespace ymport
42 } // namespace yade