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

Last change on this file since 75 was 15, checked in by Bayard Gildas, 8 years ago

sources reformatted with flair-format-dir script

File size: 2.2 KB
RevLine 
[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//
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
[15]29namespace flair {
30namespace sensor {
[3]31
[15]32VrpnObject::VrpnObject(const VrpnClient *parent, string name,
33 const TabWidget *tab)
34 : IODevice(parent, name) {
35 pimpl_ = new VrpnObject_impl(this, parent, name, -1, tab);
36 AddDataToLog(pimpl_->output);
[3]37}
38
[15]39VrpnObject::VrpnObject(const VrpnClient *parent, string name, uint8_t id,
40 const TabWidget *tab)
41 : IODevice(parent, name) {
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);
[3]45}
46
[15]47VrpnObject::~VrpnObject(void) { delete pimpl_; }
[3]48
[15]49cvmatrix *VrpnObject::Output(void) const { return pimpl_->output; }
[3]50
[15]51cvmatrix *VrpnObject::State(void) const { return pimpl_->state; }
[3]52
[15]53Tab *VrpnObject::GetPlotTab(void) const { return pimpl_->plot_tab; }
[3]54
[15]55DataPlot1D *VrpnObject::xPlot(void) const { return pimpl_->x_plot; }
[3]56
[15]57DataPlot1D *VrpnObject::yPlot(void) const { return pimpl_->y_plot; }
[3]58
[15]59DataPlot1D *VrpnObject::zPlot(void) const { return pimpl_->z_plot; }
[3]60
[15]61Time VrpnObject::GetLastPacketTime(void) const {
62 return pimpl_->output->DataTime();
[3]63}
64
[15]65bool VrpnObject::IsTracked(unsigned int timeout_ms) const {
66 return pimpl_->IsTracked(timeout_ms);
[3]67}
68
[15]69void VrpnObject::GetEuler(Euler &euler) const { pimpl_->GetEuler(euler); }
70
[3]71void VrpnObject::GetQuaternion(Quaternion &quaternion) const {
[15]72 pimpl_->GetQuaternion(quaternion);
[3]73}
74
[15]75void VrpnObject::GetPosition(Vector3D &point) const {
76 pimpl_->GetPosition(point);
[3]77}
78
[15]79void VrpnObject::mainloop(void) { pimpl_->mainloop(); }
80
[3]81} // end namespace sensor
82} // end namespace flair
Note: See TracBrowser for help on using the repository browser.