<repo_name>andreadelprete/gepetto-viewer-corba<file_sep>/pyplugins/gepetto/gui/__init__.py
from pythonwidget import Plugin
<file_sep>/include/gepetto/gui/meta.hh
// Copyright (c) 2015-2018, LAAS-CNRS
// Authors: <NAME> (<EMAIL>)
//
// This file is part of gepetto-viewer-corba.
// gepetto-viewer-corba is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// gepetto-viewer-corba is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// gepetto-viewer-corba. If not, see <http://www.gnu.org/licenses/>.

#ifndef GEPETTO_GUI_META_HH
#define GEPETTO_GUI_META_HH

#include <QString>

namespace gepetto {
  namespace gui {
    template <typename T> struct convertTo {
      static inline       T& from (      T& t) { return t; }
      static inline const T& from (const T& t) { return t; }
    };
    template <> struct convertTo<std::string> {
      static inline std::string from (const QString& in) { return in.toStdString(); };
    };

    template <typename T> struct Traits;

    template <> struct Traits <CORBA::String_var> {
      typedef CORBA::String_var type;
      static inline type from (const QString& s) { return (const char*)s.toLocal8Bit().data(); }
      static inline type from (const std::string& s) { return s.c_str(); }
    };

    template <> struct Traits <QString> {
      typedef CORBA::String_var CORBA_t;
      static inline CORBA_t to_corba (const QString& s) { return (const char*)s.toLocal8Bit().data(); }
    };


    template <typename In, typename Out, std::size_t Size>
    inline void convertSequence (const In* in, Out (&out)[Size]) {
      for (size_t i = 0; i < Size; ++i) out[i] = (Out)in[i];
    }
    template <typename In, typename Out>
    inline void convertSequence (const In* in, Out* out, const std::size_t& s) {
      for (size_t i = 0; i < s; ++i) out[i] = (Out)in[i];
    }
  }
}

#endif // GEPETTO_GUI_META_HH
<file_sep>/doc/main.hh
/// \mainpage Gepetto Viewer user interfaces
///
/// This package provides two compatible interfaces to vizualise robots:
/// \li a \ref gepetto_viewer_corba_introduction "command line interface in Python"
/// \li a \ref gepetto_gui_introduction "graphical user interface" which is fully compatible with the Python interface.
///
/// \defgroup pluginlist List of available plugins
///
/// \defgroup plugin Plugin interfaces
/// Interface of C++ and Python plugins.
///
/// \ingroup plugin
/// \{
///   \defgroup plugin_cpp C++ Plugin API
///   Descriptions of the available interfaces.
///
///   \defgroup plugin_python Python plugin API
///   These slots are available for Python scripting in plugins.
/// \}
<file_sep>/src/test-client-cpp.cc
//
//  test-client-cpp.cc
//  Test SceneViewer with C++ CORBA client interface.
//
//  Created by <NAME> in December 2014.
//  Copyright (c) 2014 LAAS-CNRS. All rights reserved.
//

#include <gepetto/viewer/corba/client.hh>

void se3ToCorba(CORBA::Float* corbaPosition, const se3::SE3& se3position)
{
    Eigen::Quaternion<float> q(se3position.rotation());
    corbaPosition[0] = se3position.translation()(0);
    corbaPosition[1] = se3position.translation()(1);
    corbaPosition[2] = se3position.translation()(2);
    corbaPosition[3] = q.w();
    corbaPosition[4] = q.x();
    corbaPosition[5] = q.y();
    corbaPosition[6] = q.z();
}

int main(int, const char **)
{
    using namespace graphics;
    using namespace corbaServer;
    using namespace std;

    Client client (0, NULL);
    client.connect ();

    se3::SE3 position1 = se3::SE3::Random();
    se3::SE3 position2 = se3::SE3::Random();
    se3::SE3 position3 = se3::SE3::Random();
    se3::SE3 position4 = se3::SE3::Random();
    se3::SE3 position5 = se3::SE3::Random();
    CORBA::Float pos[7];

    Client::WindowID windowId = client.gui()->createWindow("window1");
    client.gui()->createScene("scene1");
    client.gui()->addSceneToWindow("scene1",windowId);
    client.gui()->addURDF("scene1/hrp2", "/local/mgeisert/devel/src/hrp2/hrp2_14_description/urdf/hrp2_14_capsule.urdf", "/local/mgeisert/devel/src/hrp2/");

    sleep(5);

    //vector<float> tri01 (3);

    float pos1[3]= {1.,0.,0.};
    float pos2[3] = {0.,1.,0.};
    float pos3[3]= {0.,1.,1.};
    float color[4] = {1.,1.,1.,1.};
    client.gui()->addTriangleFace("scene1/triangle", pos1, pos2, pos3, color);

    sleep(15);


    se3ToCorba (pos, position1);
    client.gui()->applyConfiguration("scene1/hrp2/RLEG_LINK0", pos);
    se3ToCorba (pos, position2);
    client.gui()->applyConfiguration("scene1/hrp2/RLEG_LINK1", pos);
    se3ToCorba (pos, position3);
    client.gui()->applyConfiguration("scene1/hrp2/LLEG_LINK1", pos);
    se3ToCorba (pos, position4);
    client.gui()->applyConfiguration("scene1/hrp2/LLEG_LINK2", pos);
    se3ToCorba (pos, position5);
    client.gui()->applyConfiguration("scene1/hrp2/BODY", pos);

    client.gui()->refresh();

    return 0;
}
<file_sep>/src/gui/CMakeLists.txt
#
# Copyright (c) 2015-2016 CNRS
# Authors: <NAME>
#
#
# This file is part of gepetto-gui
# gepetto-gui is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# gepetto-gui is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Lesser Public License for more details.  You should have
# received a copy of the GNU Lesser General Public License along with
# gepetto-gui  If not, see
# <http://www.gnu.org/licenses/>.

# Configure the project
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/src)

SET (${PROJECT_NAME}_SOURCES
  ${CMAKE_BINARY_DIR}/src/gui/main.cc
  settings.cc
  windows-manager.cc
  safeapplication.cc
  mainwindow.cc
  osgwidget.cc
  pick-handler.cc
  tree-item.cc
  omniorbthread.cc
  bodytreewidget.cc
  ledindicator.cc
  dialog/dialogloadrobot.cc
  dialog/dialogloadenvironment.cc
  dialog/pluginmanagerdialog.cc
  shortcut-factory.cc
  selection-handler.cc
  selection-event.cc
  action-search-bar.cc
  node-action.cc
  )

IF(GEPETTO_GUI_HAS_PYTHONQT)
  INCLUDE_DIRECTORIES("${PYTHON_INCLUDE_DIR}" "${PYTHONQT_INCLUDE_DIR}")
  SET (${PROJECT_NAME}_SOURCES
    ${${PROJECT_NAME}_SOURCES}
    pythonwidget.cc)
  SET (${PROJECT_NAME}_MOC
    ${${PROJECT_NAME}_HEADERS_MOC}
    python-decorator.hh
    )
ELSE (GEPETTO_GUI_HAS_PYTHONQT)
  MESSAGE(STATUS "Skipping PythonQt settings")
  SET (${PROJECT_NAME}_MOC
    ${${PROJECT_NAME}_HEADERS_MOC}
    )
ENDIF(GEPETTO_GUI_HAS_PYTHONQT)

SET (${PROJECT_NAME}_HEADERS
  ${${PROJECT_NAME}_HEADERS_MOC}
  ${${PROJECT_NAME}_HEADERS_NO_MOC}
  )

# Compile meta-objects and executable
IF(USE_QT4)
  QT4_WRAP_CPP(${PROJECT_NAME}_HEADERS_MOCED ${${PROJECT_NAME}_MOC})
  QT4_WRAP_UI(${PROJECT_NAME}_FORMS_HEADERS ${${PROJECT_NAME}_FORMS})
  QT4_ADD_RESOURCES(${PROJECT_NAME}_RESOURCES_RCC ${${PROJECT_NAME}_RESOURCES})
  INCLUDE(${QT_USE_FILE})
ELSE(USE_QT4)
  QT5_WRAP_CPP(${PROJECT_NAME}_HEADERS_MOCED ${${PROJECT_NAME}_MOC})
  QT5_WRAP_UI(${PROJECT_NAME}_FORMS_HEADERS ${${PROJECT_NAME}_FORMS})
  QT5_ADD_RESOURCES(${PROJECT_NAME}_RESOURCES_RCC ${${PROJECT_NAME}_RESOURCES})
ENDIF(USE_QT4)

ADD_DEFINITIONS(${QT_DEFINITIONS})

ADD_EXECUTABLE(gepetto-gui ${${PROJECT_NAME}_SOURCES}
  ${${PROJECT_NAME}_HEADERS_MOCED}
  ${${PROJECT_NAME}_HEADERS_NO_MOC}
  ${${PROJECT_NAME}_FORMS_HEADERS}
  ${${PROJECT_NAME}_RESOURCES_RCC}
  )

TARGET_LINK_LIBRARIES(gepetto-gui ${PROJECT_NAME} ${QT_LIBRARIES})
PKG_CONFIG_USE_DEPENDENCY(gepetto-gui gepetto-viewer)
PKG_CONFIG_USE_DEPENDENCY(gepetto-gui openscenegraph)
PKG_CONFIG_USE_DEPENDENCY(gepetto-gui openthreads)
PKG_CONFIG_USE_DEPENDENCY(gepetto-gui openscenegraph-osgQt)
PKG_CONFIG_USE_DEPENDENCY(gepetto-gui omniORB4)
IF (GEPETTO_GUI_HAS_PYTHONQT)
  TARGET_LINK_LIBRARIES(gepetto-gui ${PYTHONQT_LIBRARIES})
ENDIF (GEPETTO_GUI_HAS_PYTHONQT)
TARGET_LINK_LIBRARIES(gepetto-gui ${Boost_LIBRARIES})

INSTALL(TARGETS gepetto-gui DESTINATION bin)
<file_sep>/examples/display-urdf.cc
//
//  display-urdf.cc
//  Test SceneViewer with C++ CORBA client interface.
//
//  Created by <NAME> in June 2015.
//  Copyright (c) 2014 LAAS-CNRS. All rights reserved.
//

#include <gepetto/viewer/corba/client.hh>

int main(int argc, const char ** argv)
{
    using namespace graphics;
    using namespace corbaServer;

    if (argc != 3) {
      std::cout << "Usage " << argv[0] << " <urdf-filename> <path-to-meshes>"
        << std::endl;
      return 1;
    }

    Client client (0, NULL);
    client.connect ();

    Client::WindowID windowId = client.gui()->createWindow("urdf-display");
    client.gui()->createScene("scene-urdf");
    client.gui()->addSceneToWindow("scene-urdf",windowId);
    client.gui()->addURDF("scene-urdf/urdf", argv[1], argv[2]);

    client.gui()->refresh();

    return 0;
}
<file_sep>/src/gui/osgwidget.cc
// Copyright (c) 2015-2018, LAAS-CNRS
// Authors: <NAME> (<EMAIL>)
//
// This file is part of gepetto-viewer-corba.
// gepetto-viewer-corba is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// gepetto-viewer-corba is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// gepetto-viewer-corba. If not, see <http://www.gnu.org/licenses/>.

#include "gepetto/gui/osgwidget.hh"
#include "gepetto/gui/mainwindow.hh"
#include <gepetto/gui/pick-handler.hh>

#include <boost/regex.hpp>

#include <QFileDialog>
#include <QProcess>
#include <QTextBrowser>

#include <osg/Camera>

#include <osg/DisplaySettings>
#include <osg/Geode>
#include <osg/Material>
#include <osg/Shape>
#include <osg/ShapeDrawable>
#include <osg/StateSet>

#include <osgGA/EventQueue>
#include <osgGA/KeySwitchMatrixManipulator>
#include <osgGA/TrackballManipulator>

#include <osgUtil/IntersectionVisitor>
#include <osgUtil/PolytopeIntersector>

#include <osgViewer/View>
#include <osgViewer/ViewerEventHandlers>

#include <cassert>

#include <stdexcept>
#include <vector>

#include <QDebug>
#include <QKeyEvent>
#include <QWheelEvent>
#include <QVBoxLayout>

#include <gepetto/viewer/urdf-parser.h>
#include <gepetto/viewer/OSGManipulator/keyboard-manipulator.h>

#include <gepetto/gui/windows-manager.hh>
#include <gepetto/gui/selection-event.hh>

namespace gepetto {
  namespace gui {
    namespace
    {

      QRect makeRectangle( const QPoint& first, const QPoint& second )
      {
        // Relative to the first point, the second point may be in either one of the
        // four quadrants of an Euclidean coordinate system.
        //
        // We enumerate them in counter-clockwise order, starting from the lower-right
        // quadrant that corresponds to the default case:
        //
        //            |
        //       (3)  |  (4)
        //            |
        //     -------|-------
        //            |
        //       (2)  |  (1)
        //            |

        if( second.x() >= first.x() && second.y() >= first.y() )
          return QRect( first, second );
        else if( second.x() < first.x() && second.y() >= first.y() )
          return QRect( QPoint( second.x(), first.y() ), QPoint( first.x(), second.y() ) );
        else if( second.x() < first.x() && second.y() < first.y() )
          return QRect( second, first );
        else if( second.x() >= first.x() && second.y() < first.y() )
          return QRect( QPoint( first.x(), second.y() ), QPoint( second.x(), first.y() ) );

        // Should never reach that point...
        return QRect();
      }

    }

    OSGWidget::OSGWidget(WindowsManagerPtr_t wm,
                         const std::string & name,
                         MainWindow *parent, Qt::WindowFlags f ,
                         osgViewer::ViewerBase::ThreadingModel threadingModel)
    : QWidget( parent, f )
    , graphicsWindow_()
    , wsm_ (wm)
    , pickHandler_ (new PickHandler (this, wsm_))
    , wid_ (-1)
    , wm_ ()
    , viewer_ (new osgViewer::Viewer)
    , screenCapture_ ()
    , process_ (new QProcess (this))
    , showPOutput_ (new QDialog (this, Qt::Dialog | Qt::WindowCloseButtonHint | Qt::WindowMinMaxButtonsHint))
    , pOutput_ (new QTextBrowser())
    {
      osg::DisplaySettings* ds = osg::DisplaySettings::instance().get();
      osg::ref_ptr <osg::GraphicsContext::Traits> traits_ptr (new osg::GraphicsContext::Traits(ds));
      traits_ptr->windowName = "Gepetto Viewer";
      traits_ptr->x = this->x();
      traits_ptr->y = this->y();
      traits_ptr->width = this->width();
      traits_ptr->height = this->height();
      traits_ptr->windowDecoration = false;
      traits_ptr->doubleBuffer = true;
      traits_ptr->vsync = true;
      //  traits_ptr->sharedContext = 0;

      graphicsWindow_ = new osgQt::GraphicsWindowQt ( traits_ptr );

      osg::Camera* camera = viewer_->getCamera();
      camera->setGraphicsContext( graphicsWindow_ );

      camera->setClearColor( osg::Vec4(0.2f, 0.2f, 0.6f, 1.0f) );
      camera->setViewport( new osg::Viewport(0, 0, traits_ptr->width, traits_ptr->height) );
      camera->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(traits_ptr->width)/static_cast<double>(traits_ptr->height), 1.0f, 10000.0f );

      viewer_->setKeyEventSetsDone(0);


      osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
      keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() );
      keyswitchManipulator->addMatrixManipulator( '2', "First person", new ::osgGA::KeyboardManipulator(graphicsWindow_));
      keyswitchManipulator->selectMatrixManipulator (0);
      viewer_->setCameraManipulator( keyswitchManipulator.get() );

      screenCapture_ = new osgViewer::ScreenCaptureHandler (
            new osgViewer::ScreenCaptureHandler::WriteToFile (
              parent->settings_->captureDirectory + "/" + parent->settings_->captureFilename,
              parent->settings_->captureExtension),
            1);
      viewer_->addEventHandler(screenCapture_);
      viewer_->addEventHandler(new osgViewer::HelpHandler);
      viewer_->addEventHandler(pickHandler_);

      wid_ = wm->createWindow (name, viewer_, graphicsWindow_.get());
      wm_ = wsm_->getWindowManager (wid_);

      viewer_->setThreadingModel(threadingModel);

      osgQt::GLWidget* glWidget = graphicsWindow_->getGLWidget();
      //glWidget->setForwardKeyEvents(true);
      QVBoxLayout* hblayout = new QVBoxLayout (this);
      hblayout->setContentsMargins(1,1,1,1);
      setLayout (hblayout);
      hblayout->addWidget(glWidget);
      setMinimumSize(10,10);

      connect( &timer_, SIGNAL(timeout()), this, SLOT(update()) );
      timer_.start(parent->settings_->refreshRate);

      // Setup widgets to record movies.
      process_->setProcessChannelMode(QProcess::MergedChannels);
      connect (process_, SIGNAL (readyReadStandardOutput ()), SLOT (readyReadProcessOutput()));
      showPOutput_->setModal(false);
      showPOutput_->setLayout(new QHBoxLayout ());
      showPOutput_->layout()->addWidget(pOutput_);
    }

    OSGWidget::~OSGWidget()
    {
      viewer_->setDone(true);
      viewer_->removeEventHandler(pickHandler_);
      pickHandler_ = NULL;
      wm_.reset();
      wsm_.reset();
    }

    void OSGWidget::paintEvent(QPaintEvent*)
    {
      wsm_->osgFrameMutex().lock();
      viewer_->frame();
      wsm_->osgFrameMutex().unlock();
    }

    graphics::WindowsManager::WindowID OSGWidget::windowID() const
    {
      return wid_;
    }

    graphics::WindowManagerPtr_t OSGWidget::window() const
    {
      return wm_;
    }

    WindowsManagerPtr_t OSGWidget::osg() const
    {
      return wsm_;
    }

    void OSGWidget::onHome()
    {
      viewer_->home ();
    }

    void OSGWidget::addFloor()
    {
      wsm_->addFloor("hpp-gui/floor");
    }

    void OSGWidget::toggleCapture (bool active)
    {
      MainWindow* main = MainWindow::instance();
      if (active) {
        QDir tmp ("/tmp");
        tmp.mkpath ("gepetto-gui/record"); tmp.cd("gepetto-gui/record");
        foreach (QString f, tmp.entryList(QStringList() << "img_0_*.jpeg", QDir::Files))
          tmp.remove(f);
        QString path = tmp.absoluteFilePath("img");
        const char* ext = "jpeg";
        osg ()->startCapture(windowID(), path.toLocal8Bit().data(), ext);
        main->log("Saving images to " + path + "_*." + ext);
      } else {
        osg()->stopCapture(windowID());
        QString outputFile = QFileDialog::getSaveFileName(this, tr("Save video to"), "untitled.mp4");
        if (!outputFile.isNull()) {
          if (QFile::exists(outputFile))
            QFile::remove(outputFile);
          QString avconv = "avconv";

          QStringList args;
          QString input = "/tmp/gepetto-gui/record/img_0_%d.jpeg";
          args << "-r" << "50"
            << "-i" << input
            << "-vf" << "scale=trunc(iw/2)*2:trunc(ih/2)*2"
            << "-r" << "25"
            << "-vcodec" << "libx264"
            << outputFile;
          qDebug () << args;

          showPOutput_->setWindowTitle(avconv + " " + args.join(" "));
          pOutput_->clear();
          showPOutput_->resize(main->size() / 2);
          showPOutput_->show();
          process_->start(avconv, args);
        }
      }
    }

    void OSGWidget::readyReadProcessOutput()
    {
      pOutput_->append(process_->readAll());
    }
  } // namespace gui
} // namespace gepetto
<file_sep>/plugins/pyqcustomplot/decorator.hh
#include <qcustomplot.h>

#include <QObject>

void registerQCustomPlot ();

class QCustomPlotDecorator : public QObject
{
  Q_OBJECT
  public Q_SLOTS:
    /// \name QCustomPlot
    /// \{
    QCustomPlot* new_QCustomPlot(QWidget* parent = 0)
    {
      return new QCustomPlot(parent);
    }
    void delete_QCustomPlot(QCustomPlot* o) //delete QCustomPlot object
    {
      delete o;
    }
    void clearGraphs(QCustomPlot* o)
    {
      o->clearGraphs();
    }

    QCPGraph* addGraph(QCustomPlot* o)
    {
      return o->addGraph();
    }
    void addPlottable(QCustomPlot* o, QCPAbstractPlottable* ap)
    {
      o->addPlottable(ap);
    }

    QCPGraph* graph(QCustomPlot* o, int graphnum)
    {
      return o->graph(graphnum);
    }
    void replot (QCustomPlot* o) //replot object to visualise new data
    {
      o->replot();
    }
    void show (QCustomPlot* o) //open new window with graph
    {
      o->show();
    }
    void setWindowTitle(QCustomPlot* o,QString title) //set title of window of graph
    {
      o->setWindowTitle(title);
    }
    void rescaleAxes(QCustomPlot* o, bool v = true) //rescale axis automatically if data does not fit
    {
      o->rescaleAxes(v);
    }
    QCPLayoutGrid* plotLayout (QCustomPlot* o) { return o->plotLayout (); }
    void setAutoAddPlottableToLegend (QCustomPlot* o, bool v)
    {
      o->setAutoAddPlottableToLegend (v);
    }
    /// \param interaction See QCP::Interaction
    void setInteraction(QCustomPlot* o, int interaction, bool enabled = true)
    {
      o->setInteraction((QCP::Interaction)interaction, enabled);
    }
    QCPAxis* xAxis  (QCustomPlot* o) { return o->xAxis ; }
    QCPAxis* xAxis2 (QCustomPlot* o) { return o->xAxis2; }
    QCPAxis* yAxis  (QCustomPlot* o) { return o->yAxis ; }
    QCPAxis* yAxis2 (QCustomPlot* o) { return o->yAxis2; }
    QCPLegend* legend (QCustomPlot* o) { return o->legend; }
    QCPAxisRect* axisRect (QCustomPlot* o, int index=0) { return o->axisRect(index); }
    /// \}

    /// \name QCPAxis
    /// \{
    int selectedParts(const QCPAxis* a)
    {
      return a->selectedParts();
    }
    void setLabel(QCPAxis* a, const QString text)
    {
      a->setLabel(text);
    }
    void setRange(QCPAxis* a, double position, double size)
    {
      a->setRange(position, size);
    }
    void setAutoTicks(QCPAxis* a, bool on)
    {
      a->setAutoSubTicks(on);
    }
    void setAutoTickLabels(QCPAxis* a, bool on)
    {
      a->setAutoTickLabels(on);
    }
    void setTickVector(QCPAxis* a, const QVector<double> &ticks)
    {
      a->setTickVector(ticks);
    }
    void setTickVectorLabels(QCPAxis* a, const QVector<QString> &labels)
    {
      a->setTickVectorLabels(labels);
    }
    void setTickLength(QCPAxis* a, int inside, int outside)
    {
      a->setTickLength(inside,outside);
    }
    void setSubTickLength(QCPAxis* a, int inside, int outside)
    {
      a->setSubTickLength(inside, outside);
    }
    double pixelToCoord(QCPAxis* a, double pixel)
    {
      return a->pixelToCoord(pixel);
    }
    /// \}

    /// \name QCPGraph
    /// \{
    QCPGraph* new_QCPGraph (QCPAxis* key, QCPAxis* value) { return new QCPGraph (key, value); }
    void delete_QCPGraph (QCPGraph* g) { delete g; }
    void setData (QCPGraph* g, const QVector<double> &keys, const QVector<double> &values)
    {
      g->setData(keys,values);
    }
    void addData (QCPGraph* g, const QVector<double> &keys, const QVector<double> &values)
    {
      g->addData(keys,values);
    }
    void addData (QCPGraph* g, const double &key, const double &value)
    {
      g->addData(key,value);
    }
    void clearData (QCPGraph* o) { o->clearData (); }
    /// \}

    /// \name QCPCurve
    /// \{
    QCPCurve* new_QCPCurve (QCPAxis* key, QCPAxis* value) { return new QCPCurve (key, value); }
    void delete_QCPCurve (QCPCurve* g) { delete g; }
    void setData (QCPCurve* c, const QVector<double> &keys, const QVector<double> &values)
    {
      c->setData(keys,values);
    }
    void addData (QCPCurve* c, const QVector<double> &ts, const QVector<double> &keys, const QVector<double> &values)
    {
      c->addData(ts, keys,values);
    }
    void clearData (QCPCurve* o) { o->clearData (); }
    /// \}

    /// \name QCPBars
    /// \{
    QCPBars* new_QCPBars (QCPAxis* key, QCPAxis* value) { return new QCPBars (key, value); }
    void delete_QCPBars (QCPBars* g) { delete g; }
    void setData (QCPBars* c, const QVector<double> &keys, const QVector<double> &values)
    {
      c->setData(keys,values);
    }
    void addData (QCPBars* c, const QVector<double> &keys, const QVector<double> &values)
    {
      c->addData(keys,values);
    }
    void clearData (QCPBars* o) { o->clearData (); }
    /// \}

    /// \name QCPAbstractPlottable
    /// \{
    void rescaleAxes(QCPAbstractPlottable* ap, bool v = true)
    {
      ap->rescaleAxes(v);
    }
    void setName (QCPAbstractPlottable* ap, const QString &n)
    {
      ap->setName(n);
    }
    void setPen (QCPAbstractPlottable* ap, const QPen &pen)
    {
      ap->setPen(pen);
    }
    /// \}

    /// \name QCPLayerable
    /// \{
    void setVisible (QCPLayerable* l, const bool &v)
    {
      l->setVisible(v);
    }
    /// \}

    /// \name QCPLayoutGrid
    /// \{
    void insertRow (QCPLayoutGrid* lg, int row) //insert row above graph
    {
      lg->insertRow(row);
    }
    void insertColumn (QCPLayoutGrid* lg, int column) //insert column above graph
    {
      lg->insertColumn(column);
    }
    void addElement (QCPLayoutGrid* lg, int row, int column, QCPLayoutElement *element) //add text to graph at row,column
    {
      lg->addElement(row,column,element);
    }
    /// \}

    /// \name QCPAxisRect
    /// \{
    void setRangeZoomAxes (QCPAxisRect* ar, QCPAxis* horizontal, QCPAxis* vertical)
    {
      ar->setRangeZoomAxes (horizontal, vertical);
    }
    /// \}
};
