Arrow.hpp
Go to the documentation of this file.
1 
28  /*
29  * PointCloud.h
30  *
31  * Created on: 02.09.2008
32  * Author: twiemann
33  */
34 
35 #ifndef ARROW_H_
36 #define ARROW_H_
37 
39 
41 
42 #include <vector>
43 #include <string>
44 #include <fstream>
45 #include <stdio.h>
46 #include <stdlib.h>
47 
48 
49 using namespace std;
50 
51 namespace lvr2
52 {
53 
54 class Arrow : public Renderable{
55 public:
56  Arrow(string filename);
57  Arrow(int color);
58  virtual ~Arrow();
59  virtual inline void render();
60 
61  void setPosition(double x, double y, double z, double roll, double pitch, double yaw);
62 
63  inline void setColor(int color) {
64  this->color = color;
65  };
66 
67 private:
68  double roll, pitch, yaw;
69  int color;
71 };
72 
73 
74 
75 
76 inline void EulerToMatrix(const double *rPos, const double *rPosTheta, float *alignxf)
77 {
78  double sx = sin(rPosTheta[0]);
79  double cx = cos(rPosTheta[0]);
80  double sy = sin(rPosTheta[1]);
81  double cy = cos(rPosTheta[1]);
82  double sz = sin(rPosTheta[2]);
83  double cz = cos(rPosTheta[2]);
84 
85  alignxf[0] = cy*cz;
86  alignxf[1] = sx*sy*cz + cx*sz;
87  alignxf[2] = -cx*sy*cz + sx*sz;
88  alignxf[3] = 0.0;
89  alignxf[4] = -cy*sz;
90  alignxf[5] = -sx*sy*sz + cx*cz;
91  alignxf[6] = cx*sy*sz + sx*cz;
92  alignxf[7] = 0.0;
93  alignxf[8] = sy;
94  alignxf[9] = -sx*cy;
95  alignxf[10] = cx*cy;
96 
97  alignxf[11] = 0.0;
98 
99  alignxf[12] = rPos[0];
100  alignxf[13] = rPos[1];
101  alignxf[14] = rPos[2];
102  alignxf[15] = 1;
103 };
104 
105 } // namespace lvr2
106 
107 // @TODO Why do we need this?
108 void render();
109 
110 #endif /* Arrow_H_ */
void EulerToMatrix(const double *rPos, const double *rPosTheta, float *alignxf)
Definition: Arrow.hpp:76
void render()
void setColor(int color)
Definition: Arrow.hpp:63
A 4x4 matrix class implementation for use with the provided vertex types.
Definition: Matrix4.hpp:64
Matrix4< BaseVector< float > > rotation
Definition: Arrow.hpp:70
int color
Definition: Arrow.hpp:69
double yaw
Definition: Arrow.hpp:65


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:06