source: flair-src/trunk/lib/FlairSimulator/src/Model.cpp@ 31

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

sources reformatted with flair-format-dir script

File size: 2.0 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5// created: 2013/03/25
6// filename: Model.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: classe definissant un modele a simuler
14//
15/*********************************************************************/
16
17#include "Model.h"
18#include "Model_impl.h"
19#include "Simulator.h"
20#include "Simulator_impl.h"
21#include <DoubleSpinBox.h>
22
23#ifdef GL
24#include "Gui.h"
25#include <ICameraSceneNode.h>
26using namespace irr;
27using namespace irr::scene;
28using namespace irr::core;
29#endif
30
31using namespace flair::core;
32using namespace flair::gui;
33
34namespace flair {
35namespace simulator {
36
37Model::Model(const Simulator *parent, std::string name)
38 : IODevice(parent, name) {
39#ifdef GL
40 pimpl_ =
41 new Model_impl(this, name, getGui()->getSceneManager(), parent->pimpl_);
42#else
43 pimpl_ = new Model_impl(this, name, parent->pimpl_);
44#endif
45 parent->pimpl_->models.push_back(this);
46}
47
48Model::~Model() { delete pimpl_; }
49#ifdef GL
50ISceneNode *Model::getSceneNode() const { return pimpl_; }
51/*
52only used by dbt, to rewrite using conversion functions (irrlicht <-> simulator)
53void Model::setPosition(Vector3D pos)
54{
55 //note that irrlicht frame is left handed
56 pimpl_->setPosition(ToIrrlichtScale(1)*vector3df(pos.y,pos.z,-pos.x));
57}
58*/
59void Model::setScale(float value) {
60 pimpl_->setScale(vector3df(value, value, value));
61}
62
63aabbox3d<f32> *Model::Box() const { return &(pimpl_->box); }
64
65AnimPoursuite *Model::getCamera(void) const { return pimpl_->animator; }
66
67void Model::setTriangleSelector(ITriangleSelector *selector) {
68
69 pimpl_->selector = selector;
70 pimpl_->setTriangleSelector(selector);
71}
72
73void Model::setCameraFarValue(float zf) { pimpl_->camera->setFarValue(zf); }
74#endif
75
76TabWidget *Model::GetTabWidget(void) const { return pimpl_->tabwidget; }
77
78float Model::dT(void) const { return pimpl_->dT->Value(); }
79
80} // end namespace simulator
81} // end namespace flair
Note: See TracBrowser for help on using the repository browser.