[3] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[3] | 4 | // %flair:license}
|
---|
| 5 | // created: 2013/04/03
|
---|
| 6 | // filename: VrpnObject.cpp
|
---|
| 7 | //
|
---|
[122] | 8 | // author: César Richard, Guillaume Sanahuja
|
---|
[3] | 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"
|
---|
[214] | 20 | #include <Matrix.h>
|
---|
[3] | 21 |
|
---|
| 22 | using std::string;
|
---|
| 23 | using namespace flair::core;
|
---|
| 24 | using namespace flair::gui;
|
---|
| 25 |
|
---|
[15] | 26 | namespace flair {
|
---|
| 27 | namespace sensor {
|
---|
[3] | 28 |
|
---|
[122] | 29 | VrpnObject::VrpnObject(string name,
|
---|
[286] | 30 | const TabWidget *tab,VrpnClient *client)
|
---|
| 31 | : IODevice(client, name) {
|
---|
| 32 | pimpl_ = new VrpnObject_impl(this, name, -1, tab,client);
|
---|
[15] | 33 | AddDataToLog(pimpl_->output);
|
---|
[157] | 34 |
|
---|
| 35 | SetIsReady(true);
|
---|
[3] | 36 | }
|
---|
| 37 |
|
---|
[122] | 38 | VrpnObject::VrpnObject(string name, uint8_t id,
|
---|
[286] | 39 | const TabWidget *tab,VrpnClient *client)
|
---|
| 40 | : IODevice(client, name) {
|
---|
[15] | 41 | Warn("Creation of object %s with id %i\n", name.c_str(), id);
|
---|
[286] | 42 | pimpl_ = new VrpnObject_impl(this, name, id, tab,client);
|
---|
[15] | 43 | AddDataToLog(pimpl_->output);
|
---|
[157] | 44 |
|
---|
| 45 | SetIsReady(true);
|
---|
[3] | 46 | }
|
---|
| 47 |
|
---|
[140] | 48 | VrpnObject::~VrpnObject(void) {
|
---|
| 49 | delete pimpl_;
|
---|
| 50 | }
|
---|
[3] | 51 |
|
---|
[214] | 52 | Matrix *VrpnObject::Output(void) const { return pimpl_->output; }
|
---|
[3] | 53 |
|
---|
[214] | 54 | Matrix *VrpnObject::State(void) const { return pimpl_->state; }
|
---|
[3] | 55 |
|
---|
[15] | 56 | Tab *VrpnObject::GetPlotTab(void) const { return pimpl_->plot_tab; }
|
---|
[3] | 57 |
|
---|
[15] | 58 | DataPlot1D *VrpnObject::xPlot(void) const { return pimpl_->x_plot; }
|
---|
[3] | 59 |
|
---|
[15] | 60 | DataPlot1D *VrpnObject::yPlot(void) const { return pimpl_->y_plot; }
|
---|
[3] | 61 |
|
---|
[15] | 62 | DataPlot1D *VrpnObject::zPlot(void) const { return pimpl_->z_plot; }
|
---|
[3] | 63 |
|
---|
[15] | 64 | Time VrpnObject::GetLastPacketTime(void) const {
|
---|
| 65 | return pimpl_->output->DataTime();
|
---|
[3] | 66 | }
|
---|
| 67 |
|
---|
[15] | 68 | bool VrpnObject::IsTracked(unsigned int timeout_ms) const {
|
---|
| 69 | return pimpl_->IsTracked(timeout_ms);
|
---|
[3] | 70 | }
|
---|
| 71 |
|
---|
| 72 | void VrpnObject::GetQuaternion(Quaternion &quaternion) const {
|
---|
[15] | 73 | pimpl_->GetQuaternion(quaternion);
|
---|
[3] | 74 | }
|
---|
| 75 |
|
---|
[167] | 76 | void VrpnObject::GetPosition(Vector3Df &point) const {
|
---|
[15] | 77 | pimpl_->GetPosition(point);
|
---|
[3] | 78 | }
|
---|
| 79 |
|
---|
| 80 | } // end namespace sensor
|
---|
| 81 | } // end namespace flair
|
---|