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

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

simulator

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