drawable_object.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014 Google Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef TANGO_GL_DRAWABLE_OBJECT_H_
18 #define TANGO_GL_DRAWABLE_OBJECT_H_
19 
20 #include <vector>
21 
22 #include "tango-gl/color.h"
23 #include "tango-gl/transform.h"
24 #include "tango-gl/util.h"
25 
26 namespace tango_gl {
27 class DrawableObject : public Transform {
28  public:
29  DrawableObject() : red_(0), green_(0), blue_(0), alpha_(1.0f) {};
30  DrawableObject(const DrawableObject& other) = delete;
31  const DrawableObject& operator=(const DrawableObject&) = delete;
32 
33  void DeleteGlResources();
34  void SetShader();
35  void SetColor(const Color& color);
36  void SetColor(const float red, const float green, const float blue);
37  void SetAlpha(const float alpha);
38  void SetVertices(const std::vector<GLfloat>& vertices);
39  void SetVertices(const std::vector<GLfloat>& vertices,
40  const std::vector<GLushort>& indices);
41  void SetVertices(const std::vector<GLfloat>& vertices,
42  const std::vector<GLfloat>& normals);
43  virtual void Render(const glm::mat4& projection_mat,
44  const glm::mat4& view_mat) const = 0;
45 
46  protected:
47  float red_;
48  float green_;
49  float blue_;
50  float alpha_;
51  std::vector<GLushort> indices_;
52  std::vector<GLfloat> vertices_;
53  std::vector<GLfloat> normals_;
54 
55  GLenum render_mode_;
61 };
62 } // namespace tango_gl
63 #endif // TANGO_GL_DRAWABLE_OBJECT_H_
const DrawableObject & operator=(const DrawableObject &)=delete
void SetAlpha(const float alpha)
f
virtual void Render(const glm::mat4 &projection_mat, const glm::mat4 &view_mat) const =0
static const float vertices[]
Definition: quad.cpp:39
std::vector< GLfloat > vertices_
unsigned int GLuint
Definition: dummy.cpp:78
void SetColor(const Color &color)
std::vector< GLfloat > normals_
std::vector< GLushort > indices_
void SetVertices(const std::vector< GLfloat > &vertices)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Jan 23 2023 03:37:28