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

Last change on this file since 338 was 167, checked in by Sanahuja Guillaume, 8 years ago

modifs pour template vectors

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 <DoubleSpinBox.h>
21
22#ifdef GL
[70]23#include "FollowMeCamera.h"
[8]24#include <ICameraSceneNode.h>
25using namespace irr;
26using namespace irr::scene;
27using namespace irr::core;
28#endif
29
30using namespace flair::core;
31using namespace flair::gui;
32
[15]33namespace flair {
34namespace simulator {
35
[158]36Model::Model(std::string name,uint32_t modelId)
37 : IODevice(getSimulator(), name) {
38 pimpl_ = new Model_impl(this, name,modelId);
[8]39}
40
[15]41Model::~Model() { delete pimpl_; }
[8]42#ifdef GL
[15]43ISceneNode *Model::getSceneNode() const { return pimpl_; }
[8]44/*
45only used by dbt, to rewrite using conversion functions (irrlicht <-> simulator)
46void Model::setPosition(Vector3D pos)
47{
48 //note that irrlicht frame is left handed
49 pimpl_->setPosition(ToIrrlichtScale(1)*vector3df(pos.y,pos.z,-pos.x));
50}
51*/
[15]52void Model::setScale(float value) {
53 pimpl_->setScale(vector3df(value, value, value));
[8]54}
55
[15]56aabbox3d<f32> *Model::Box() const { return &(pimpl_->box); }
[8]57
[69]58FollowMeCamera *Model::getFollowMeCamera(void) const { return pimpl_->camera; }
[8]59
[15]60void Model::setTriangleSelector(ITriangleSelector *selector) {
[8]61
[15]62 pimpl_->selector = selector;
63 pimpl_->setTriangleSelector(selector);
[8]64}
65
[69]66void Model::setCameraFarValue(float zf) { pimpl_->camera->getCameraSceneNode()->setFarValue(zf); }
[8]67#endif
68
[15]69TabWidget *Model::GetTabWidget(void) const { return pimpl_->tabwidget; }
[8]70
[167]71double Model::dT(void) const { return pimpl_->dT->Value(); }
[8]72
[158]73int Model::GetId(void) const {
74 return pimpl_->modelId;
75}
76
[8]77} // end namespace simulator
78} // end namespace flair
Note: See TracBrowser for help on using the repository browser.