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

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

matrix

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