Changeset 286 in flair-src for trunk/lib/FlairMeta/src/MetaVrpnObject.cpp


Ignore:
Timestamp:
01/08/19 10:13:03 (3 years ago)
Author:
Sanahuja Guillaume
Message:

draw vrpn axis in simulator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairMeta/src/MetaVrpnObject.cpp

    r214 r286  
    1818
    1919#include "MetaVrpnObject.h"
    20 #include "VrpnClient.h"
    2120#include <EulerDerivative.h>
    2221#include <LowPassFilter.h>
     
    3837namespace meta {
    3938
    40 MetaVrpnObject::MetaVrpnObject(string name)
    41     : VrpnObject( name, GetVrpnClient()->GetTabWidget()) {
    42   ConstructorCommon(name);
     39MetaVrpnObject::MetaVrpnObject(string name,VrpnClient *client)
     40    : VrpnObject( name, client->GetTabWidget(),client) {
     41  ConstructorCommon(name,client);
    4342}
    4443
    45 MetaVrpnObject::MetaVrpnObject(std::string name,
    46                                uint8_t id)
    47     : VrpnObject(name, id, GetVrpnClient()->GetTabWidget()) {
    48   ConstructorCommon( name);
     44MetaVrpnObject::MetaVrpnObject(std::string name,uint8_t id,VrpnClient *client)
     45    : VrpnObject(name, id, client->GetTabWidget(),client) {
     46  ConstructorCommon( name,client);
    4947}
    5048
    51 void MetaVrpnObject::ConstructorCommon(string name) {
     49void MetaVrpnObject::ConstructorCommon(string name,VrpnClient *client) {
    5250  cvmatrix_descriptor *desc = new cvmatrix_descriptor(7, 1);
    5351  for (int i = 0; i < desc->Rows(); i++) {
     
    5755  delete desc;
    5856
    59   pbas = new LowPassFilter(this, GetVrpnClient()->GetLayout()->NewRow(),
     57  pbas = new LowPassFilter(this, client->GetLayout()->NewRow(),
    6058                           name + " Passe bas", prev_value);
    6159  delete prev_value;
     
    6866  delete desc;
    6967
    70   euler = new EulerDerivative(pbas, GetVrpnClient()->GetLayout()->NewRow(),
     68  euler = new EulerDerivative(pbas, client->GetLayout()->NewRow(),
    7169                              name + "_euler", prev_value);
    7270  delete prev_value;
     
    7977  vz_opti_plot->AddCurve(euler->GetMatrix()->Element(6));
    8078
    81   plot_tab = new Tab(GetVrpnClient()->GetTabWidget(), "Mesures (xy) " + name);
     79  plot_tab = new Tab(client->GetTabWidget(), "Mesures (xy) " + name);
    8280  xy_plot = new DataPlot2D(plot_tab->NewRow(), "xy", "y", -5, 5, "x", -5, 5);
    8381  xy_plot->AddCurve(Output()->Element(5, 0), Output()->Element(4, 0));
Note: See TracChangeset for help on using the changeset viewer.