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

Last change on this file since 10 was 10, checked in by Sanahuja Guillaume, 6 years ago

lic

File size: 2.1 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
35{
36namespace simulator
37{
38
39Model::Model(const Simulator* parent,std::string name) : IODevice(parent,name)
40{
41#ifdef GL
42 pimpl_=new Model_impl(this,name,getGui()->getSceneManager(),parent->pimpl_);
43#else
44 pimpl_=new Model_impl(this,name,parent->pimpl_);
45#endif
46 parent->pimpl_->models.push_back(this);
47}
48
49Model::~Model()
50{
51 delete pimpl_;
52}
53#ifdef GL
54ISceneNode* Model::getSceneNode() const
55{
56 return pimpl_;
57}
58/*
59only used by dbt, to rewrite using conversion functions (irrlicht <-> simulator)
60void Model::setPosition(Vector3D pos)
61{
62 //note that irrlicht frame is left handed
63 pimpl_->setPosition(ToIrrlichtScale(1)*vector3df(pos.y,pos.z,-pos.x));
64}
65*/
66void Model::setScale(float value)
67{
68 pimpl_->setScale(vector3df(value,value,value));
69}
70
71aabbox3d<f32> *Model::Box() const
72{
73 return &(pimpl_->box);
74}
75
76AnimPoursuite* Model::getCamera(void) const
77{
78 return pimpl_->animator;
79}
80
81void Model::setTriangleSelector(ITriangleSelector* selector) {
82
83 pimpl_->selector=selector;
84 pimpl_->setTriangleSelector(selector);
85}
86
87void Model::setCameraFarValue(float zf) {
88 pimpl_->camera->setFarValue(zf);
89}
90#endif
91
92TabWidget* Model::GetTabWidget(void) const
93{
94 return pimpl_->tabwidget;
95}
96
97float Model::dT(void) const
98{
99 return pimpl_->dT->Value();
100}
101
102} // end namespace simulator
103} // end namespace flair
Note: See TracBrowser for help on using the repository browser.