Commit c35ed9c7 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by GitHub

Merge pull request #12 from jmirabel/devel

 Allow to change joint values from keyboard  + hpp-fcl plugin enhancement.
parents 40a1028c c6d4ba16
......@@ -54,6 +54,6 @@ IF (HPP_CORBASERVER_FOUND)
ENDIF (HPP_MANIPULATION_CORBA_FOUND AND BUILD_HPP_MANIPULATION_WIDGETS_PLUGIN)
ENDIF (HPP_CORBASERVER_FOUND)
IF (HPP_FCL_FOUND)
IF (BUILD_HPP_FCL_PLUGIN AND HPP_FCL_FOUND)
ADD_SUBDIRECTORY(hppfcl)
ENDIF()
......@@ -24,6 +24,7 @@
#include <QInputDialog>
#include <gepetto/gui/mainwindow.hh>
#include <gepetto/gui/osgwidget.hh>
#include <gepetto/gui/windows-manager.hh>
#include <node.hh>
......@@ -68,11 +69,35 @@ namespace hpp {
void HppFclPlugin::openDialog() const
{
bool ok;
QString filename = QFileDialog::getOpenFileName (NULL, "Select a mesh file");
QString name = QInputDialog::getText(NULL, "Node name", "Node name", QLineEdit::Normal, "bvhmodel");
if (filename.isNull()) return;
int splitMethod = QInputDialog::getInt(NULL, "Split method type",
"Split method type", 0, 0, 3, 1);
"Split method type", 0, 0, 3, 1, &ok);
if (!ok) return;
QString name = QInputDialog::getText(NULL, "Node name", "Node name", QLineEdit::Normal, "bvhmodel");
if (name.isNull()) return;
std::string filename_ (filename.toStdString());
std::string name_ (name.toStdString());
std::string mname_ (name_ + "_mesh");
// Load mesh
MainWindow* main = MainWindow::instance ();
if (!main->osg()->nodeExists (mname_) && !main->osg()->addMesh (mname_, filename_)) return;
std::string group;
if (main->osgWindows().empty()) {
group = "window";
main->osg()->createWindow (group);
} else {
group = main->osgWindows().first()->window()->getID();
}
addBV (name, filename, splitMethod);
main->osg()->addToGroup (name_, group);
main->osg()->addToGroup (mname_, group);
}
#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
......
......@@ -322,7 +322,7 @@ namespace hpp {
for (ULong i = 0; i < dq_.length(); ++i) dq_[ i] = 0;
setValue (0);
connect(this, SIGNAL (sliderReleased()), this, SLOT (reset()));
connect(this, SIGNAL (sliderMoved(int)), this, SLOT (updateIntegrator(int)));
connect(this, SIGNAL (valueChanged(int)), this, SLOT (updateIntegrator(int)));
timerId_ = startTimer(rate_);
}
......@@ -363,7 +363,7 @@ namespace hpp {
setMinimum(0);
setMaximum(100);
setValue ((int)(100*(value_ - m_)/(M_ - m_)));
connect (this, SIGNAL (sliderMoved(int)), this, SLOT (updateConfig(int)));
connect (this, SIGNAL (valueChanged(int)), this, SLOT (updateConfig(int)));
}
double SliderBoundedJoint::getValue()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment