28 float xmin,
float ymin,
float zmin,
29 float xmax,
float ymax,
float zmax,
30 float frecuency ,
float lineWidth ,
bool marks) :
31 m_xmin(xmin),m_ymin(ymin),m_zmin(zmin),
32 m_xmax(xmax),m_ymax(ymax),m_zmax(
zmax),
33 m_frequency(frecuency),
34 m_lineWidth(lineWidth),
37 for (
int i=0;i<3;i++) m_marks[i] = marks;
40 m_textRot[0][0] = 180.f; m_textRot[0][1] = 0.f; m_textRot[0][2] = 90.f;
42 m_textRot[1][0] = 90.f; m_textRot[1][1] = 0.f; m_textRot[1][2] = 90.f;
44 m_textRot[2][0] = 180.f; m_textRot[2][1] = 0.f; m_textRot[2][2] = 90.f;
49 float xmin,
float ymin,
float zmin,
50 float xmax,
float ymax,
float zmax,
51 float frecuency,
float lineWidth,
bool marks)
53 return CAxisPtr(
new CAxis( xmin,ymin, zmin, xmax,ymax,
zmax,frecuency,lineWidth,marks ) );
58 #if MRPT_HAS_OPENGL_GLUT 72 glColor4ub(m_color.R,m_color.G,m_color.B,m_color.A);
99 for (
float i = m_xmin ; i<= m_xmax ; i = i + m_frequency)
125 for (
float i = m_ymin ; i<= m_ymax ; i = i + m_frequency)
127 if (std::abs(i)>1e-4)
154 for (
float i = m_zmin ; i<= m_zmax ; i = i + m_frequency)
156 if (std::abs(i)>1e-4)
195 writeToStreamRender(out);
196 out << m_xmin << m_ymin << m_zmin;
197 out << m_xmax << m_ymax << m_zmax;
198 out << m_frequency << m_lineWidth;
200 out << m_marks[0] << m_marks[1] << m_marks[2] << m_textScale;
201 for (
int i=0;i<3;i++)
for (
int j=0;j<3;j++) out << m_textRot[i][j];
216 readFromStreamRender(
in);
217 in >> m_xmin >> m_ymin >> m_zmin;
218 in >> m_xmax >> m_ymax >> m_zmax;
219 in >> m_frequency >> m_lineWidth;
222 in >> m_marks[0] >> m_marks[1] >> m_marks[2] >> m_textScale;
223 for (
int i=0;i<3;i++) for (int j=0;j<3;j++) in >> m_textRot[i][j];
228 for (
int i=0;i<3;i++) m_marks[i] =
v;
250 m_pose.composePoint(bb_min, bb_min);
251 m_pose.composePoint(bb_max, bb_max);
273 for (
int i=0;i<3;i++) m_marks[i]=
v;
294 m_xmin=xmin; m_ymin=ymin; m_zmin=zmin;
295 m_xmax=xmax; m_ymax=ymax; m_zmax=
zmax;
301 m_textRot[axis][0]=yaw_deg;
302 m_textRot[axis][1]=pitch_deg;
303 m_textRot[axis][2]=roll_deg;
308 yaw_deg = m_textRot[axis][0];
309 pitch_deg = m_textRot[axis][1];
310 roll_deg = m_textRot[axis][2];
float getFrequency() const
mrpt::utils::TPixelCoordf OPENGL_IMPEXP glDrawText(const std::string &text, const double textScale, enum TOpenGLFontStyle style=NICE, double spacing=1.5, double kerning=0.1)
renders a string in GL using the current settings.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
GLAPI void GLAPIENTRY glEnable(GLenum cap)
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
GLAPI void GLAPIENTRY glPopMatrix(void)
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
#define GL_ONE_MINUS_SRC_ALPHA
double z
X,Y,Z coordinates.
IMPLEMENTS_SERIALIZABLE(CLogFileRecord_FullEval, CHolonomicLogFileRecord, mrpt::nav) IMPLEMENTS_SERIALIZABLE(CHolonomicFullEval
GLAPI void GLAPIENTRY glLineWidth(GLfloat width)
GLubyte GLubyte GLubyte GLubyte w
GLAPI void GLAPIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor)
A renderizable object suitable for rendering with OpenGL's display lists.
float getTextScale() const
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
void enableTickMarks(bool v=true)
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void setLineWidth(float w)
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const MRPT_OVERRIDE
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
GLAPI void GLAPIENTRY glBegin(GLenum mode)
void getTextLabelOrientation(int axis, float &yaw_deg, float &pitch_deg, float &roll_deg) const
axis: {0,1,2}=>{X,Y,Z}
GLAPI void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z)
GLAPI void GLAPIENTRY glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
void render_dl() const MRPT_OVERRIDE
Render.
GLAPI void GLAPIENTRY glTranslatef(GLfloat x, GLfloat y, GLfloat z)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void setTextLabelOrientation(int axis, float yaw_deg, float pitch_deg, float roll_deg)
axis: {0,1,2}=>{X,Y,Z}
float getLineWidth() const
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
void OPENGL_IMPEXP checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
Draw a 3D world axis, with coordinate marks at some regular interval.
renders glyphs filled with antialiased outlines
void setFrequency(float f)
Changes the frequency of the "ticks".
The namespace for 3D scene representation and rendering.
GLAPI void GLAPIENTRY glEnd(void)
GLAPI void GLAPIENTRY glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
int BASE_IMPEXP sprintf(char *buf, size_t bufSize, const char *format,...) MRPT_NO_THROWS MRPT_printf_format_check(3
An OS-independent version of sprintf (Notice the bufSize param, which may be ignored in some compiler...
GLAPI void GLAPIENTRY glPushMatrix(void)
void setAxisLimits(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
renders glyphs as filled polygons
GLAPI void GLAPIENTRY glDisable(GLenum cap)
void setTextScale(float f)
Changes the size of text labels (default:0.25)