Skip to content

Commit

Permalink
make the root of the transformer display selectable
Browse files Browse the repository at this point in the history
Sometimes devs might want to switch the visualization root to another
frame, e.g. switch from odometry to slam this is now possible
  • Loading branch information
planthaber committed Oct 12, 2022
1 parent 803f2c7 commit 752eba0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Vizkit3DWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ bool Vizkit3DConfig::isAxesLabels() const
return getWidget()->isAxesLabels();
}

void Vizkit3DConfig::setTransformerRootFrame (const QStringList &frames) {
return getWidget()->setRootFrame(frames.front());
}

namespace
{
struct ManipulatorDefinition
Expand Down Expand Up @@ -926,6 +930,7 @@ void Vizkit3DWidget::setTransformation(const QString &source_frame,const QString
registerClickHandler(target_frame.toStdString());

emit propertyChanged("frame");
emit propertyChanged("transformerroot");
// first: VizPluginBase*
// second: osg::ref_ptr<osg::Group>

Expand Down
3 changes: 3 additions & 0 deletions src/Vizkit3DWidget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ namespace vizkit3d
Q_PROPERTY( bool axes_labels READ isAxesLabels WRITE setAxesLabels)
Q_PROPERTY( QColor background READ getBackgroundColor WRITE setBackgroundColor)
Q_PROPERTY( QStringList frame READ getVisualizationFrames WRITE setVisualizationFrame)
Q_PROPERTY( QStringList transformerroot READ getVisualizationFrames WRITE setTransformerRootFrame)
Q_PROPERTY( bool environment READ isEnvironmentPluginEnabled WRITE setEnvironmentPluginEnabled)
Q_PROPERTY( bool transformer READ isTransformer WRITE setTransformer)
Q_ENUMS( CAMERA_MANIPULATORS )
Expand Down Expand Up @@ -186,6 +187,8 @@ namespace vizkit3d
QColor getBackgroundColor()const;
void setBackgroundColor(QColor color);

void setTransformerRootFrame (const QStringList &frames);

/** Converts a manipulator ID to its name */
static QString manipulatorIDToName(CAMERA_MANIPULATORS id);
/** Converts a manipulator name to its ID */
Expand Down

0 comments on commit 752eba0

Please sign in to comment.