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

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

up

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