Skip to content
Snippets Groups Projects
Commit 95c32df8 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[example] Improve C++ free-functions.cc

parent 2e69ce3e
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@
#include <gepetto/viewer/corba/client.hh>
#include <gepetto/viewer/corba/conversions.hh>
#include <gepetto/viewer/corba/api.hh>
namespace gui = gepetto::viewer::corba;
......@@ -16,15 +17,21 @@ int main(int, const char **)
gui::connect ("windowName", true);
if (gui::connected()) gui::gui()->createWindow("window1");
if (gui::connected()) gui::gui()->addSphere ("window1/sphere", 0.5f, gui::white);
// Draw a single point
if (gui::connected())
gui::gui()->addSphere ("window1/point", 0.005f, gui::white);
#if __cplusplus >= 201103L
gui::applyConfiguration("window1/point",
gui::Transform { 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 1.f, });
gui::refresh();
if (gui::connected()) gui::gui()->addCurve("window1/points",
gepetto::viewer::corba::positionSeq ({ {0., 1., 0.}, {0., 1., 2.}, }),
gui::green);
#endif
if (gui::connected()) gui::gui()->refresh();
gui::refresh();
return 0;
}
#ifndef GEPETTO_VIEWER_CORBA_API_HH
#define GEPETTO_VIEWER_CORBA_API_HH
#include <gepetto/viewer/corba/client.hh>
namespace gepetto {
namespace viewer {
namespace corba {
#if __cplusplus >= 201103L
void applyConfiguration(const char* name, corbaserver::Transform&& t)
{
if (!connected()) return;
gui()->applyConfiguration(name, t);
}
#endif // __cplusplus > 201103L
void refresh()
{
if (!connected()) return;
gui()->refresh();
}
} //end of namespace corba
} //end of namespace viewer
} //end of namespace gepetto
#endif // GEPETTO_VIEWER_CORBA_API_HH
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment