...
 
Commits (17)
#
# Copyright (c) 2015 CNRS
# Authors: Joseph Mirabel
# Copyright (c) 2015, 2020 CNRS
# Authors: Joseph Mirabel, Guilhem Saurel
#
#
# This file is part of hpp-gui
......@@ -17,25 +17,23 @@
# hpp-gui If not, see
# <http://www.gnu.org/licenses/>.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
SET(PROJECT_NAME "hpp-gui")
SET(PROJECT_DESCRIPTION "Graphical interface for HPP ")
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(CXX_DISABLE_WERROR TRUE)
INCLUDE(cmake/hpp.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake//python.cmake)
# Tells pkg-config to read qtversion and cmake_plugin from pkg config file.
LIST(APPEND PKG_CONFIG_ADDITIONAL_VARIABLES qtversion cmake_plugin)
INCLUDE(cmake/python.cmake)
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
FINDPYTHON()
ADD_REQUIRED_DEPENDENCY("gepetto-viewer-corba >= 1.3")
ADD_PROJECT_DEPENDENCY("gepetto-viewer-corba" REQUIRED)
# Get desired Qt version
string(REPLACE "." ";" DESIRED_QT_VERSION_LIST ${GEPETTO_VIEWER_CORBA_QTVERSION})
......@@ -53,28 +51,27 @@ MESSAGE(STATUS "Looking for Qt ${DESIRED_QT_VERSION_MAJOR}.")
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
IF(USE_QT4)
FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtOpenGl QtNetwork)
SET(PKG_CONFIG_EXTRA "qtversion: ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
SET(HPP_GUI_QTVERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
ELSE(USE_QT4)
FOREACH (component "Core" "Widgets" "Gui" "OpenGL" "Concurrent" "Network")
FOREACH (component "Core" "Widgets" "Gui" "OpenGL" "Concurrent" "Network" "Xml")
FIND_PACKAGE ("Qt5${component}" REQUIRED)
LIST(APPEND QT_INCLUDE_DIRS ${Qt5${component}_INCLUDE_DIRS})
LIST(APPEND QT_LIBRARIES ${Qt5${component}_LIBRARIES} )
ENDFOREACH (component "Core" "Widgets" "Gui" "OpenGL" "Network")
SET(PKG_CONFIG_EXTRA "qtversion=${Qt5Core_VERSION}")
SET(HPP_GUI_QTVERSION "${Qt5Core_VERSION}")
ENDIF(USE_QT4)
SET(PKG_CONFIG_EXTRA "qtversion=${HPP_GUI_QTVERSION}")
SET(PACKAGE_EXTRA_MACROS "set(HPP_GUI_QTVERSION ${HPP_GUI_QTVERSION})")
SET(BOOST_COMPONENTS thread regex)
SET(BOOST_COMPONENTS thread regex system)
SEARCH_FOR_BOOST ()
ADD_OPTIONAL_DEPENDENCY("hpp-corbaserver")
ADD_OPTIONAL_DEPENDENCY("hpp-manipulation-corba")
ADD_PROJECT_DEPENDENCY("hpp-fcl")
ADD_PROJECT_DEPENDENCY("hpp-manipulation-corba")
ADD_OPTIONAL_DEPENDENCY("remoteimu")
# Activate hpp-util logging if requested
SET (HPP_DEBUG FALSE CACHE BOOL "trigger hpp-util debug output")
IF (HPP_DEBUG)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHPP_DEBUG")
ENDIF()
ADD_LIBRARY(${PROJECT_NAME} INTERFACE)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
# This line allows QT-MOC to compile with the include from gepetto-gui
# It cannot be done through the pkg-config framework because the moc settings
......
Subproject commit 7eca9ee6c9d1c4ee20eb82272e94f9d11642053a
Subproject commit a61ae61479a1d50d1ae3c988d1d9aaf20841173d
#
# Copyright (c) 2015 CNRS
# Authors: Joseph Mirabel
# Copyright (c) 2015, 2020 CNRS
# Authors: Joseph Mirabel, Guilhem Saurel
#
#
# This file is part of hpp-gui
......@@ -17,43 +17,39 @@
# hpp-gui If not, see
# <http://www.gnu.org/licenses/>.
INCLUDE(${GEPETTO_VIEWER_CORBA_CMAKE_PLUGIN})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
ADD_OPTIONAL_DEPENDENCY(hpp-fcl)
SET(BUILD_REMOTEIMU_PLUGIN ${REMOTEIMU_FOUND}
CACHE BOOL "Build remoteimuplugin")
#SET(BUILD_HPP_CORBASERVER_PLUGIN OFF
# CACHE BOOL "Build hppcorbaserverplugin")
SET(BUILD_HPP_WIDGETS_PLUGIN ${HPP_CORBASERVER_FOUND}
SET(BUILD_HPP_WIDGETS_PLUGIN ${hpp-corbaserver_FOUND}
CACHE BOOL "Build hppwidgetsplugin")
SET(BUILD_HPP_MANIPULATION_WIDGETS_PLUGIN ${HPP_MANIPULATION_CORBA_FOUND}
SET(BUILD_HPP_MANIPULATION_WIDGETS_PLUGIN ${hpp-manipulation-corba_FOUND}
CACHE BOOL "Build hppmanipulationwidgetsplugin")
SET(BUILD_HPP_FCL_PLUGIN ${HPP_FCL_FOUND}
SET(BUILD_HPP_FCL_PLUGIN ${hpp-fcl_FOUND}
CACHE BOOL "Build hppfclplugin")
IF (HPP_CORBASERVER_FOUND)
IF (REMOTEIMU_FOUND AND BUILD_REMOTEIMU_PLUGIN)
IF(hpp-corbaserver_FOUND)
IF(REMOTEIMU_FOUND AND BUILD_REMOTEIMU_PLUGIN)
ADD_SUBDIRECTORY(remoteimuplugin)
ENDIF (REMOTEIMU_FOUND AND BUILD_REMOTEIMU_PLUGIN)
ENDIF(REMOTEIMU_FOUND AND BUILD_REMOTEIMU_PLUGIN)
# Disable because header <gepetto/gui/omniorb/omniorbthread.hh> no more accessible.
#IF (BUILD_HPP_CORBASERVER_PLUGIN)
#IF(BUILD_HPP_CORBASERVER_PLUGIN)
# ADD_SUBDIRECTORY(hppcorbaserverplugin)
#ENDIF (BUILD_HPP_CORBASERVER_PLUGIN)
#ENDIF(BUILD_HPP_CORBASERVER_PLUGIN)
IF (BUILD_HPP_WIDGETS_PLUGIN)
IF(BUILD_HPP_WIDGETS_PLUGIN)
ADD_SUBDIRECTORY(hppwidgetsplugin)
ENDIF (BUILD_HPP_WIDGETS_PLUGIN)
ENDIF(BUILD_HPP_WIDGETS_PLUGIN)
IF (HPP_MANIPULATION_CORBA_FOUND AND BUILD_HPP_MANIPULATION_WIDGETS_PLUGIN)
IF(hpp-manipulation-corba_FOUND AND BUILD_HPP_MANIPULATION_WIDGETS_PLUGIN)
ADD_SUBDIRECTORY(hppmanipulationwidgetsplugin)
ENDIF (HPP_MANIPULATION_CORBA_FOUND AND BUILD_HPP_MANIPULATION_WIDGETS_PLUGIN)
ENDIF (HPP_CORBASERVER_FOUND)
ENDIF(hpp-manipulation-corba_FOUND AND BUILD_HPP_MANIPULATION_WIDGETS_PLUGIN)
ENDIF(hpp-corbaserver_FOUND)
IF (BUILD_HPP_FCL_PLUGIN AND HPP_FCL_FOUND)
IF(BUILD_HPP_FCL_PLUGIN AND hpp-fcl_FOUND)
ADD_SUBDIRECTORY(hppfcl)
ENDIF()
#
# Copyright (c) 2015 CNRS
# Authors: Joseph Mirabel
# Copyright (c) 2015, 2020 CNRS
# Authors: Joseph Mirabel, Guilhem Saurel
#
#
# This file is part of hpp-gui
......@@ -17,8 +17,6 @@
# hpp-gui If not, see
# <http://www.gnu.org/licenses/>.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
IF(USE_QT4)
SET(QT "QT4")
ELSE(USE_QT4)
......@@ -36,7 +34,7 @@ GEPETTO_GUI_PLUGIN(hppcorbaserverplugin
hppcorbaserverplugin.cc
hppserverprocess.cc
PKG_CONFIG_DEPENDENCIES
"hpp-corbaserver"
"gepetto-viewer-corba"
LINK_DEPENDENCIES
"hpp-corbaserver::hpp-corbaserver"
"gepetto-viewer-corba::gepetto-viewer-corba"
)
# Copyright (c) 2018 CNRS
# Authors: Joseph Mirabel
# Copyright (c) 2018, 2020 CNRS
# Authors: Joseph Mirabel, Guilhem Saurel
#
#
# This file is part of gepetto-viewer-corba
......@@ -38,7 +38,7 @@ GEPETTO_GUI_PLUGIN(hppfclplugin
node.cc
LINK_DEPENDENCIES
hpp-fcl::hpp-fcl
PKG_CONFIG_DEPENDENCIES
hpp-fcl
)
......@@ -34,9 +34,9 @@ namespace hpp {
// TODO
}
void BVHDisplay::setLevel (const std::size_t level)
void BVHDisplay::setLevel (const int& level)
{
if (level >= levels_.size())
if (level >= (int)levels_.size())
throw std::invalid_argument ("level out of range");
this->asQueue()->replaceChild (
levels_[level_].geode,
......@@ -57,12 +57,12 @@ namespace hpp {
level_ = 0;
this->asQueue()->addChild(levels_[0].geode);
using gepetto::viewer::UIntProperty;
addProperty (UIntProperty::create ("Level",
UIntProperty::getterFromMemberFunction (this, &BVHDisplay::getLevel),
UIntProperty::setterFromMemberFunction (this, &BVHDisplay::setLevel))
);
using gepetto::viewer::RangedIntProperty;
RangedIntProperty::Ptr_t levelProp = RangedIntProperty::create ("Level",
this, &BVHDisplay::getLevel, &BVHDisplay::setLevel);
levelProp->min = 0;
levelProp->max = (int)(levels_.size()-1);
addProperty (levelProp);
}
void BVHDisplay::recursiveBuildTree (const BVH_t& bvh, int ibv,
......
......@@ -35,9 +35,9 @@ namespace hpp {
public:
BVHDisplay (const std::string& filename, const std::string& name);
void setLevel (const std::size_t level);
void setLevel (const int& level);
const std::size_t& getLevel () const
const int& getLevel () const
{
return level_;
}
......@@ -60,7 +60,7 @@ namespace hpp {
};
const std::string filename_;
std::vector <BVLevel> levels_;
std::size_t level_;
int level_;
};
} // namespace gui
} // namespace hpp
......
......@@ -23,6 +23,7 @@
#include <QFileDialog>
#include <QInputDialog>
#include <gepetto/viewer/window-manager.h>
#include <gepetto/gui/mainwindow.hh>
#include <gepetto/gui/osgwidget.hh>
#include <gepetto/gui/windows-manager.hh>
......
#
# Copyright (c) 2015 CNRS
# Authors: Joseph Mirabel
# Copyright (c) 2015, 2020 CNRS
# Authors: Joseph Mirabel, Guilhem Saurel
#
#
# This file is part of hpp-gui
......@@ -17,8 +17,6 @@
# hpp-gui If not, see
# <http://www.gnu.org/licenses/>.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
IF(USE_QT4)
SET(QT "QT4")
ELSE(USE_QT4)
......@@ -45,8 +43,6 @@ GEPETTO_GUI_PLUGIN(hppmanipulationwidgetsplugin
LINK_DEPENDENCIES
hppwidgetsplugin
PKG_CONFIG_DEPENDENCIES
"hpp-manipulation-corba"
"gepetto-viewer-corba"
"hpp-manipulation-corba::hpp-manipulation-corba"
"gepetto-viewer-corba::gepetto-viewer-corba"
)
......@@ -5,6 +5,7 @@
#include "hppmanipulationwidgetsplugin/hppmanipulationwidgetsplugin.hh"
#include <assert.h>
#include <sstream>
#include <QAction>
......@@ -87,12 +88,14 @@ namespace hpp {
} catch (hpp::Error const& e) {
client ()->robot ()->createRobot (to_corba("composite").in());
}
QString urdfFilename ("package://" + rd.package_ + "/urdf/" +
rd.modelName_ + rd.urdfSuf_ + ".urdf");
QString srdfFilename ("package://" + rd.package_ + "/srdf/" +
rd.modelName_ + rd.srdfSuf_ + ".srdf");
hpp_->robot ()->insertRobotModel (to_corba(rd.robotName_).in(),
to_corba(rd.rootJointType_).in(),
to_corba(rd.package_).in(),
to_corba(rd.modelName_).in(),
to_corba(rd.urdfSuf_).in(),
to_corba(rd.srdfSuf_).in());
to_corba(urdfFilename).in(),
to_corba(srdfFilename).in());
// This is already done in requestRefresh
// jointTreeWidget_->reload();
gepetto::gui::MainWindow::instance()->requestRefresh();
......@@ -109,10 +112,12 @@ namespace hpp {
} catch (hpp::Error const& e) {
client ()->robot ()->createRobot (to_corba("composite").in());
}
hpp_->robot ()-> loadEnvironmentModel(to_corba(ed.package_).in(),
to_corba(ed.urdfFilename_).in(),
to_corba(ed.urdfSuf_).in(),
to_corba(ed.srdfSuf_).in(),
QString urdfFilename ("package://" + ed.package_ + "/urdf/" +
ed.urdfFilename_ + ed.urdfSuf_ + ".urdf");
QString srdfFilename ("package://" + ed.package_ + "/srdf/" +
ed.urdfFilename_ + ed.srdfSuf_ + ".srdf");
hpp_->robot ()-> loadEnvironmentModel(to_corba(urdfFilename).in(),
to_corba(srdfFilename).in(),
to_corba(ed.name_ + "/").in());
HppWidgetsPlugin::computeObjectPosition();
gepetto::gui::MainWindow::instance()->requestRefresh();
......
#
# Copyright (c) 2015 CNRS
# Authors: Joseph Mirabel
# Copyright (c) 2015, 2020 CNRS
# Authors: Joseph Mirabel, Guilhem Saurel
#
#
# This file is part of hpp-gui
......@@ -17,8 +17,6 @@
# hpp-gui If not, see
# <http://www.gnu.org/licenses/>.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
IF(USE_QT4)
SET(QT "QT4")
ELSE(USE_QT4)
......@@ -77,7 +75,8 @@ GEPETTO_GUI_PLUGIN(hppwidgetsplugin
listjointconstraint.cc
joint-action.cc
PKG_CONFIG_DEPENDENCIES
"hpp-corbaserver"
"gepetto-viewer-corba"
LINK_DEPENDENCIES
${Boost_LIBRARIES}
"hpp-corbaserver::hpp-corbaserver"
"gepetto-viewer-corba::gepetto-viewer-corba"
)
......@@ -13,7 +13,6 @@
#include <gepetto/gui/mainwindow.hh>
#include <gepetto/gui/windows-manager.hh>
#include <gepetto/gui/omniorb/url.hh>
#include <gepetto/gui/action-search-bar.hh>
#include <gepetto/gui/safeapplication.hh>
......@@ -201,13 +200,15 @@ namespace hpp {
void HppWidgetsPlugin::loadRobotModel(gepetto::gui::DialogLoadRobot::RobotDefinition rd)
{
QString urdfFilename ("package://" + rd.package_ + "/urdf/" +
rd.modelName_ + rd.urdfSuf_ + ".urdf");
QString srdfFilename ("package://" + rd.package_ + "/srdf/" +
rd.modelName_ + rd.srdfSuf_ + ".srdf");
client()->robot()->loadRobotModel(
to_corba(rd.robotName_ ).in(),
to_corba(rd.rootJointType_).in(),
to_corba(rd.package_ ).in(),
to_corba(rd.modelName_ ).in(),
to_corba(rd.urdfSuf_ ).in(),
to_corba(rd.srdfSuf_ ).in());
to_corba(urdfFilename ).in(),
to_corba(srdfFilename ).in ());
// This is already done in requestRefresh
// jointTreeWidget_->reload();
gepetto::gui::MainWindow::instance()->requestRefresh();
......@@ -218,9 +219,10 @@ namespace hpp {
void HppWidgetsPlugin::loadEnvironmentModel(gepetto::gui::DialogLoadEnvironment::EnvironmentDefinition ed)
{
QString prefix = ed.envName_ + "/";
QString urdfFilename ("package://" + ed.package_ + "/urdf/" +
ed.urdfFilename_ + ".urdf");
client()->obstacle()->loadObstacleModel(
to_corba(ed.package_ ).in(),
to_corba(ed.urdfFilename_).in(),
to_corba(urdfFilename ).in(),
to_corba(prefix ).in());
computeObjectPosition ();
gepetto::gui::MainWindow::instance()->requestRefresh();
......@@ -273,10 +275,10 @@ namespace hpp {
QString HppWidgetsPlugin::getHppIIOPurl () const
{
QString host = gepetto::gui::MainWindow::instance ()->settings_->getSetting
("hpp/host", QString ()).toString ();
("hpp/host", "localhost").toString ();
QString port = gepetto::gui::MainWindow::instance ()->settings_->getSetting
("hpp/port", QString ()).toString ();
return gepetto::gui::omniOrb::IIOPurl (host, port);
("hpp/port", "13331").toString ();
return QString ("corbaloc:iiop:%1:%2").arg(host).arg(port);
}
QString HppWidgetsPlugin::getHppContext () const
......@@ -294,7 +296,7 @@ namespace hpp {
QByteArray context = getHppContext ().toLatin1();
try {
hpp_->connect (iiop.constData (), context.constData ());
} catch (const CosNaming::NamingContext::NotFound&) {
} catch (const CORBA::Exception&) {
const char* msg = "Could not find the HPP server. Is it running ?";
qDebug () << msg;
gepetto::gui::MainWindow* main = gepetto::gui::MainWindow::instance();
......@@ -440,7 +442,7 @@ namespace hpp {
void HppWidgetsPlugin::selectJointFromBodyName(const QString bodyName)
{
boost::regex roadmap ("^(roadmap|path[0-9]+)_(.*)/(node|edge)([0-9]+)$");
static const boost::regex roadmap ("^(roadmap|path[0-9]+)_(.*)/(node|edge)([0-9]+)$");
boost::cmatch what;
const std::string bname = bodyName.toStdString();
if (boost::regex_match (bname.c_str(), what, roadmap)) {
......@@ -473,6 +475,13 @@ namespace hpp {
}
return;
}
static const boost::regex bodyname ("^(.*)(_[0-9]+)$");
std::string shortBodyName;
bool test_short_name = boost::regex_match (bname.c_str(), what, bodyname);
if (test_short_name) {
shortBodyName.assign(what[0].first, what[1].second);
}
foreach (const JointElement& je, jointMap_) {
// je.bodyNames will be of size 1 most of the time
// so it is fine to use a vector + line search, vs map + binary
......@@ -480,7 +489,9 @@ namespace hpp {
const std::size_t len = je.prefix.length();
if (bname.compare(0, len, je.prefix) == 0) {
for (std::size_t i = 0; i < je.bodyNames.size(); ++i) {
if (bname.compare(len, std::string::npos, je.bodyNames[i]) == 0) {
if (bname.compare(len, std::string::npos, je.bodyNames[i]) == 0
|| (test_short_name
&& shortBodyName.compare(len, std::string::npos, je.bodyNames[i]) == 0)) {
// TODO: use je.item for a faster selection.
jointTreeWidget_->selectJoint (je.name);
return;
......
......@@ -131,10 +131,12 @@ namespace hpp {
{
// planar and freeflyer joints
int threshold = value_.size();
if (nv_ == 1 && nq_ == 2 ) //SO2
threshold = 0;
// TODO SO3 joint fall in that case too whereas threshold should be 0 for them.
if (nv_ == 3 && nq_ == 4 )
else if (nv_ == 3 && nq_ == 4 ) //SO3 and SE2
threshold = 2;
else if (nv_ == 6 && nq_ == 7 )
else if (nv_ == 6 && nq_ == 7 ) //SE3
threshold = 3;
for (int i = 0; i < value_.size(); ++i) {
float lo = value_[i][1]->data (Qt::EditRole).toFloat();
......
......@@ -10,6 +10,8 @@
#include "hppwidgetsplugin/jointtreewidget.hh"
#include "hppwidgetsplugin/ui_jointtreewidget.h"
#include <gepetto/viewer/group-node.h>
#include <gepetto/gui/mainwindow.hh>
#include <gepetto/gui/bodytreewidget.hh>
#include <gepetto/gui/windows-manager.hh>
......
......@@ -5,6 +5,7 @@
#include "hppwidgetsplugin/pathplayer.hh"
#include <assert.h>
#include <sstream>
#include <QProgressDialog>
......@@ -67,6 +68,12 @@ namespace hpp {
a = new JointAction (tr("Display selected &path"), plugin_->jointTreeWidget(), this);
connect (a, SIGNAL (triggered(std::string)), SLOT (displayPath(std::string)));
asb->addAction(a);
{
QAction* a = new QAction (tr("Play path"), this);
playPause()->connect (a, SIGNAL (triggered()), SLOT (toggle()));
asb->addAction(a);
}
}
void PathPlayer::displayWaypointsOfPath(const std::string jointName)
......
......@@ -98,12 +98,14 @@ namespace hpp {
planner()->addItem(QString::fromLocal8Bit(names[i]));
setSelected(planner(), "PathPlanner");
if (s == Planner) break;
// fall through
case Optimizer:
names = plugin_->client()->problem()->getAvailable("PathOptimizer");
optimizers_.clear();
for (CORBA::ULong i = 0; i < names->length(); ++i)
optimizers_ << QString::fromLocal8Bit(names[i]);
if (s == Optimizer) break;
// fall through
case Validation:
clearQComboBox(validation());
names = plugin_->client()->problem()->getAvailable("PathValidation");
......@@ -111,6 +113,7 @@ namespace hpp {
validation()->addItem(QString::fromLocal8Bit(names[i]), QVariant (0.2));
setSelected(validation(), "PathValidation");
if (s == Validation) break;
// fall through
case Projector:
clearQComboBox(projector());
names = plugin_->client()->problem()->getAvailable("PathProjector");
......@@ -118,6 +121,7 @@ namespace hpp {
projector()->addItem(QString::fromLocal8Bit(names[i]), QVariant (0.2));
setSelected(projector(), "PathProjector");
if (s == Projector) break;
// fall through
case SteeringMethod:
clearQComboBox(steeringMethod());
names = plugin_->client()->problem()->getAvailable("SteeringMethod");
......@@ -125,6 +129,7 @@ namespace hpp {
steeringMethod()->addItem(QString::fromLocal8Bit(names[i]));
setSelected(steeringMethod(), "SteeringMethod");
if (s == SteeringMethod) break;
// fall through
}
}
......
#
# Copyright (c) 2015 CNRS
# Authors: Joseph Mirabel
# Copyright (c) 2015, 2020 CNRS
# Authors: Joseph Mirabel, Guilhem Saurel
#
#
# This file is part of hpp-gui
......@@ -17,8 +17,6 @@
# hpp-gui If not, see
# <http://www.gnu.org/licenses/>.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
IF(USE_QT4)
SET(QT "QT4")
ELSE(USE_QT4)
......@@ -36,8 +34,8 @@ GEPETTO_GUI_PLUGIN(remoteimuplugin
LINK_DEPENDENCIES
"hppwidgetsplugin"
"hpp-corbaserver::hpp-corbaserver"
PKG_CONFIG_DEPENDENCIES
"remoteimu"
"hpp-corbaserver"
)
......@@ -42,6 +42,18 @@ class _Pair:
def __hash__(self):
return self.hash
class TableWidget (QtGui.QTableWidget):
def keyPressEvent(self, event):
if event.key() == Qt.Qt.Key_Space:
lastRow = -1
print("Selecting items")
for item in self.selectedItems():
if lastRow != item.row():
self.cellWidget(item.row(), CollisionPairs.ACTIVE).toggle()
lastRow = item.row()
else:
QtGui.QTableWidget.keyPressEvent(self, event)
class CollisionPairs(QtGui.QWidget):
ACTIVE=0
LINK_1=1
......@@ -68,7 +80,7 @@ class CollisionPairs(QtGui.QWidget):
box.addWidget(button)
# Create table
self.table = QtGui.QTableWidget(0, 6)
self.table = TableWidget(0, 6)
self.table.setHorizontalHeaderLabels(["Active", "Link 1", "Link 2", "Reason", "Current configuration", "% of collision"])
if Qt.qVersion().startswith('4'):
self.table.horizontalHeader().setResizeMode(QtGui.QHeaderView.Interactive)
......