53 writeToStreamRender(out);
57 it != m_objects.end(); ++it)
72 readFromStreamRender(
in);
93 #if MRPT_HAS_OPENGL_GLUT 95 for (it = m_objects.begin(); it != m_objects.end(); ++it++)
98 dynamic_cast<CTexturedObject*>(it->get())->loadTextureInOpenGL();
100 dynamic_cast<CSetOfObjects*>(it->get())->initializeAllTextures();
110 newObject.get() !=
this,
111 "Error: Trying to insert container into itself!");
112 m_objects.push_back(newObject);
121 it != m_objects.end(); ++it)
124 string s((*it)->GetRuntimeClass()->className);
125 if ((*it)->m_name.size())
126 s +=
string(
" (") + (*it)->m_name +
string(
")");
129 if ((*it)->GetRuntimeClass() ==
134 std::vector<std::string> auxLst;
136 for (
size_t i = 0; i < auxLst.size(); i++)
137 lst.emplace_back(
string(
" ") + auxLst[i]);
148 it != m_objects.end(); ++it)
155 (*it)->GetRuntimeClass() ==
157 dynamic_cast<CSetOfObjects*>(it->get())->removeObject(
obj);
166 it != m_objects.end(); ++it)
167 if ((*it)->traceRay(nueva, tmp))
195 m_objects.begin(), m_objects.end(),
197 m_color.R =
c.R, m_color.G =
c.G, m_color.B =
c.B,
204 return find(m_objects.begin(), m_objects.end(),
obj) != m_objects.end();
210 it != m_objects.end(); ++it)
218 it != m_objects.end(); ++it)
226 it != m_objects.end(); ++it)
234 it != m_objects.end(); ++it)
245 it != m_objects.end(); ++it)
247 if ((*it)->m_name == str)
250 (*it)->GetRuntimeClass() ==
267 std::numeric_limits<double>::max(), std::numeric_limits<double>::max(),
268 std::numeric_limits<double>::max());
270 -std::numeric_limits<double>::max(),
271 -std::numeric_limits<double>::max(),
272 -std::numeric_limits<double>::max());
275 it != m_objects.end(); ++it)
278 std::numeric_limits<double>::max(),
279 std::numeric_limits<double>::max(),
280 std::numeric_limits<double>::max());
282 -std::numeric_limits<double>::max(),
283 -std::numeric_limits<double>::max(),
284 -std::numeric_limits<double>::max());
285 (*it)->getBoundingBox(child_bbmin, child_bbmax);
297 m_pose.composePoint(bb_min, bb_min);
298 m_pose.composePoint(bb_max, bb_max);
A base class for all OpenGL objects with loadable textures.
const_iterator find(const KEY &key) const
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].
void WriteAs(const TYPE_FROM_ACTUAL &value)
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...
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
virtual CRenderizable & setColorR_u8(const uint8_t r) override
Color components in the range [0,255].
GLsizei GLsizei GLuint * obj
virtual CRenderizable & setColorG_u8(const uint8_t g) override
Color components in the range [0,255].
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define IS_DERIVED(ptrObj, class_name)
Evaluates to true if a pointer to an object (derived from mrpt::rtti::CObject) is an instance of the ...
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].
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...
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].
double x
X,Y,Z coordinates.
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
GLsizei const GLchar ** string
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
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 base class for "archives": classes abstracting I/O streams.
GLdouble GLdouble GLdouble r
void dumpListOfObjects(std::vector< std::string > &lst)
Retrieves a list of all objects in text form.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::rtti::CObject) is of the give...
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 initializeAllTextures()
Initializes all textures in the scene (See opengl::CTexturedPlane::loadTextureInOpenGL) ...
void renderSetOfObjects(const mrpt::opengl::CListOpenGLObjects &objs)
For each object in the list:
virtual CRenderizable & setColor_u8(const mrpt::img::TColor &c) override
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.
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 clear()
Clear the contents of this container.
const Scalar * const_iterator
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...