Go to the documentation of this file.
29 #define M_PI_2 1.5707963267948966192E0
36 ViewerWidget::ViewerWidget(QWidget* parent) :
37 QGLViewer(parent), m_zMin(0.0),m_zMax(1.0) {
50 setMouseTracking(
true);
64 float pos[4] = {-1.0, 1.0, 1.0, 0.0};
66 glLightfv(GL_LIGHT0, GL_POSITION, pos);
80 QString
help =
"<h2>Octomap 3D viewer</h2>";
82 help +=
"The Octomap library implements a 3D occupancy grid mapping approach. "
83 "It provides data structures and mapping algorithms. The map is implemented "
84 "using an octree. 3D maps can be viewed an built using this 3D viewer."
86 "Octomap is available at https://octomap.github.io, and is actively "
87 "maintained by Kai M. Wurm and Armin Hornung. This 3D viewer is based on "
88 "libQGLViewer, available at http://www.libqglviewer.com/."
90 "Please refer to the \"Keyboard\" and \"Mouse\" tabs for instructions on "
91 "how to use the viewer.";
98 (*it)->enableHeightColorMode(enabled);
106 (*it)->enablePrintoutMode(enabled);
114 (*it)->enableSemanticColoring(enabled);
157 if(kfi && frame >= 0 && frame < kfi->numberOfKeyFrames()) {
161 std::cerr <<
"Error: Could not jump to frame " << frame <<
" of " << kfi->
numberOfKeyFrames() << std::endl;
167 if(
camera()->keyFrameInterpolator(
id)) {
168 disconnect(
camera()->keyFrameInterpolator(
id), SIGNAL(interpolated()),
this, SLOT(update()));
179 if(!
camera()->keyFrameInterpolator(
id)) {
245 connect(kfi, SIGNAL(interpolated()),
this, SLOT(update()));
253 if(
camera()->keyFrameInterpolator(
id) &&
camera()->keyFrameInterpolator(
id)->interpolationIsStarted()) {
254 disconnect(
camera()->keyFrameInterpolator(
id), SIGNAL(interpolated()),
this, SLOT(update()));
299 for(std::vector<SceneObject*>::iterator it =
m_sceneObjects.begin();
322 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
324 glEnable(GL_LIGHTING);
330 for(std::vector<SceneObject*>::iterator it =
m_sceneObjects.begin();
357 glMatrixMode(GL_MODELVIEW);
363 glPushAttrib(GL_ALL_ATTRIB_BITS);
365 glDisable(GL_COLOR_MATERIAL);
void setManipulatedFrame(qglviewer::ManipulatedFrame *frame)
static void drawGrid(qreal size=1.0, int nbSubdivisions=10)
void addKeyFrame(const Frame &frame)
virtual void loadModelViewMatrix(bool reset=true) const
void draw(bool withNames=false)
The Quaternion class represents 3D rotations and orientations.
void setOrientation(const Quaternion &q)
virtual bool restoreStateFromFile()
int getGrabbedFrame() const
The Vec class represents 3D positions and 3D vectors.
int numberOfKeyFrames() const
void setWheelSensitivity(qreal sensitivity)
bool interpolationIsStarted() const
virtual void deletePath(unsigned int i)
Vector3 rotate(const Vector3 &v) const
KeyFrameInterpolator * keyFrameInterpolator(unsigned int i) const
void setKeyFrameInterpolator(unsigned int i, KeyFrameInterpolator *const kfi)
virtual void addKeyFrameToPath(unsigned int i)
void setAxisIsDrawn(bool draw=true)
A versatile 3D OpenGL viewer based on QGLWidget.
void startInterpolation(int period=-1)
qreal keyFrameTime(int index) const
qreal interpolationTime() const
void setFromRotatedBasis(const Vec &X, const Vec &Y, const Vec &Z)
The Frame class represents a coordinate system, defined by a position and an orientation.
void setUpVector(const Vec &up, bool noMove=true)
static void drawAxis(qreal length=1.0)
ManipulatedCameraFrame * frame() const
void setMouseBinding(unsigned int state, MouseHandler handler, MouseAction action, bool withConstraint=true)
void setSceneBoundingBox(const qglviewer::Vec &min, const qglviewer::Vec &max)
void setBackgroundColor(const QColor &color)
void setInterpolationTime(qreal time)
void lookAt(const Vec &target)
Frame keyFrame(int index) const
void setPosition(const Vec &pos)
void setGridIsDrawn(bool draw=true)
Quaternion orientation() const
qglviewer::Camera * camera() const
A keyFrame Catmull-Rom Frame interpolator.
octovis
Author(s): Kai M. Wurm
, Armin Hornung
autogenerated on Thu Apr 3 2025 02:40:44