61 writeToStreamRender(out);
67 it != m_objects.end(); ++it)
82 readFromStreamRender(
in);
103 #if MRPT_HAS_OPENGL_GLUT 105 for (it = m_objects.begin(); it != m_objects.end(); ++it++)
108 getAs<CTexturedObject>(*it)->loadTextureInOpenGL();
110 getAs<CSetOfObjects>(*it)->initializeAllTextures();
120 newObject.get() !=
this,
121 "Error: Trying to insert container into itself!");
122 m_objects.push_back(newObject);
131 it != m_objects.end(); ++it)
134 string s((*it)->GetRuntimeClass()->className);
135 if ((*it)->m_name.size())
136 s +=
string(
" (") + (*it)->m_name +
string(
")");
139 if ((*it)->GetRuntimeClass() ==
146 for (
size_t i = 0; i < auxLst.
size(); i++)
147 lst.
add(
string(
" ") + auxLst(i));
158 it != m_objects.end(); ++it)
165 (*it)->GetRuntimeClass() ==
167 getAs<CSetOfObjects>(*it)->removeObject(
obj);
176 it != m_objects.end(); ++it)
177 if ((*it)->traceRay(nueva, tmp))
196 :
r(
R),
g(G),
b(B),
a(A)
205 m_objects.begin(), m_objects.end(),
207 m_color.R =
c.R, m_color.G =
c.G, m_color.B =
c.B,
214 return find(m_objects.begin(), m_objects.end(),
obj) != m_objects.end();
220 it != m_objects.end(); ++it)
228 it != m_objects.end(); ++it)
236 it != m_objects.end(); ++it)
244 it != m_objects.end(); ++it)
255 it != m_objects.end(); ++it)
257 if ((*it)->m_name == str)
260 (*it)->GetRuntimeClass() ==
276 std::numeric_limits<double>::max(), std::numeric_limits<double>::max(),
277 std::numeric_limits<double>::max());
279 -std::numeric_limits<double>::max(),
280 -std::numeric_limits<double>::max(),
281 -std::numeric_limits<double>::max());
284 it != m_objects.end(); ++it)
287 std::numeric_limits<double>::max(),
288 std::numeric_limits<double>::max(),
289 std::numeric_limits<double>::max());
291 -std::numeric_limits<double>::max(),
292 -std::numeric_limits<double>::max(),
293 -std::numeric_limits<double>::max());
294 (*it)->getBoundingBox(child_bbmin, child_bbmax);
306 m_pose.composePoint(bb_min, bb_min);
307 m_pose.composePoint(bb_max, bb_max);
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
A base class for all OpenGL objects with loadable textures.
A set of object, which are referenced to the coordinates framework established in this object...
CSetOfObjects()
Default constructor.
virtual CRenderizable & setColorA_u8(const uint8_t a)
Color components in the range [0,255].
virtual ~CSetOfObjects()
Private, virtual destructor: only can be deleted from smart pointers.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
bool contains(const CRenderizable::Ptr &obj) const
void render() const override
Render child objects.
virtual bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Simulation of ray-trace, given a pose.
The base class of 3D objects that can be directly rendered through OpenGL.
std::shared_ptr< CRenderizable > Ptr
virtual CRenderizable & setColorR_u8(const uint8_t r)
Color components in the range [0,255].
const Scalar * const_iterator
const_iterator find(const KEY &key) const
virtual CRenderizable & setColorR_u8(const uint8_t r) override
Color components in the range [0,255].
GLsizei GLsizei GLuint * obj
void clear()
Clear the contents of this container.
virtual CRenderizable & setColorG_u8(const uint8_t g) override
Color components in the range [0,255].
#define IS_DERIVED(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is an i...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
A class for storing a list of text lines.
This base provides a set of functions for maths stuff.
virtual CRenderizable & setColorB_u8(const uint8_t b)
Color components in the range [0,255].
virtual CRenderizable & setColorA_u8(const uint8_t a) override
Color components in the range [0,255].
virtual CRenderizable & setColorG_u8(const uint8_t g)
Color components in the range [0,255].
void dumpListOfObjects(mrpt::utils::CStringList &lst)
Retrieves a list of all objects in text form.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
double x
X,Y,Z coordinates.
GLsizei const GLchar ** string
void keep_max(T &var, const K test_val)
If the second argument is above the first one, set the first argument to this higher value...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
size_t size() const
Returns the number of text lines in the list.
void removeObject(const CRenderizable::Ptr &obj)
Removes the given object from the scene (it also deletes the object to free its memory).
#define CLASS_ID_NAMESPACE(class_name, namespaceName)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
virtual CRenderizable & setColor_u8(const mrpt::utils::TColor &c) override
GLdouble GLdouble GLdouble r
void keep_min(T &var, const K test_val)
If the second argument is below the first one, set the first argument to this lower value...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is of t...
The namespace for 3D scene representation and rendering.
FSetColor(uint8_t R, uint8_t G, uint8_t B, uint8_t A)
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
void initializeAllTextures()
Initializes all textures in the scene (See opengl::CTexturedPlane::loadTextureInOpenGL) ...
void renderSetOfObjects(const mrpt::opengl::CListOpenGLObjects &objs)
For each object in the list:
unsigned __int32 uint32_t
CRenderizable::Ptr getByName(const std::string &str)
Returns the first object with a given name, or a nullptr pointer if not found.
#define ASSERTMSG_(f, __ERROR_MSG)
void insert(const CRenderizable::Ptr &newObject)
Insert a new object to the list.
GLubyte GLubyte GLubyte a
virtual CRenderizable & setColorB_u8(const uint8_t b) override
Color components in the range [0,255].
void operator()(CRenderizable::Ptr &p)
virtual void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
void add(const std::string &str)
Appends a new string at the end of the string list.