Commit 2a72edf8 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel

Fix compilation.

parent 10d019bc
......@@ -83,14 +83,14 @@ namespace hpp {
try {
client ()->robot ()->getCurrentConfig();
} catch (hpp::Error const& e) {
client ()->robot ()->createRobot (gepetto::gui::Traits<QString>::to_corba("composite").in());
client ()->robot ()->createRobot (to_corba("composite").in());
}
hpp_->robot ()->insertRobotModel (gepetto::gui::Traits<QString>::to_corba(rd.robotName_).in(),
gepetto::gui::Traits<QString>::to_corba(rd.rootJointType_).in(),
gepetto::gui::Traits<QString>::to_corba(rd.package_).in(),
gepetto::gui::Traits<QString>::to_corba(rd.modelName_).in(),
gepetto::gui::Traits<QString>::to_corba(rd.urdfSuf_).in(),
gepetto::gui::Traits<QString>::to_corba(rd.srdfSuf_).in());
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());
// This is already done in requestRefresh
// jointTreeWidget_->reload();
gepetto::gui::MainWindow::instance()->requestRefresh();
......@@ -103,13 +103,13 @@ namespace hpp {
try {
client ()->robot ()->getCurrentConfig();
} catch (hpp::Error const& e) {
client ()->robot ()->createRobot (gepetto::gui::Traits<QString>::to_corba("composite").in());
client ()->robot ()->createRobot (to_corba("composite").in());
}
hpp_->robot ()-> loadEnvironmentModel(gepetto::gui::Traits<QString>::to_corba(ed.package_).in(),
gepetto::gui::Traits<QString>::to_corba(ed.urdfFilename_).in(),
gepetto::gui::Traits<QString>::to_corba(ed.urdfSuf_).in(),
gepetto::gui::Traits<QString>::to_corba(ed.srdfSuf_).in(),
gepetto::gui::Traits<QString>::to_corba(ed.name_ + "/").in());
hpp_->robot ()-> loadEnvironmentModel(to_corba(ed.package_).in(),
to_corba(ed.urdfFilename_).in(),
to_corba(ed.urdfSuf_).in(),
to_corba(ed.srdfSuf_).in(),
to_corba(ed.name_ + "/").in());
HppWidgetsPlugin::computeObjectPosition();
gepetto::gui::MainWindow::instance()->requestRefresh();
emit logSuccess ("Environment " + ed.name_ + " loaded");
......
......@@ -174,12 +174,12 @@ namespace hpp {
void HppWidgetsPlugin::loadRobotModel(gepetto::gui::DialogLoadRobot::RobotDefinition rd)
{
client()->robot()->loadRobotModel(
gepetto::gui::Traits<QString>::to_corba(rd.robotName_ ).in(),
gepetto::gui::Traits<QString>::to_corba(rd.rootJointType_).in(),
gepetto::gui::Traits<QString>::to_corba(rd.package_ ).in(),
gepetto::gui::Traits<QString>::to_corba(rd.modelName_ ).in(),
gepetto::gui::Traits<QString>::to_corba(rd.urdfSuf_ ).in(),
gepetto::gui::Traits<QString>::to_corba(rd.srdfSuf_ ).in());
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());
// This is already done in requestRefresh
// jointTreeWidget_->reload();
gepetto::gui::MainWindow::instance()->requestRefresh();
......@@ -191,9 +191,9 @@ namespace hpp {
{
QString prefix = ed.envName_ + "/";
client()->obstacle()->loadObstacleModel(
gepetto::gui::Traits<QString>::to_corba(ed.package_ ).in(),
gepetto::gui::Traits<QString>::to_corba(ed.urdfFilename_).in(),
gepetto::gui::Traits<QString>::to_corba(prefix ).in());
to_corba(ed.package_ ).in(),
to_corba(ed.urdfFilename_).in(),
to_corba(prefix ).in());
computeObjectPosition ();
gepetto::gui::MainWindow::instance()->requestRefresh();
emit logSuccess ("Environment " + ed.name_ + " loaded");
......
......@@ -22,6 +22,9 @@ namespace hpp {
class Roadmap;
class ConstraintWidget;
inline CORBA::String_var to_corba(const QString& s)
{ return (const char*)s.toLocal8Bit().data(); }
/// Plugin that add a lot of features to work with hpp.
class HppWidgetsPlugin : public QObject, public gepetto::gui::PluginInterface,
public gepetto::gui::ModelInterface, public gepetto::gui::CorbaInterface
......
......@@ -66,20 +66,20 @@ namespace hpp {
priorities->length(nc.count());
int i = 0;
foreach(QListWidgetItem* item, nc) {
names[i] = gepetto::gui::Traits<QString>::to_corba(item->text());
names[i] = to_corba(item->text());
priorities[i] = 0;
i++;
}
plugin_->client()->problem()->addNumericalConstraints(gepetto::gui::Traits<QString>::to_corba(ui->constraintName->text()),
plugin_->client()->problem()->addNumericalConstraints(to_corba(ui->constraintName->text()),
names.in(), priorities.in());
names->length(lj.count());
i = 0;
foreach(QListWidgetItem* item, lj) {
names[i] = gepetto::gui::Traits<QString>::to_corba(item->text());
names[i] = to_corba(item->text());
i++;
}
plugin_->client()->problem()->addLockedJointConstraints(gepetto::gui::Traits<QString>::to_corba(ui->constraintName->text()),
plugin_->client()->problem()->addLockedJointConstraints(to_corba(ui->constraintName->text()),
names.in());
onCancelClicked();
}
......
......@@ -12,8 +12,7 @@
#include <gepetto/gui/mainwindow.hh>
#include <gepetto/gui/windows-manager.hh>
#include <gepetto/gui/meta.hh>
#include <gepetto/viewer/corba/graphical-interface.hh>
#include <hppwidgetsplugin/conversions.hh>
......
......@@ -62,7 +62,7 @@ namespace hpp {
virtual void edgeColor (EdgeID edgeId, Color& color);
protected:
std::size_t currentNodeId_, currentEdgeId_;
NodeID currentNodeId_, currentEdgeId_;
gepetto::gui::ColorMap nodeColorMap_, edgeColorMap_;
private:
......
......@@ -31,7 +31,7 @@ namespace hpp {
transform_(NULL)
{
transform_ = transform;
QQuaternion q (transform_[6], transform_[3], transform_[4], transform_[5]);
QQuaternion q ((float)transform_[6], (float)transform_[3], (float)transform_[4], (float)transform_[5]);
q.normalize();
qDebug()<< q;
rAxis_ = q.vector().normalized() * 2 * std::atan2(q.vector().length(), q.scalar());
......@@ -72,7 +72,7 @@ namespace hpp {
if (axisChanged) {
QQuaternion quaternion;
if (!rAxis_.isNull()) {
const double theta = rAxis_.length();
const float theta = rAxis_.length();
quaternion = QQuaternion(std::cos(theta/2), std::sin(theta/2) * rAxis_ / theta);
}
......@@ -104,19 +104,19 @@ namespace hpp {
void TransformWidget::xRotateChanged(double value)
{
rAxis_.setX(value);
rAxis_.setX((float)value);
changed(true);
}
void TransformWidget::yRotateChanged(double value)
{
rAxis_.setY(value);
rAxis_.setY((float)value);
changed(true);
}
void TransformWidget::zRotateChanged(double value)
{
rAxis_.setZ(value);
rAxis_.setZ((float)value);
changed(true);
}
}
......
......@@ -51,7 +51,7 @@ namespace hpp {
void ATwoJointConstraint::firstJointSelect(int index)
{
secondJoint_->clear();
for (std::size_t i = 0; i < joints_->length(); i++) {
for (CORBA::ULong i = 0; i < joints_->length(); i++) {
if (int(i) != index) secondJoint_->addItem(joints_[i].in());
}
}
......@@ -135,9 +135,9 @@ namespace hpp {
boolSeq[2] = result.second[2];
plugin_->client()->problem()->
createPositionConstraint(gepetto::gui::Traits<QString>::to_corba(name_),
gepetto::gui::Traits<QString>::to_corba(firstJointName_),
gepetto::gui::Traits<QString>::to_corba(secondJointName_),
createPositionConstraint(to_corba(name_),
to_corba(firstJointName_),
to_corba(secondJointName_),
first.in(), second.in(), boolSeq.in());
emit constraintCreated(name_);
emit finished();
......@@ -160,14 +160,14 @@ namespace hpp {
void OrientationConstraint::getOrientationConstraint(std::pair<QVector<double>, QVector<bool> > result)
{
QVector3D vec3d(result.first[0], result.first[1], result.first[2]);
QVector3D vec3d((float)result.first[0], (float)result.first[1], (float)result.first[2]);
QQuaternion qtQuat;
hpp::Quaternion__var quat = new hpp::Quaternion_;
hpp::boolSeq_var boolSeq = new hpp::boolSeq;
if (!vec3d.isNull()) {
qtQuat = QQuaternion::fromAxisAndAngle(vec3d.normalized(), vec3d.length());
const double theta = vec3d.length();
const float theta = vec3d.length();
qtQuat = QQuaternion(std::cos(theta/2), std::sin(theta/2) * vec3d / theta);
}
......@@ -181,9 +181,9 @@ namespace hpp {
boolSeq[2] = result.second[2];
plugin_->client()->problem()->
createOrientationConstraint(gepetto::gui::Traits<QString>::to_corba(name_),
gepetto::gui::Traits<QString>::to_corba(firstJoint_->currentText()),
gepetto::gui::Traits<QString>::to_corba(secondJoint_->currentText()),
createOrientationConstraint(to_corba(name_),
to_corba(firstJoint_->currentText()),
to_corba(secondJoint_->currentText()),
quat.in(), boolSeq.in());
emit constraintCreated(name_);
emit finished();
......@@ -227,14 +227,14 @@ namespace hpp {
void TransformConstraint::getTransformConstraint(std::pair<QVector<double>, QVector<bool> > result)
{
QVector3D vec3d(result.first[3], result.first[4], result.first[5]);
QVector3D vec3d((float)result.first[3], (float)result.first[4], (float)result.first[5]);
QQuaternion qtQuat;
hpp::Transform__var trans = new hpp::Transform_;
hpp::boolSeq_var boolSeq = new hpp::boolSeq;
if (!vec3d.isNull()) {
qtQuat = QQuaternion::fromAxisAndAngle(vec3d.normalized(), vec3d.length());
const double theta = vec3d.length();
const float theta = vec3d.length();
qtQuat = QQuaternion(std::cos(theta/2), std::sin(theta/2) * vec3d / theta);
}
......@@ -254,9 +254,9 @@ namespace hpp {
boolSeq[5] = result.second[5];
plugin_->client()->problem()->
createTransformationConstraint(gepetto::gui::Traits<QString>::to_corba(name_),
gepetto::gui::Traits<QString>::to_corba(firstJointName_),
gepetto::gui::Traits<QString>::to_corba(secondJointName_),
createTransformationConstraint(to_corba(name_),
to_corba(firstJointName_),
to_corba(secondJointName_),
trans.in(), boolSeq.in());
emit constraintCreated(name_);
emit finished();
......
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