app
android
jni
tango-gl
include
tango-gl
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.0
f
) {};
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_
;
56
GLuint
shader_program_
;
57
GLuint
uniform_color_
;
58
GLuint
uniform_mvp_mat_
;
59
GLuint
attrib_vertices_
;
60
GLuint
attrib_normals_
;
61
};
62
}
// namespace tango_gl
63
#endif // TANGO_GL_DRAWABLE_OBJECT_H_
tango_gl::DrawableObject::SetAlpha
void SetAlpha(const float alpha)
Definition:
drawable_object.cpp:49
tango_gl::DrawableObject::alpha_
float alpha_
Definition:
drawable_object.h:50
tango_gl::DrawableObject::attrib_vertices_
GLuint attrib_vertices_
Definition:
drawable_object.h:59
tango_gl::DrawableObject::red_
float red_
Definition:
drawable_object.h:47
tango_gl::DrawableObject::SetVertices
void SetVertices(const std::vector< GLfloat > &vertices)
Definition:
drawable_object.cpp:51
tango_gl::DrawableObject::SetColor
void SetColor(const Color &color)
Definition:
drawable_object.cpp:45
tango_gl::DrawableObject::DrawableObject
DrawableObject()
Definition:
drawable_object.h:29
tango_gl::vertices
static const float vertices[]
Definition:
quad.cpp:39
util.h
tango_gl::DrawableObject::normals_
std::vector< GLfloat > normals_
Definition:
drawable_object.h:53
tango_gl::DrawableObject::blue_
float blue_
Definition:
drawable_object.h:49
glm::detail::tmat4x4
Definition:
type_mat.hpp:47
tango_gl::DrawableObject::green_
float green_
Definition:
drawable_object.h:48
tango_gl::DrawableObject::render_mode_
GLenum render_mode_
Definition:
drawable_object.h:55
GLuint
unsigned int GLuint
Definition:
dummy.cpp:78
tango_gl::DrawableObject::Render
virtual void Render(const glm::mat4 &projection_mat, const glm::mat4 &view_mat) const =0
tango_gl::DrawableObject::uniform_color_
GLuint uniform_color_
Definition:
drawable_object.h:57
tango_gl::Transform
Definition:
transform.h:24
tango_gl::DrawableObject
Definition:
drawable_object.h:27
tango_gl::DrawableObject::attrib_normals_
GLuint attrib_normals_
Definition:
drawable_object.h:60
tango_gl::DrawableObject::DeleteGlResources
void DeleteGlResources()
Definition:
drawable_object.cpp:34
f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
tango_gl::DrawableObject::indices_
std::vector< GLushort > indices_
Definition:
drawable_object.h:51
tango_gl::Color
Definition:
color.h:21
tango_gl::DrawableObject::vertices_
std::vector< GLfloat > vertices_
Definition:
drawable_object.h:52
tango_gl::DrawableObject::SetShader
void SetShader()
Definition:
drawable_object.cpp:22
transform.h
tango_gl::DrawableObject::operator=
const DrawableObject & operator=(const DrawableObject &)=delete
tango_gl::DrawableObject::uniform_mvp_mat_
GLuint uniform_mvp_mat_
Definition:
drawable_object.h:58
color.h
tango_gl
Definition:
axis.cpp:20
tango_gl::DrawableObject::shader_program_
GLuint shader_program_
Definition:
drawable_object.h:56
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:09