1 | // %flair:license{
|
---|
2 | // This file is part of the Flair framework distributed under the
|
---|
3 | // CECILL-C License, Version 1.0.
|
---|
4 | // %flair:license}
|
---|
5 | // created: 2013/04/03
|
---|
6 | // filename: VrpnObject.cpp
|
---|
7 | //
|
---|
8 | // author: César Richard, Guillaume Sanahuja
|
---|
9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
10 | //
|
---|
11 | // version: $Id: $
|
---|
12 | //
|
---|
13 | // purpose: Class for VRPN object
|
---|
14 | //
|
---|
15 | //
|
---|
16 | /*********************************************************************/
|
---|
17 |
|
---|
18 | #include "VrpnObject.h"
|
---|
19 | #include "VrpnObject_impl.h"
|
---|
20 | #include "VrpnClient.h"
|
---|
21 | #include <string.h>
|
---|
22 |
|
---|
23 | #include <cvmatrix.h>
|
---|
24 |
|
---|
25 | using std::string;
|
---|
26 | using namespace flair::core;
|
---|
27 | using namespace flair::gui;
|
---|
28 |
|
---|
29 | namespace flair {
|
---|
30 | namespace sensor {
|
---|
31 |
|
---|
32 | VrpnObject::VrpnObject(const VrpnClient *parent, string name,
|
---|
33 | const TabWidget *tab)
|
---|
34 | : IODevice(parent, name) {
|
---|
35 | pimpl_ = new VrpnObject_impl(this, parent, name, -1, tab);
|
---|
36 | AddDataToLog(pimpl_->output);
|
---|
37 | }
|
---|
38 |
|
---|
39 | VrpnObject::VrpnObject(const VrpnClient *parent, string name, uint8_t id,
|
---|
40 | const TabWidget *tab)
|
---|
41 | : IODevice(parent, name) {
|
---|
42 | Warn("Creation of object %s with id %i\n", name.c_str(), id);
|
---|
43 | pimpl_ = new VrpnObject_impl(this, parent, name, id, tab);
|
---|
44 | AddDataToLog(pimpl_->output);
|
---|
45 | }
|
---|
46 |
|
---|
47 | VrpnObject::~VrpnObject(void) { delete pimpl_; }
|
---|
48 |
|
---|
49 | cvmatrix *VrpnObject::Output(void) const { return pimpl_->output; }
|
---|
50 |
|
---|
51 | cvmatrix *VrpnObject::State(void) const { return pimpl_->state; }
|
---|
52 |
|
---|
53 | Tab *VrpnObject::GetPlotTab(void) const { return pimpl_->plot_tab; }
|
---|
54 |
|
---|
55 | DataPlot1D *VrpnObject::xPlot(void) const { return pimpl_->x_plot; }
|
---|
56 |
|
---|
57 | DataPlot1D *VrpnObject::yPlot(void) const { return pimpl_->y_plot; }
|
---|
58 |
|
---|
59 | DataPlot1D *VrpnObject::zPlot(void) const { return pimpl_->z_plot; }
|
---|
60 |
|
---|
61 | Time VrpnObject::GetLastPacketTime(void) const {
|
---|
62 | return pimpl_->output->DataTime();
|
---|
63 | }
|
---|
64 |
|
---|
65 | bool VrpnObject::IsTracked(unsigned int timeout_ms) const {
|
---|
66 | return pimpl_->IsTracked(timeout_ms);
|
---|
67 | }
|
---|
68 |
|
---|
69 | void VrpnObject::GetEuler(Euler &euler) const { pimpl_->GetEuler(euler); }
|
---|
70 |
|
---|
71 | void VrpnObject::GetQuaternion(Quaternion &quaternion) const {
|
---|
72 | pimpl_->GetQuaternion(quaternion);
|
---|
73 | }
|
---|
74 |
|
---|
75 | void VrpnObject::GetPosition(Vector3D &point) const {
|
---|
76 | pimpl_->GetPosition(point);
|
---|
77 | }
|
---|
78 |
|
---|
79 | void VrpnObject::mainloop(void) { pimpl_->mainloop(); }
|
---|
80 |
|
---|
81 | } // end namespace sensor
|
---|
82 | } // end namespace flair
|
---|