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

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

draw vrpn axis in simulator

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