61 writeToStreamRender(out);
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();
129 ASSERTMSG_(newObject.pointer() !=
this,
"Error: Trying to insert container into itself!");
130 m_objects.push_back(newObject);
144 string s( (*it)->GetRuntimeClass()->className );
145 if ((*it)->m_name.size())
146 s+=
string(
" (") +(*it)->m_name +
string(
")");
155 for (
size_t i=0;i<auxLst.
size();i++)
156 lst.
add(
string(
" ")+auxLst(i) );
167 if (it->pointer() ==
obj.pointer())
173 getAs<CSetOfObjects>(*it)->removeObject(
obj);
184 }
else if (tmp<dist) dist=tmp;
193 p->setColor_u8(
r,
g,
b,
a);
200 for_each(m_objects.begin(),m_objects.end(),
FSetColor(m_color.R=
c.R,m_color.G=
c.G,m_color.B=
c.B,m_color.A=
c.A));
206 return find(m_objects.begin(),m_objects.end(),
obj)!=m_objects.end();
237 if ((*it)->m_name == str)
241 CRenderizablePtr ret = getAs<CSetOfObjects>(*it)->getByName(str);
246 return CRenderizablePtr();
253 bb_min =
TPoint3D( std::numeric_limits<double>::max(), std::numeric_limits<double>::max(), std::numeric_limits<double>::max() );
254 bb_max =
TPoint3D(-std::numeric_limits<double>::max(),-std::numeric_limits<double>::max(),-std::numeric_limits<double>::max() );
258 TPoint3D child_bbmin( std::numeric_limits<double>::max(), std::numeric_limits<double>::max(), std::numeric_limits<double>::max() );
259 TPoint3D child_bbmax(-std::numeric_limits<double>::max(),-std::numeric_limits<double>::max(),-std::numeric_limits<double>::max() );
260 (*it)->getBoundingBox(child_bbmin, child_bbmax);
272 m_pose.composePoint(bb_min, bb_min);
273 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.
The base class of 3D objects that can be directly rendered through OpenGL.
virtual CRenderizable & setColorA_u8(const uint8_t a) MRPT_OVERRIDE
Color components in the range [0,255].
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
double z
X,Y,Z coordinates.
virtual CRenderizable & setColor_u8(const mrpt::utils::TColor &c) MRPT_OVERRIDE
IMPLEMENTS_SERIALIZABLE(CLogFileRecord_FullEval, CHolonomicLogFileRecord, mrpt::nav) IMPLEMENTS_SERIALIZABLE(CHolonomicFullEval
GLsizei GLsizei GLuint * obj
void clear()
Clear the contents of this container.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
#define IS_DERIVED(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is an i...
virtual CRenderizable & setColorB_u8(const uint8_t b) MRPT_OVERRIDE
Color components in the range [0,255].
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 & 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.
bool contains(const CRenderizablePtr &obj) const
void render() const MRPT_OVERRIDE
Render child objects.
virtual CRenderizable & setColorG_u8(const uint8_t g) MRPT_OVERRIDE
Color components in the range [0,255].
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...
void insert(const CRenderizablePtr &newObject)
Insert a new object to the list.
size_t size() const
Returns the number of text lines in the list.
#define CLASS_ID_NAMESPACE(class_name, namespaceName)
Access to runtime class ID for a defined class name.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void removeObject(const CRenderizablePtr &obj)
Removes the given object from the scene (it also deletes the object to free its memory).
virtual CRenderizable & setColorR_u8(const uint8_t r) MRPT_OVERRIDE
Color components in the range [0,255].
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).
virtual bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const MRPT_OVERRIDE
Simulation of ray-trace, given a pose.
#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.
CRenderizablePtr getByName(const std::string &str)
Returns the first object with a given name, or a NULL pointer if not found.
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...
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 OPENGL_IMPEXP renderSetOfObjects(const mrpt::opengl::CListOpenGLObjects &objs)
For each object in the list:
unsigned __int32 uint32_t
virtual 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...
#define ASSERTMSG_(f, __ERROR_MSG)
GLubyte GLubyte GLubyte a
void operator()(CRenderizablePtr &p)
void add(const std::string &str)
Appends a new string at the end of the string list.