Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpPanda3DRenderParameters.h
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2024 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * See the file LICENSE.txt at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using ViSP with software that can not be combined with the GNU
13 * GPL, please contact Inria about acquiring a ViSP Professional
14 * Edition License.
15 *
16 * See https://visp.inria.fr for more information.
17 *
18 * This software was developed at:
19 * Inria Rennes - Bretagne Atlantique
20 * Campus Universitaire de Beaulieu
21 * 35042 Rennes Cedex
22 * France
23 *
24 * If you have questions regarding the use of this file, please contact
25 * Inria at visp@inria.fr
26 *
27 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 */
30
31#ifndef VP_PANDA3D_RENDER_PARAMETERS_H
32#define VP_PANDA3D_RENDER_PARAMETERS_H
33
34#include <visp3/core/vpConfig.h>
35
36#if defined(VISP_HAVE_PANDA3D)
37#include <visp3/core/vpCameraParameters.h>
38
39class Camera;
40
58{
59public:
60 vpPanda3DRenderParameters() : m_cam(), m_height(0), m_width(0), m_clipNear(0.001), m_clipFar(10.0) { }
61 vpPanda3DRenderParameters(const vpCameraParameters &cam, unsigned int h, unsigned int w,
62 double clipNear, double clipFar)
63 : m_cam(cam), m_height(h), m_width(w), m_clipNear(clipNear), m_clipFar(clipFar)
64 { }
65
71 const vpCameraParameters &getCameraIntrinsics() const { return m_cam; }
77 {
79 throw vpException(vpException::badValue, "Panda3D renderer: only lenses with no distortion are supported");
80 }
81 m_cam = cam;
82 }
83
84 double getNearClippingDistance() const { return m_clipNear; }
85 double getFarClippingDistance() const { return m_clipFar; }
86
93 void setClippingDistance(double nearV, double farV)
94 {
95 if (farV < nearV) {
96 std::swap(nearV, farV);
97 }
98 m_clipNear = nearV;
99 m_clipFar = farV;
100 }
101
102 unsigned int getImageWidth() const { return m_width; }
103 unsigned int getImageHeight() const { return m_height; }
104
113 void setImageResolution(unsigned int height, unsigned int width)
114 {
115 m_height = height;
116 m_width = width;
117 }
118
126 void setupPandaCamera(Camera *camera);
127
128private:
129 vpCameraParameters m_cam;
130 unsigned int m_height, m_width;
131 double m_clipNear, m_clipFar;
132};
133
134END_VISP_NAMESPACE
135#endif
136#endif
Generic class defining intrinsic camera parameters.
@ perspectiveProjWithoutDistortion
Perspective projection without distortion model.
error that can be emitted by ViSP classes.
Definition vpException.h:60
@ badValue
Used to indicate that a value is not in the allowed range.
Definition vpException.h:73
void setClippingDistance(double nearV, double farV)
Set the clipping distance. When a panda camera uses these render parameters, objects that are closer ...
void setCameraIntrinsics(const vpCameraParameters &cam)
set camera intrinsics. Only camera intrinsics for a lens without distortion are supported.
vpPanda3DRenderParameters(const vpCameraParameters &cam, unsigned int h, unsigned int w, double clipNear, double clipFar)
const vpCameraParameters & getCameraIntrinsics() const
Retrieve camera intrinsics.
void setImageResolution(unsigned int height, unsigned int width)
Set the image resolution. When this object is given to a vpPanda3DBaseRenderer, this will be the reso...