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

Last change on this file since 3 was 3, checked in by Sanahuja Guillaume, 9 years ago

sensoractuator

File size: 2.2 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
23#include <cvmatrix.h>
24
25using std::string;
26using namespace flair::core;
27using namespace flair::gui;
28
29namespace flair
30{
31namespace sensor
32{
33
34VrpnObject::VrpnObject(const VrpnClient *parent,string name,const TabWidget* tab): IODevice(parent,name)
35{
36 pimpl_=new VrpnObject_impl(this,parent,name,-1,tab);
37 AddDataToLog(pimpl_->output);
38}
39
40VrpnObject::VrpnObject(const VrpnClient *parent,string name,uint8_t id,const TabWidget* tab): IODevice(parent,name)
41{
42 Warn("Creation of object %s with id %i\n",name.c_str(),id);
43 pimpl_=new VrpnObject_impl(this,parent,name,id,tab);
44 AddDataToLog(pimpl_->output);
45}
46
47VrpnObject::~VrpnObject(void)
48{
49 delete pimpl_;
50}
51
52cvmatrix *VrpnObject::Output(void) const
53{
54 return pimpl_->output;
55}
56
57cvmatrix *VrpnObject::State(void) const
58{
59 return pimpl_->state;
60}
61
62Tab* VrpnObject::GetPlotTab(void) const
63{
64 return pimpl_->plot_tab;
65}
66
67DataPlot1D* VrpnObject::xPlot(void) const
68{
69 return pimpl_->x_plot;
70}
71
72DataPlot1D* VrpnObject::yPlot(void) const
73{
74 return pimpl_->y_plot;
75}
76
77DataPlot1D* VrpnObject::zPlot(void) const
78{
79 return pimpl_->z_plot;
80}
81
82Time VrpnObject::GetLastPacketTime(void) const
83{
84 return pimpl_->output->DataTime();
85}
86
87bool VrpnObject::IsTracked(unsigned int timeout_ms) const
88{
89 return pimpl_->IsTracked(timeout_ms);
90}
91
92void VrpnObject::GetEuler(Euler &euler) const
93{
94 pimpl_->GetEuler(euler);
95}
96
97void VrpnObject::GetQuaternion(Quaternion &quaternion) const {
98 pimpl_->GetQuaternion(quaternion);
99}
100
101void VrpnObject::GetPosition(Vector3D &point) const
102{
103 pimpl_->GetPosition(point);
104}
105
106void VrpnObject::mainloop(void)
107{
108 pimpl_->mainloop();
109}
110
111} // end namespace sensor
112} // end namespace flair
Note: See TracBrowser for help on using the repository browser.