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

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

up

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