31 #include <visp3/ar/vpPanda3DRendererSet.h>
33 #if defined(VISP_HAVE_PANDA3D)
35 #include "load_prc_file.h"
41 load_prc_file_data(
"",
"textures-power-2 none");
42 load_prc_file_data(
"",
"gl-version 3 2");
43 load_prc_file_data(
"",
"no-singular-invert");
51 m_framework = std::shared_ptr<PandaFramework>(
new PandaFramework());
54 WindowProperties winProps;
56 int flags = GraphicsPipe::BF_refuse_window;
59 winProps.set_minimized(
true);
66 m_window->set_background_type(WindowFramework::BackgroundType::BT_black);
67 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
75 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
83 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
90 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
91 if (renderer->isRendering3DScene()) {
92 renderer->setCameraPose(wTc);
110 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
111 if (renderer->isRendering3DScene()) {
112 renderer->setNodePose(name, wTo);
140 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
141 if (renderer->isRendering3DScene()) {
142 renderer->addNodeToScene(
object);
150 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
157 for (std::shared_ptr<vpPanda3DBaseRenderer> &renderer:
m_subRenderers) {
159 if (lightable !=
nullptr) {
167 for (std::shared_ptr<vpPanda3DBaseRenderer> &otherRenderer:
m_subRenderers) {
168 if (renderer->getName() == otherRenderer->getName()) {
172 std::vector<std::shared_ptr<vpPanda3DBaseRenderer>>::const_iterator it =
m_subRenderers.begin();
174 if ((*it)->getRenderOrder() > renderer->getRenderOrder()) {
190 for (std::shared_ptr<vpPanda3DBaseRenderer> &subRenderer:
m_subRenderers) {
191 if (subRenderer.get() != &sourceBuffer) {
192 subRenderer->enableSharedDepthBuffer(sourceBuffer);
197 #elif !defined(VISP_BUILD_SHARED_LIBS)
199 void dummy_vpPanda3DRendererSet() { };
error that can be emitted by ViSP classes.
@ badValue
Used to indicate that a value is not in the allowed range.
@ notImplementedError
Not implemented.
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,...
std::shared_ptr< PandaFramework > m_framework
Rendering priority for this renderer and its buffers. A lower value will be rendered first....
virtual bool isRendering3DScene() const
Returns true if this renderer process 3D data and its scene root can be interacted with.
virtual void initFromParent(std::shared_ptr< PandaFramework > framework, PointerTo< WindowFramework > window)
PointerTo< WindowFramework > m_window
Pointer to the active panda framework.
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
vpPanda3DRendererSet(const vpPanda3DRenderParameters &renderParameters)
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 initFromParent(std::shared_ptr< PandaFramework > framework, PointerTo< WindowFramework > window) VP_OVERRIDE
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.