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 <string.h>
|
---|
21 | #include <Matrix.h>
|
---|
22 |
|
---|
23 | using std::string;
|
---|
24 | using namespace flair::core;
|
---|
25 | using namespace flair::gui;
|
---|
26 |
|
---|
27 | namespace flair {
|
---|
28 | namespace sensor {
|
---|
29 |
|
---|
30 | VrpnObject::VrpnObject(string name,
|
---|
31 | const TabWidget *tab,VrpnClient *client)
|
---|
32 | : IODevice(client, name) {
|
---|
33 | pimpl_ = new VrpnObject_impl(this, name, -1, tab,client);
|
---|
34 | AddDataToLog(pimpl_->output);
|
---|
35 |
|
---|
36 | SetIsReady(true);
|
---|
37 | }
|
---|
38 |
|
---|
39 | VrpnObject::VrpnObject(string name, uint8_t id,
|
---|
40 | const TabWidget *tab,VrpnClient *client)
|
---|
41 | : IODevice(client, name) {
|
---|
42 | Warn("Creation of object %s with id %i\n", name.c_str(), id);
|
---|
43 | pimpl_ = new VrpnObject_impl(this, name, id, tab,client);
|
---|
44 | AddDataToLog(pimpl_->output);
|
---|
45 |
|
---|
46 | SetIsReady(true);
|
---|
47 | }
|
---|
48 |
|
---|
49 | VrpnObject::~VrpnObject(void) {
|
---|
50 | delete pimpl_;
|
---|
51 | }
|
---|
52 |
|
---|
53 | Matrix *VrpnObject::Output(void) const { return pimpl_->output; }
|
---|
54 |
|
---|
55 | Matrix *VrpnObject::State(void) const { return pimpl_->state; }
|
---|
56 |
|
---|
57 | Tab *VrpnObject::GetPlotTab(void) const { return pimpl_->plot_tab; }
|
---|
58 |
|
---|
59 | DataPlot1D *VrpnObject::xPlot(void) const { return pimpl_->x_plot; }
|
---|
60 |
|
---|
61 | DataPlot1D *VrpnObject::yPlot(void) const { return pimpl_->y_plot; }
|
---|
62 |
|
---|
63 | DataPlot1D *VrpnObject::zPlot(void) const { return pimpl_->z_plot; }
|
---|
64 |
|
---|
65 | Time VrpnObject::GetLastPacketTime(void) const {
|
---|
66 | return pimpl_->output->DataTime();
|
---|
67 | }
|
---|
68 |
|
---|
69 | bool VrpnObject::IsTracked(unsigned int timeout_ms) const {
|
---|
70 | return pimpl_->IsTracked(timeout_ms);
|
---|
71 | }
|
---|
72 |
|
---|
73 | void VrpnObject::GetQuaternion(Quaternion &quaternion) const {
|
---|
74 | pimpl_->GetQuaternion(quaternion);
|
---|
75 | }
|
---|
76 |
|
---|
77 | void VrpnObject::GetPosition(Vector3Df &point) const {
|
---|
78 | pimpl_->GetPosition(point);
|
---|
79 | }
|
---|
80 |
|
---|
81 | } // end namespace sensor
|
---|
82 | } // end namespace flair
|
---|