Line data Source code
1 : // Copyright (c) 2021 Made to Order Software Corp. All Rights Reserved
2 : //
3 : // https://snapwebsites.org/project/ftmesh
4 : // contact@m2osw.com
5 : //
6 : // This program is free software; you can redistribute it and/or modify
7 : // it under the terms of the GNU General Public License as published by
8 : // the Free Software Foundation; either version 2 of the License, or
9 : // (at your option) any later version.
10 : //
11 : // This program is distributed in the hope that it will be useful,
12 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : // GNU General Public License for more details.
15 : //
16 : // You should have received a copy of the GNU General Public License along
17 : // with this program; if not, write to the Free Software Foundation, Inc.,
18 : // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 : #pragma once
20 :
21 : /** \file
22 : * \brief Definitions of the ftmesh class.
23 : *
24 : * This header defines the ftmesh class which represents one glyphs.
25 : *
26 : * When a glyph is loaded, it gets transformed in a list of vertices which
27 : * represent triangles that can be used to render the character.
28 : */
29 :
30 : // self
31 : //
32 : #include "point.h"
33 :
34 :
35 : // C++ lib
36 : //
37 : #include <deque>
38 : #include <map>
39 :
40 :
41 : namespace ftmesh
42 : {
43 :
44 :
45 9 : class mesh
46 : {
47 : public:
48 : typedef std::shared_ptr<mesh> pointer_t;
49 : typedef std::deque<pointer_t> deque_t;
50 : typedef std::map<char32_t, pointer_t> map_t;
51 : typedef std::vector<int> index_vector_t;
52 : //typedef std::vector<GLenum> type_vector_t;
53 :
54 : mesh(float advance);
55 :
56 : void begin();
57 : void add_point(point const & point);
58 : void end();
59 :
60 : point::vector_t const & get_points() const;
61 : index_vector_t const & get_indexes() const;
62 : //type_vector_t const & get_types() const;
63 : float get_advance() const;
64 :
65 : private:
66 : point::vector_t f_points = point::vector_t();
67 : index_vector_t f_indexes = index_vector_t();
68 : //type_vector_t f_type = type_vector_t();
69 : float f_advance = 0;
70 : };
71 :
72 :
73 :
74 : } // namespace ftmesh
75 : // vim: ts=4 sw=4 et
|