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