35#ifndef VP_OBJECT_CENTRIC_RENDERER_H
36#define VP_OBJECT_CENTRIC_RENDERER_H
38#include <visp3/core/vpConfig.h>
40#if defined(VISP_HAVE_PANDA3D)
42#include <visp3/core/vpMeterPixelConversion.h>
43#include <visp3/ar/vpPanda3DRendererSet.h>
44#include <visp3/core/vpRect.h>
73 m_focusedObject = focused;
74 m_shouldComputeBBPoints =
true;
79 void computeBoundingBox3DPoints();
80 void computeClipping(
float &nearV,
float &farV);
84 if (m_shouldComputeBBPoints) {
86 m_shouldComputeBBPoints =
false;
93 if (m_shouldComputeBBPoints) {
95 m_shouldComputeBBPoints =
false;
97 for (
unsigned int i = 0; i < 3; ++i) {
98 minValues[i] = std::numeric_limits<double>::max();
99 maxValues[i] = std::numeric_limits<double>::min();
103 for (
unsigned int i = 0; i < 3; ++i) {
104 if (point[i] < minValues[i]) {
105 minValues[i] = point[i];
107 if (point[i] > maxValues[i]) {
108 maxValues[i] = point[i];
116 vpRect computeBoundingBox();
118 template <
typename T>
127 const unsigned top =
static_cast<unsigned int>(std::max(0.0, m_bb.getTop()));
128 const unsigned left =
static_cast<unsigned int>(std::max(0.0, m_bb.getLeft()));
129 const unsigned bottom =
static_cast<unsigned int>(std::min(
static_cast<double>(h), m_bb.getBottom()));
130 const unsigned right =
static_cast<unsigned int>(std::min(
static_cast<double>(w), m_bb.getRight()));
132 target.
resize(h, w, clearValue);
133 for (
unsigned int i = top; i < bottom; ++i) {
134 memcpy(target.
bitmap + i * w + left, render[i - top], (right - left) *
sizeof(T));
145 std::string m_focusedObject;
147 std::vector<vpColVector> m_bb3DPoints;
148 bool m_shouldComputeBBPoints;
Implementation of column vector and the associated operations.
Definition of the vpImage class member functions.
void resize(unsigned int h, unsigned int w)
resize the image : Image initialization
Type * bitmap
points toward the bitmap
vpRect getBoundingBox() const
std::vector< vpColVector > getBoundingBox3D()
vpObjectCentricRenderer(const vpPanda3DRenderParameters &renderParameters)
virtual void setRenderParameters(const vpPanda3DRenderParameters ¶ms) VP_OVERRIDE
Set new rendering parameters. If the scene has already been initialized, the renderer camera is updat...
void get3DExtents(vpTranslationVector &minValues, vpTranslationVector &maxValues)
void computeBoundingBox3DPoints()
void setFocusedObject(const std::string &focused)
void placeRenderInto(const vpImage< T > &render, vpImage< T > &target, const T &clearValue)
vpPanda3DRenderParameters m_renderParameters
Pointer to owning window, which can create buffers etc. It is not necessarily visible.
Rendering parameters for a panda3D simulation.
virtual void setRenderParameters(const vpPanda3DRenderParameters ¶ms) VP_OVERRIDE
Set new rendering parameters. If the scene has already been initialized, the renderer camera is updat...
virtual void beforeFrameRendered() VP_OVERRIDE
Defines a rectangle in the plane.
Class that consider the case of a translation vector.