MRPT  1.9.9
COpenGLViewport.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
12 #include <mrpt/img/CImage.h>
13 #include <mrpt/opengl/CCamera.h>
14 #include <mrpt/opengl/CLight.h>
19 #include <mrpt/system/mrptEvent.h>
20 
21 namespace mrpt
22 {
23 namespace img
24 {
25 class CImage;
26 }
27 namespace opengl
28 {
29 /** A viewport within a COpenGLScene, containing a set of OpenGL objects to
30  *render.
31  * This class has protected constuctor, thus it cannot be created by users.
32  *Use COpenGLScene::createViewport instead.
33  * A viewport has these "operation modes":
34  * - Normal (default): It renders the contained objects.
35  * - Cloned: It clones the objects from another viewport. See \a
36  *setCloneView()
37  * - Image mode: It renders an image (e.g. from a video stream) efficiently
38  *using a textued quad. See \a setImageView().
39  *
40  * In any case, the viewport can be resized to only fit a part of the entire
41  *parent viewport.
42  * There will be always at least one viewport in a COpenGLScene named "main".
43  *
44  * This class can be observed (see mrpt::system::CObserver) for the following
45  *events (see mrpt::system::mrptEvent):
46  * - mrpt::opengl::mrptEventGLPreRender
47  * - mrpt::opengl::mrptEventGLPostRender
48  *
49  * Two directional light sources at infinity are created by default, with
50  *directions (-1,-1,-1) and (1,2,1), respectively.
51  * All OpenGL properties of light sources are accesible via the methods:
52  *setNumberOfLights(), lightsClearAll(), addLight(), and getLight().
53  * Please, refer to mrpt::opengl::CLight and the standard OpenGL documentation
54  *for the meaning of all light properties.
55  *
56  * Refer to mrpt::opengl::COpenGLScene for further details.
57  * \ingroup mrpt_opengl_grp
58  */
61 {
63  friend class COpenGLScene;
64 
65  public:
66  // -------------------------------------------------------------------
67  /** @name Set the viewport "modes"
68  @{ */
69 
70  /** Set this viewport as a clone of some other viewport, given its name - as
71  * a side effect, current list of internal OpenGL objects is cleared.
72  * By default, only the objects are cloned, not the camera. See
73  * \sa resetCloneView
74  */
75  void setCloneView(const std::string& clonedViewport);
76 
77  /** Set this viewport into "image view"-mode, where an image is efficiently
78  * drawn (fitting the viewport area) using an OpenGL textured quad.
79  * Call this method with the new image to update the displayed image (but
80  * recall to first lock the parent openglscene's critical section, then do
81  * the update, then release the lock, and then issue a window repaint).
82  * Internally, the texture is drawn using a mrpt::opengl::CTexturedPlane
83  * The viewport can be reverted to behave like a normal viewport by
84  * calling setNormalMode()
85  */
86  void setImageView(const mrpt::img::CImage& img);
87 
88  /** Just like \a setImageView but moves the internal image memory instead of
89  * making a copy, so it's faster but empties the input image.
90  * \sa setImageView
91  */
92  void setImageView(mrpt::img::CImage&& img);
93 
94  /** Reset the viewport to normal mode: rendering its own objects.
95  * \sa setCloneView, setNormalMode
96  */
97  inline void resetCloneView() { setNormalMode(); }
98  /** If set to true, and setCloneView() has been called, this viewport will
99  * be rendered using the camera of the cloned viewport.
100  */
101  inline void setCloneCamera(bool enable) { m_isClonedCamera = enable; }
102  /** Resets the viewport to a normal 3D viewport \sa setCloneView,
103  * setImageView */
104  void setNormalMode();
105 
106  /** @} */ // end of Set the "viewport mode"
107  // ------------------------------------------------------
108 
109  /** @name OpenGL global settings that affect rendering all objects in the
110  scene/viewport
111  @{ */
112 
113  /** Sets glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST) is enabled, or GL_FASTEST
114  * otherwise. */
115  void enablePolygonNicest(bool enable = true)
116  {
118  }
120  /** Removes all lights (and disables the global "GL_LIGHTING") */
121  void lightsClearAll() { m_lights.clear(); }
122  /** Append a new light to the scene. By default there are two lights.
123  * "GL_LIGHTING" is disabled if all lights are removed */
124  void addLight(const CLight& l) { m_lights.push_back(l); }
125  /** Allocates a number of lights, which must be correctly defined via
126  * getLight(i), etc. */
127  void setNumberOfLights(const size_t N) { m_lights.resize(N); }
128  CLight& getLight(const size_t i)
129  {
130  ASSERT_BELOW_(i, m_lights.size());
131  return m_lights[i];
132  }
133  const CLight& getLight(const size_t i) const
134  {
135  ASSERT_BELOW_(i, m_lights.size());
136  return m_lights[i];
137  }
138 
139  /** @} */ // end of OpenGL settings
140 
141  // -------------------------------------------------------------------
142  /** @name Change or read viewport properties (except "viewport modes")
143  @{ */
144 
145  /** Returns the name of the viewport */
146  inline std::string getName() { return m_name; }
147  /** Change the viewport position and dimension on the rendering window.
148  * X & Y coordinates here can have two interpretations:
149  * - If in the range [0,1], they are factors with respect to the actual
150  *window sizes (i.e. width=1 means the entire width of the rendering
151  *window).
152  * - If >1, they are interpreted as pixels.
153  *
154  * width & height can be interpreted as:
155  * - If >1, they are the size of the viewport in that dimension, in
156  *pixels.
157  * - If in [0,1], they are the size of the viewport in that dimension,
158  *in
159  *a factor of the width/height.
160  * - If in [-1,0[, the size is computed such as the right/top border
161  *ends
162  *up in the given coordinate, interpreted as a factor (e.g. -1: up to the
163  *end of the viewport, -0.5: up to the middle of it).
164  * - If <-1 the size is computed such as the right/top border ends up
165  *in
166  *the given absolute coordinate (e.g. -200: up to the row/column 200px).
167  *
168  * \note (x,y) specify the lower left corner of the viewport rectangle.
169  * \sa getViewportPosition
170  */
171  void setViewportPosition(
172  const double x, const double y, const double width,
173  const double height);
174 
175  /** Get the current viewport position and dimension on the rendering window.
176  * X & Y coordinates here can have two interpretations:
177  * - If in the range [0,1], they are factors with respect to the actual
178  * window sizes (i.e. width=1 means the entire width of the rendering
179  * window).
180  * - If >1, they are interpreted as pixels.
181  * \note (x,y) specify the lower left corner of the viewport rectangle.
182  * \sa setViewportPosition
183  */
184  void getViewportPosition(
185  double& x, double& y, double& width, double& height);
186 
187  /** Set the min/max clip depth distances of the rendering frustum (default:
188  * 0.1 - 10000)
189  * \sa getViewportClipDistances
190  */
191  void setViewportClipDistances(const double clip_min, const double clip_max);
192 
193  /** Get the current min/max clip depth distances of the rendering frustum
194  * (default: 0.1 - 10000)
195  * \sa setViewportClipDistances
196  */
197  void getViewportClipDistances(double& clip_min, double& clip_max) const;
198 
199  /** Set the border size ("frame") of the viewport (default=0).
200  */
201  inline void setBorderSize(unsigned int lineWidth)
202  {
203  m_borderWidth = lineWidth;
204  }
205 
206  /** Return whether the viewport will be rendered transparent over previous
207  * viewports.
208  */
209  inline bool isTransparent() { return m_isTransparent; }
210  /** Set the transparency, that is, whether the viewport will be rendered
211  * transparent over previous viewports (default=false).
212  */
213  inline void setTransparent(bool trans) { m_isTransparent = trans; }
214  /** Set a background color different from that of the parent GUI window */
216  {
217  m_custom_backgb_color = true;
219  }
220 
222  {
223  return m_background_color;
224  }
225 
226  /** Compute the 3D ray corresponding to a given pixel; this can be used to
227  * allow the user to pick and select 3D objects by clicking onto the 2D
228  * image.
229  * \param x_coord Horizontal coordinate with the usual meaning (0:left of
230  * the viewport, W-1: right border).
231  * \param y_coord Horizontal coordinate with the usual meaning (0:top of
232  * the viewport, H-1: right border).
233  * \param out_cameraPose If not nullptr, will have the camera 3D pose as a
234  * mrpt::poses::CPose3D. See also
235  * \note (x,y) refer to VIEWPORT coordinates. Take into account this when
236  * viewports do not extend to the whole window size.
237  * \note x and y are double instead of integers to allow sub-pixel
238  * precision.
239  * \sa getCurrentCameraPose
240  */
242  const double x_coord, const double y_coord,
243  mrpt::math::TLine3D& out_ray,
244  mrpt::poses::CPose3D* out_cameraPose = nullptr) const;
245 
246  /** @} */ // end of Change or read viewport properties
247  // ------------------------------------------------------
248 
249  // -------------------------------------------------------------------
250  /** @name Contained objects set/get/search
251  @{ */
252 
253  using const_iterator = CListOpenGLObjects::const_iterator;
254  using iterator = CListOpenGLObjects::iterator;
255 
256  inline const_iterator begin() const { return m_objects.begin(); }
257  inline const_iterator end() const { return m_objects.end(); }
258  inline iterator begin() { return m_objects.begin(); }
259  inline iterator end() { return m_objects.end(); }
260  /** Delete all internal obejcts
261  * \sa insert */
262  void clear();
263 
264  /** Insert a new object into the list.
265  * The object MUST NOT be deleted, it will be deleted automatically by
266  * this object when not required anymore.
267  */
268  void insert(const CRenderizable::Ptr& newObject);
269 
270  /** Compute the current 3D camera pose.
271  * \sa get3DRayForPixelCoord
272  */
273  void getCurrentCameraPose(mrpt::poses::CPose3D& out_cameraPose) const;
274 
275  /** Returns the first object with a given name, or nullptr if not found.
276  */
278 
279  /** Returns the i'th object of a given class (or of a descendant class), or
280  nullptr (an empty smart pointer) if not found.
281  * Example:
282  * \code
283  CSphere::Ptr obs = view.getByClass<CSphere>();
284  * \endcode
285  * By default (ith=0), the first observation is returned.
286  */
287  template <typename T>
288  typename T::Ptr getByClass(const size_t& ith = 0) const
289  {
290  MRPT_START
291  size_t foundCount = 0;
292  const auto* class_ID = &T::GetRuntimeClassIdStatic();
293  for (const auto& o : m_objects)
294  if (o && o->GetRuntimeClass()->derivedFrom(class_ID))
295  if (foundCount++ == ith) return std::dynamic_pointer_cast<T>(o);
296 
297  // If not found directly, search recursively:
298  for (const auto& o : m_objects)
299  {
300  if (o && o->GetRuntimeClass() ==
302  {
303  typename T::Ptr obj = std::dynamic_pointer_cast<T>(
304  std::dynamic_pointer_cast<CSetOfObjects>(o)
305  ->template getByClass<T>(ith));
306  if (obj) return obj;
307  }
308  }
309  return typename T::Ptr(); // Not found: return empty smart pointer
310  MRPT_END
311  }
312 
313  /** Removes the given object from the scene (it also deletes the object to
314  * free its memory).
315  */
316  void removeObject(const CRenderizable::Ptr& obj);
317 
318  /** Number of objects contained. */
319  inline size_t size() const { return m_objects.size(); }
320  inline bool empty() const { return m_objects.empty(); }
321  /** Get a reference to the camera associated with this viewport. */
323  /** Get a reference to the camera associated with this viewport. */
324  const opengl::CCamera& getCamera() const { return m_camera; }
325  /** Evaluates the bounding box of this object (including possible children)
326  * in the coordinate frame of the object parent. */
327  void getBoundingBox(
329 
330  /** @} */ // end of Contained objects set/get/search
331  // ------------------------------------------------------
332 
333  /** Destructor: clears all objects. */
334  ~COpenGLViewport() override;
335 
336  /** Constructor, invoked from COpenGLScene only.
337  */
339  COpenGLScene* parent = nullptr,
340  const std::string& name = std::string(""));
341 
342  protected:
343  /** Initializes all textures in the scene (See
344  * opengl::CTexturedPlane::loadTextureInOpenGL)
345  */
346  void initializeAllTextures();
347 
348  /** Retrieves a list of all objects in text form.
349  */
350  void dumpListOfObjects(std::vector<std::string>& lst);
351 
352  /** Render the objects in this viewport (called from COpenGLScene only) */
353  void render(const int render_width, const int render_height) const;
354 
355  /** The camera associated to the viewport */
357  /** The scene that contains this viewport. */
359  /** Set by setCloneView */
360  bool m_isCloned{false};
361  /** Set by setCloneCamera */
362  bool m_isClonedCamera{false};
363  /** Only if m_isCloned=true */
365  /** The viewport's name */
367  /** Whether to clear color buffer. */
368  bool m_isTransparent{false};
369  /** Default=0, the border around the viewport. */
370  uint32_t m_borderWidth{0};
371  /** The viewport position [0,1] */
373  /** The min/max clip depth distances (default: 0.1 - 10000) */
374  double m_clip_min{0.1}, m_clip_max{10000};
376  /** used only if m_custom_backgb_color */
378  /** Set by setImageView */
379  bool m_isImageView{false};
380  // CRenderizable::Ptr m_imageview_quad ; //!< A mrpt::opengl::CTexturedPlane
381  // used after setImageView() is called
382  /** The image to display, after calling \a setImageView() */
384 
386  {
388  : eye(0, 0, 0), pointing(0, 0, 0), up(0, 0, 0)
389 
390  {
391  }
392  /** The camera is here. */
394  /** The camera points to here */
396  /** Up vector of the camera. */
398  /** In pixels. This may be smaller than the total render window. */
399  size_t viewport_width{640}, viewport_height{480};
400  /** FOV in degrees. */
401  float FOV{30};
402  /** Camera elev & azimuth, in radians. */
403  float azimuth{0}, elev{0};
404  float zoom{1};
405  bool is_projective{true}; // true: projective, false: ortho
406  };
407  /** Info updated with each "render()" and used in "get3DRayForPixelCoord" */
409 
410  /** The list of objects that comprise the 3D scene.
411  * Objects are automatically deleted when calling "clear" or in the
412  * destructor.
413  */
415 
417 
418  // OpenGL global settings:
420 
421  std::vector<CLight> m_lights;
422 };
423 /**
424  * Inserts an openGL object into a viewport. Allows call chaining.
425  * \sa mrpt::opengl::COpenGLViewport::insert
426  */
429 {
430  s->insert(r);
431  return s;
432 }
433 /**
434  * Inserts any iterable set of openGL objects into a viewport. Allows call
435  * chaining.
436  * \sa mrpt::opengl::COpenGLViewport::insert
437  */
439  COpenGLViewport::Ptr& s, const std::vector<CRenderizable::Ptr>& v)
440 {
441  for (const auto& it : v) s->insert(it);
442  return s;
443 }
444 
445 /** @name Events emitted by COpenGLViewport
446  @{ */
447 
448 /** An event sent by an mrpt::opengl::COpenGLViewport just after clearing the
449  * viewport and setting the GL_PROJECTION matrix, and before calling the scene
450  * OpenGL drawing primitives.
451  *
452  * While handling this event you can call OpenGL glBegin(),glEnd(),gl*
453  * functions or those in mrpt::opengl::gl_utils to draw stuff *in the back* of
454  * the normal
455  * objects contained in the COpenGLScene.
456  *
457  * After processing this event, COpenGLViewport will change the OpenGL matrix
458  * mode into "GL_MODELVIEW" and load an identity matrix to continue
459  * rendering the scene objects as usual. Any change done to the GL_PROJECTION
460  * will have effects, so do a glPushMatrix()/glPopMatrix() if that is not your
461  * intention.
462  *
463  *
464  * IMPORTANTE NOTICE: Event handlers in your observer class will most likely
465  * be invoked from an internal GUI thread of MRPT,
466  * so all your code in the handler must be thread safe.
467  */
469 {
470  protected:
471  /** Just to allow this class to be polymorphic */
472  void do_nothing() override {}
473 
474  public:
477  {
478  }
480 }; // End of class def.
481 
482 /** An event sent by an mrpt::opengl::COpenGLViewport after calling the scene
483  * OpenGL drawing primitives and before doing a glSwapBuffers
484  *
485  * While handling this event you can call OpenGL glBegin(),glEnd(),gl*
486  * functions or those in mrpt::opengl::gl_utils to draw stuff *on the top* of
487  * the normal
488  * objects contained in the COpenGLScene.
489  *
490  * IMPORTANTE NOTICE: Event handlers in your observer class will most likely
491  * be invoked from an internal GUI thread of MRPT,
492  * so all your code in the handler must be thread safe.
493  */
495 {
496  protected:
497  /** Just to allow this class to be polymorphic */
498  void do_nothing() override {}
499 
500  public:
503  {
504  }
506 }; // End of class def.
507 
508 /** @} */
509 
510 } // namespace opengl
511 
512 } // namespace mrpt
opengl::CListOpenGLObjects m_objects
The list of objects that comprise the 3D scene.
void setBorderSize(unsigned int lineWidth)
Set the border size ("frame") of the viewport (default=0).
CRenderizable::Ptr getByName(const std::string &str)
Returns the first object with a given name, or nullptr if not found.
void get3DRayForPixelCoord(const double x_coord, const double y_coord, mrpt::math::TLine3D &out_ray, mrpt::poses::CPose3D *out_cameraPose=nullptr) const
Compute the 3D ray corresponding to a given pixel; this can be used to allow the user to pick and sel...
const COpenGLViewport *const source_viewport
const_iterator begin() const
#define MRPT_START
Definition: exceptions.h:241
bool m_isTransparent
Whether to clear color buffer.
opengl::CCamera & getCamera()
Get a reference to the camera associated with this viewport.
A set of object, which are referenced to the coordinates framework established in this object...
Definition: CSetOfObjects.h:26
uint32_t m_borderWidth
Default=0, the border around the viewport.
void setCloneView(const std::string &clonedViewport)
Set this viewport as a clone of some other viewport, given its name - as a side effect, current list of internal OpenGL objects is cleared.
mrpt::serialization::CArchive & operator<<(mrpt::serialization::CArchive &out, const mrpt::opengl::CLight &o)
Definition: CLight.cpp:122
mrptEventGLPostRender(const COpenGLViewport *obj)
#define ASSERT_BELOW_(__A, __B)
Definition: exceptions.h:149
float azimuth
Camera elev & azimuth, in radians.
The basic event type for the observer-observable pattern in MRPT.
Definition: mrptEvent.h:31
std::deque< CRenderizable::Ptr > CListOpenGLObjects
A list of objects pointers, automatically managing memory free at destructor, and managing copies cor...
void do_nothing() override
Just to allow this class to be polymorphic.
std::vector< CLight > m_lights
void getViewportClipDistances(double &clip_min, double &clip_max) const
Get the current min/max clip depth distances of the rendering frustum (default: 0.1 - 10000)
void setImageView(const mrpt::img::CImage &img)
Set this viewport into "image view"-mode, where an image is efficiently drawn (fitting the viewport a...
CLight & getLight(const size_t i)
void setViewportClipDistances(const double clip_min, const double clip_max)
Set the min/max clip depth distances of the rendering frustum (default: 0.1 - 10000) ...
void do_nothing() override
Just to allow this class to be polymorphic.
STL namespace.
mrpt::img::CImage::Ptr m_imageview_img
The image to display, after calling setImageView()
const opengl::CCamera & getCamera() const
Get a reference to the camera associated with this viewport.
CListOpenGLObjects::iterator iterator
mrpt::math::TPoint3D eye
The camera is here.
GLdouble s
Definition: glext.h:3682
GLsizei GLsizei GLuint * obj
Definition: glext.h:4085
const CLight & getLight(const size_t i) const
A viewport within a COpenGLScene, containing a set of OpenGL objects to render.
void setCloneCamera(bool enable)
If set to true, and setCloneView() has been called, this viewport will be rendered using the camera o...
mrpt::safe_ptr< COpenGLScene > m_parent
The scene that contains this viewport.
GLenum GLsizei width
Definition: glext.h:3535
Each of the possible lights of a 3D scene.
Definition: CLight.h:22
const COpenGLViewport *const source_viewport
bool m_isClonedCamera
Set by setCloneCamera.
double m_clip_min
The min/max clip depth distances (default: 0.1 - 10000)
GLuint color
Definition: glext.h:8459
mrpt::img::CImage CImage
Definition: utils/CImage.h:5
bool m_isImageView
Set by setImageView.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
void render(const int render_width, const int render_height) const
Render the objects in this viewport (called from COpenGLScene only)
GLint GLvoid * img
Definition: glext.h:3769
~COpenGLViewport() override
Destructor: clears all objects.
void resetCloneView()
Reset the viewport to normal mode: rendering its own objects.
void removeObject(const CRenderizable::Ptr &obj)
Removes the given object from the scene (it also deletes the object to free its memory).
const_iterator end() const
mrpt::math::TPoint3D up
Up vector of the camera.
TLastProjectiveMatrixInfo m_lastProjMat
Info updated with each "render()" and used in "get3DRayForPixelCoord".
void setNormalMode()
Resets the viewport to a normal 3D viewport.
Inherit from this class for those objects capable of being observed by a CObserver class...
Definition: CObservable.h:31
mrpt::img::TColorf getCustomBackgroundColor() const
A wrapper class for pointers that can be safely copied with "=" operator without problems.
Definition: safe_pointers.h:71
void getCurrentCameraPose(mrpt::poses::CPose3D &out_cameraPose) const
Compute the current 3D camera pose.
GLsizei const GLchar ** string
Definition: glext.h:4116
mrpt::math::TPoint3D pointing
The camera points to here.
void initializeAllTextures()
Initializes all textures in the scene (See opengl::CTexturedPlane::loadTextureInOpenGL) ...
size_t size() const
Number of objects contained.
CListOpenGLObjects::const_iterator const_iterator
mrptEventGLPreRender(const COpenGLViewport *obj)
#define CLASS_ID_NAMESPACE(class_name, namespaceName)
Definition: CObject.h:105
const GLdouble * v
Definition: glext.h:3684
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::shared_ptr< mrpt::img ::CImage > Ptr
Definition: img/CImage.h:149
void clear()
Delete all internal obejcts.
GLdouble GLdouble GLdouble r
Definition: glext.h:3711
An event sent by an mrpt::opengl::COpenGLViewport just after clearing the viewport and setting the GL...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
An event sent by an mrpt::opengl::COpenGLViewport after calling the scene OpenGL drawing primitives a...
void enablePolygonNicest(bool enable=true)
Sets glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST) is enabled, or GL_FASTEST otherwise.
#define MRPT_END
Definition: exceptions.h:245
A RGB color - floats in the range [0,1].
Definition: TColor.h:78
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
GLuint const GLchar * name
Definition: glext.h:4068
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives...
Definition: COpenGLScene.h:58
void setTransparent(bool trans)
Set the transparency, that is, whether the viewport will be rendered transparent over previous viewpo...
const auto bb_max
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:30
std::string m_clonedViewport
Only if m_isCloned=true.
void lightsClearAll()
Removes all lights (and disables the global "GL_LIGHTING")
std::string getName()
Returns the name of the viewport.
mrpt::img::TColorf m_background_color
used only if m_custom_backgb_color
void addLight(const CLight &l)
Append a new light to the scene.
GLenum GLint GLint y
Definition: glext.h:3542
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
T::Ptr getByClass(const size_t &ith=0) const
Returns the i&#39;th object of a given class (or of a descendant class), or nullptr (an empty smart point...
const auto bb_min
void setCustomBackgroundColor(const mrpt::img::TColorf &color)
Set a background color different from that of the parent GUI window.
GLenum GLint x
Definition: glext.h:3542
Lightweight 3D point.
Definition: TPoint3D.h:90
A camera: if added to a scene, the viewpoint defined by this camera will be used instead of the camer...
Definition: CCamera.h:27
GLenum GLsizei GLsizei height
Definition: glext.h:3558
bool isTransparent()
Return whether the viewport will be rendered transparent over previous viewports. ...
void setViewportPosition(const double x, const double y, const double width, const double height)
Change the viewport position and dimension on the rendering window.
void dumpListOfObjects(std::vector< std::string > &lst)
Retrieves a list of all objects in text form.
void getViewportPosition(double &x, double &y, double &width, double &height)
Get the current viewport position and dimension on the rendering window.
void insert(const CRenderizable::Ptr &newObject)
Insert a new object into the list.
double m_view_x
The viewport position [0,1].
opengl::CCamera m_camera
The camera associated to the viewport.
std::string m_name
The viewport&#39;s name.
COpenGLViewport(COpenGLScene *parent=nullptr, const std::string &name=std::string(""))
Constructor, invoked from COpenGLScene only.
bool m_isCloned
Set by setCloneView.
3D line, represented by a base point and a director vector.
Definition: TLine3D.h:19
void setNumberOfLights(const size_t N)
Allocates a number of lights, which must be correctly defined via getLight(i), etc.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 4363012a5 Tue Nov 19 10:55:26 2019 +0100 at mar nov 19 11:00:13 CET 2019