9 #ifndef opengl_COpenGLStandardObject_H
10 #define opengl_COpenGLStandardObject_H
44 std::vector<_GLENUM> enabled;
51 virtual
void render_dl() const;
63 static COpenGLStandardObjectPtr Create(_GLENUM
t,const
std::vector<
TPoint3D> &v,uint32_t
cs=0,const
std::vector<_GLENUM> &en=
std::vector<_GLENUM>());
68 inline
void enable(_GLENUM flag) {
69 if (find(enabled.begin(),enabled.end(),flag)==enabled.end()) enabled.push_back(flag);
76 std::remove(enabled.begin(),enabled.end(),flag);
83 return find(enabled.begin(),enabled.end(),flag)!=enabled.end();
94 inline void setFlags(
const std::vector<_GLENUM> &v) {
102 for (
size_t i=0;i<3;i++) normal[i]=n[i];
109 for (
size_t i=0;i<3;i++) n[i]=normal[i];
115 COpenGLStandardObject(_GLENUM
t,
const std::vector<TPoint3D> &v,uint32_t
cs,
const vector<_GLENUM> &en):type(t),vertices(v),chunkSize(cs),enabled(en) {
116 for (
size_t i=0;i<3;i++) normal[i]=0.0;
122 for (
size_t i=0;i<3;i++) normal[i]=0.0;
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
void setFlags(const std::vector< _GLENUM > &v)
Set the list of all openGL flags.
EIGEN_STRONG_INLINE const AdjointReturnType t() const
Transpose.
COpenGLStandardObject()
Baic empty constructor, initializes to default.
void getNormal(float(&n)[3]) const
Gets the normal vector to this object.
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
virtual ~COpenGLStandardObject()
Destructor.
A renderizable object suitable for rendering with OpenGL's display lists.
This base provides a set of functions for maths stuff.
void disable(_GLENUM flag)
Disable some openGL flag.
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
void setNormal(const float(&n)[3])
Set the normal vector to this object.
COpenGLStandardObject(_GLENUM t, const std::vector< TPoint3D > &v, uint32_t cs, const vector< _GLENUM > &en)
Constructor with all the information.
bool BASE_IMPEXP traceRay(const vector< TPolygonWithPlane > &vec, const mrpt::poses::CPose3D &pose, double &dist)
Fast ray tracing method using polygons' properties.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
bool isEnabled(_GLENUM flag) const
Check whether an openGL will be enabled during the rendering of this object.
void getEnabledFlags(std::vector< _GLENUM > &v) const
Get a list of all currently enabled openGL flags.
Objects of this class represent a generic openGL object without specific geometric properties...
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)