band.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_BAND_H_
18 #define TANGO_GL_BAND_H_
19 
20 #include <stdlib.h>
21 #include <vector>
22 
24 
25 namespace tango_gl {
26 class Band : public DrawableObject {
27  public:
28  enum BandMode {
29  kNormal = 0,
30  kKeepLeft = 1,
32  };
33 
34  Band(const unsigned int max_legnth);
35 
36  void SetWidth(const float width);
37  // Render a Band with arrow head, pass in the mode for rendering,
38  // kKeepLeft is left turn, kKeepRight is right turn,
39  // when making a turn, vertices only get updated in one side to avoid overlapping.
40  void UpdateVertexArray(const glm::mat4 m, BandMode mode);
41  void UpdateVertexArray(const glm::mat4 m);
42  void SetVertexArray(const std::vector<glm::vec3>& v, const glm::vec3& up);
43  void ClearVertexArray();
44  void Render(const glm::mat4& projection_mat, const glm::mat4& view_mat) const;
45 
46  private:
47  float band_width_;
48  unsigned int max_length_;
49  std::vector<glm::vec3> vertices_v_;
50  // Current band head's left and right position in world frame.
53 };
54 } // namespace tango_gl
55 #endif // TANGO_GL_BAND_H_
Band(const unsigned int max_legnth)
Definition: band.cpp:25
void SetVertexArray(const std::vector< glm::vec3 > &v, const glm::vec3 &up)
Definition: band.cpp:104
void SetWidth(const float width)
Definition: band.cpp:33
void Render(const glm::mat4 &projection_mat, const glm::mat4 &view_mat) const
Definition: band.cpp:132
glm::vec3 pivot_left
Definition: band.h:51
float band_width_
Definition: band.h:47
void ClearVertexArray()
Definition: band.cpp:130
unsigned int max_length_
Definition: band.h:48
void UpdateVertexArray(const glm::mat4 m, BandMode mode)
Definition: band.cpp:37
glm::vec3 pivot_right
Definition: band.h:52
std::vector< glm::vec3 > vertices_v_
Definition: band.h:49


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:41:30