Skip to content

Commit

Permalink
Update vpPanda3DRendererSet class
Browse files Browse the repository at this point in the history
- introduce a default constructor
- update class main doc
  • Loading branch information
fspindle committed Nov 15, 2024
1 parent 8b4ed72 commit a5e6973
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
16 changes: 12 additions & 4 deletions modules/ar/include/visp3/ar/vpPanda3DRendererSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ BEGIN_VISP_NAMESPACE
/**
* \ingroup group_ar_renderer_panda3d
*
* @brief Class that rendering multiple datatypes, in a single pass. A RendererSet contains multiple subrenderers, all inheriting from vpPanda3DBaseRenderer.
* @brief Class that renders multiple datatypes, in a single pass.
* A renderer set contains multiple subrenderers, all inheriting from vpPanda3DBaseRenderer.
* The renderer set synchronizes all scene properties for the different subrenderers. This includes:
* * The camera properties (intrinsics, resolution) and extrinsics
* * The pose and properties of every object in the scene
Expand All @@ -53,13 +54,20 @@ BEGIN_VISP_NAMESPACE
* The overall usage workflow is the following:
* 1. Create vpPanda3DRendererSet instance
* 2. Create the subrenderers (e.g, vpPanda3DGeometryRenderer)
* 3. Add the subrenderers to the set with addSubRenderer
* 4. Call renderFrame() on the rendererSet. Each subrenderer now has its output computed and ready to be retrieved
* 5. Retrieve relevant outputs in ViSP format with something similar to `rendererSet.getRenderer<RendererType>("MyRendererName").getRender(I)` where RendererType is the relevant subclass of vpPanda3DBaseRenderer and "MyRendererName" its name (see vpPanda3DBaseRenderer::getName)
* 3. Add the subrenderers to the set with addSubRenderer()
* 4. Call renderFrame() on the renderer set. Each subrenderer now has its output computed and ready
* to be retrieved
* 5. Retrieve relevant outputs in ViSP format with something similar to
* \code
* rendererSet.getRenderer<RendererType>("MyRendererName").getRender(I)
* \endcode
* where `RendererType` is the relevant subclass of vpPanda3DBaseRenderer and `"MyRendererName"`
* its name (see vpPanda3DBaseRenderer::getName())
*/
class VISP_EXPORT vpPanda3DRendererSet : public vpPanda3DBaseRenderer, public vpPanda3DLightable
{
public:
vpPanda3DRendererSet();
vpPanda3DRendererSet(const vpPanda3DRenderParameters &renderParameters);

virtual ~vpPanda3DRendererSet() = default;
Expand Down
7 changes: 7 additions & 0 deletions modules/ar/src/panda3d-simulator/vpPanda3DRendererSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
#include "load_prc_file.h"

BEGIN_VISP_NAMESPACE
vpPanda3DRendererSet::vpPanda3DRendererSet() : vpPanda3DBaseRenderer("set")
{
load_prc_file_data("", "textures-power-2 none");
load_prc_file_data("", "gl-version 3 2");
load_prc_file_data("", "no-singular-invert");
}

vpPanda3DRendererSet::vpPanda3DRendererSet(const vpPanda3DRenderParameters &renderParameters) : vpPanda3DBaseRenderer("set")
{
m_renderParameters = renderParameters;
Expand Down
2 changes: 1 addition & 1 deletion tutorial/ar/tutorial-panda3d-renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int main(int argc, const char **argv)
double factor = 1.0;
vpPanda3DRenderParameters renderParams(vpCameraParameters(600 * factor, 600 * factor, 320 * factor, 240 * factor), int(480 * factor), int(640 * factor), 0.01, 10.0);
unsigned h = renderParams.getImageHeight(), w = renderParams.getImageWidth();
vpPanda3DRendererSet renderer(renderParams);
vpPanda3DRendererSet renderer;
renderer.setRenderParameters(renderParams);
renderer.setVerticalSyncEnabled(false);
renderer.setAbortOnPandaError(true);
Expand Down

0 comments on commit a5e6973

Please sign in to comment.