31 #include <visp3/ar/vpPanda3DRendererSet.h>
33 #if defined(VISP_HAVE_PANDA3D)
35 #include "load_prc_file.h"
40 load_prc_file_data(
"",
"textures-power-2 none");
41 load_prc_file_data(
"",
"gl-version 3 2");
42 load_prc_file_data(
"",
"no-singular-invert");
48 load_prc_file_data(
"",
"textures-power-2 none");
49 load_prc_file_data(
"",
"gl-version 3 2");
50 load_prc_file_data(
"",
"no-singular-invert");
62 WindowProperties winProps;
64 int flags = GraphicsPipe::BF_refuse_window;
67 winProps.set_minimized(
true);
74 m_window->set_background_type(WindowFramework::BackgroundType::BT_black);
75 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
76 renderer->initFromParent(*
this);
83 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
91 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
98 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
99 if (renderer->isRendering3DScene()) {
100 renderer->setCameraPose(wTc);
118 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
119 if (renderer->isRendering3DScene()) {
120 renderer->setNodePose(name, wTo);
148 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
149 if (renderer->isRendering3DScene()) {
150 renderer->addNodeToScene(
object);
158 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
165 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
167 if (lightable !=
nullptr) {
175 for (std::shared_ptr<vpPanda3DBaseRenderer> &otherRenderer:
m_subRenderers) {
176 if (renderer->getName() == otherRenderer->getName()) {
180 std::vector<std::shared_ptr<vpPanda3DBaseRenderer>>::const_iterator it =
m_subRenderers.begin();
182 if ((*it)->getRenderOrder() > renderer->getRenderOrder()) {
198 for (std::shared_ptr<vpPanda3DBaseRenderer> &subRenderer:
m_subRenderers) {
199 if (subRenderer.get() != &sourceBuffer) {
200 subRenderer->enableSharedDepthBuffer(sourceBuffer);
207 #elif !defined(VISP_BUILD_SHARED_LIBS)
209 void dummy_vpPanda3DRendererSet() { };
error that can be emitted by ViSP classes.
@ badValue
Used to indicate that a value is not in the allowed range.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Base class for a panda3D renderer. This class handles basic functionalities, such as loading object,...
static bool frameworkIsOpen
Panda Rendering framework.
virtual bool isRendering3DScene() const
Returns true if this renderer process 3D data and its scene root can be interacted with.
static PandaFramework framework
Inverse of VISP_T_PANDA.
bool m_isWindowOwner
Set of buffers that this renderer uses. This storage contains weak refs to those buffers and should n...
PointerTo< WindowFramework > m_window
Rendering priority for this renderer and its buffers. A lower value will be rendered first....
virtual void initFromParent(PointerTo< WindowFramework > window)
vpPanda3DRenderParameters m_renderParameters
Pointer to owning window, which can create buffers etc. It is not necessarily visible.
Base class for a Light that can be added to a Panda3D scene.
Interface for objects, scenes or other Panda3D related data that can be lit by a vpPanda3DLight.
virtual void addLight(const vpPanda3DLight &light)=0
Light this lightable object with a new light.
Rendering parameters for a panda3D simulation.
unsigned int getImageWidth() const
unsigned int getImageHeight() const
void initFromParent(PointerTo< WindowFramework > window) VP_OVERRIDE
void addNodeToScene(const NodePath &object) VP_OVERRIDE
void initFramework() VP_OVERRIDE
Initialize the framework and propagate the created panda3D framework to the subrenderers.
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 addSubRenderer(std::shared_ptr< vpPanda3DBaseRenderer > renderer)
Add a new subrenderer: This subrenderer should have a unique name, not present in the set.
std::vector< std::shared_ptr< vpPanda3DBaseRenderer > > m_subRenderers
void enableSharedDepthBuffer(vpPanda3DBaseRenderer &sourceBuffer) VP_OVERRIDE
vpHomogeneousMatrix getCameraPose() VP_OVERRIDE
Retrieve the pose of the camera. As this renderer contains multiple other renderers.
vpHomogeneousMatrix getNodePose(const std::string &name) VP_OVERRIDE
Retrieve the pose of a scene node. The pose is in the world frame, using a ViSP convention.
void setNodePose(const std::string &name, const vpHomogeneousMatrix &wTo) VP_OVERRIDE
Set the pose of an object for all the subrenderers. The pose is specified using the ViSP convention T...
void addLight(const vpPanda3DLight &light) VP_OVERRIDE
Light this lightable object with a new light.
void setCameraPose(const vpHomogeneousMatrix &wTc) VP_OVERRIDE
Set the pose of the camera, using the ViSP convention. This change is propagated to all subrenderers.