source: flair-src/trunk/lib/FlairSensorActuator/src/VrpnObject.cpp @ 214

Last change on this file since 214 was 214, checked in by Sanahuja Guillaume, 4 years ago

matrix

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