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

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

sources reformatted with flair-format-dir script

File size: 2.0 KB
RevLine 
[10]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[10]4// %flair:license}
[8]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
[15]34namespace flair {
35namespace simulator {
36
37Model::Model(const Simulator *parent, std::string name)
38 : IODevice(parent, name) {
[8]39#ifdef GL
[15]40 pimpl_ =
41 new Model_impl(this, name, getGui()->getSceneManager(), parent->pimpl_);
[8]42#else
[15]43 pimpl_ = new Model_impl(this, name, parent->pimpl_);
[8]44#endif
[15]45 parent->pimpl_->models.push_back(this);
[8]46}
47
[15]48Model::~Model() { delete pimpl_; }
[8]49#ifdef GL
[15]50ISceneNode *Model::getSceneNode() const { return pimpl_; }
[8]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*/
[15]59void Model::setScale(float value) {
60 pimpl_->setScale(vector3df(value, value, value));
[8]61}
62
[15]63aabbox3d<f32> *Model::Box() const { return &(pimpl_->box); }
[8]64
[15]65AnimPoursuite *Model::getCamera(void) const { return pimpl_->animator; }
[8]66
[15]67void Model::setTriangleSelector(ITriangleSelector *selector) {
[8]68
[15]69 pimpl_->selector = selector;
70 pimpl_->setTriangleSelector(selector);
[8]71}
72
[15]73void Model::setCameraFarValue(float zf) { pimpl_->camera->setFarValue(zf); }
[8]74#endif
75
[15]76TabWidget *Model::GetTabWidget(void) const { return pimpl_->tabwidget; }
[8]77
[15]78float Model::dT(void) const { return pimpl_->dT->Value(); }
[8]79
80} // end namespace simulator
81} // end namespace flair
Note: See TracBrowser for help on using the repository browser.