Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Plane.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2016 "Omnidome" by cr8tr
2  * Dome Mapping Projection Software (http://omnido.me).
3  * Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
4  *
5  * This file is part of Omnidome.
6  *
7  * Omnidome is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Affero General Public License for more details.
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OMNI_VISUAL_PLANE_H_
20 #define OMNI_VISUAL_PLANE_H_
21 
22 #include <functional>
23 #include <omni/visual/VertexVBO.h>
24 #include <omni/visual/Interface.h>
26 
27 namespace omni {
28  namespace visual {
29  /**@brief A plane with n x m grid points
30  @detail Vertex data is not stored on host, it is copied to GPU directly.
31  Plane has dimensions [-0.5,-0.5] - [0.5,0.5]
32  **/
33  class Plane : public visual::Interface {
34  public:
35  typedef std::function<void (QVector2D&, size_t, size_t)>
37 
38  Plane();
39  ~Plane();
40 
41  /// Draw plane
42  void draw() const;
43 
44  /// Update mesh with texcoord transformation
46 
47  /// Update mesh (without transforming texture coordinates)
48  void update();
49 
50  /// Return number of horizontal subdivisions
51  size_t horizontal() const;
52 
53  /// Set horizontal subdivisions (does not regenerate the mesh)
54  void setHorizontal(size_t _horizontal);
55 
56  /// Return number of vertical subdivisions
57  size_t vertical() const;
58 
59  /// Set vertical subdivisions (does not regenerate the mesh)
60  void setVertical(size_t _vertical);
61 
62  /// Set horizontal and vertical subdivisions (does not regenerate the
63  // mesh)
64  void resize(size_t _horizontal,
65  size_t _vertical);
66 
67  private:
68  size_t horizontal_ = 10;
69  size_t vertical_ = 10;
71  };
72  }
73 }
74 
75 #endif /* OMNI_VISUAL_PLANE_H_ */
size_t horizontal() const
Return number of horizontal subdivisions.
Definition: Plane.cpp:76
A plane with n x m grid points Vertex data is not stored on host, it is copied to GPU directly...
Definition: Plane.h:33
ContextBoundPtr< VertexVBO > vbo_
Definition: Plane.h:70
void update()
Update mesh (without transforming texture coordinates)
Definition: Plane.cpp:72
size_t horizontal_
Definition: Plane.h:68
Basic visual interface.
Definition: Interface.h:28
size_t vertical_
Definition: Plane.h:69
Plane()
Definition: Plane.cpp:24
void resize(size_t _horizontal, size_t _vertical)
Set horizontal and vertical subdivisions (does not regenerate the.
Definition: Plane.cpp:98
std::function< void(QVector2D &, size_t, size_t)> texcoord_transform_functor_type
Definition: Plane.h:36
size_t vertical() const
Return number of vertical subdivisions.
Definition: Plane.cpp:87
void setVertical(size_t _vertical)
Set vertical subdivisions (does not regenerate the mesh)
Definition: Plane.cpp:91
void setHorizontal(size_t _horizontal)
Set horizontal subdivisions (does not regenerate the mesh)
Definition: Plane.cpp:80
void draw() const
Draw plane.
Definition: Plane.cpp:29
~Plane()
Definition: Plane.cpp:27
A pointer template which is free'd together with its context Holds an internal object which is respo...
Definition: ContextBoundPtr.h:32