[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>
|
---|
| 25 | using namespace irr;
|
---|
| 26 | using namespace irr::scene;
|
---|
| 27 | using namespace irr::core;
|
---|
| 28 | #endif
|
---|
| 29 |
|
---|
| 30 | using namespace flair::core;
|
---|
| 31 | using namespace flair::gui;
|
---|
| 32 |
|
---|
[15] | 33 | namespace flair {
|
---|
| 34 | namespace simulator {
|
---|
| 35 |
|
---|
[158] | 36 | Model::Model(std::string name,uint32_t modelId)
|
---|
| 37 | : IODevice(getSimulator(), name) {
|
---|
| 38 | pimpl_ = new Model_impl(this, name,modelId);
|
---|
[8] | 39 | }
|
---|
| 40 |
|
---|
[15] | 41 | Model::~Model() { delete pimpl_; }
|
---|
[8] | 42 | #ifdef GL
|
---|
[15] | 43 | ISceneNode *Model::getSceneNode() const { return pimpl_; }
|
---|
[8] | 44 | /*
|
---|
| 45 | only used by dbt, to rewrite using conversion functions (irrlicht <-> simulator)
|
---|
| 46 | void 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] | 52 | void Model::setScale(float value) {
|
---|
| 53 | pimpl_->setScale(vector3df(value, value, value));
|
---|
[8] | 54 | }
|
---|
| 55 |
|
---|
[15] | 56 | aabbox3d<f32> *Model::Box() const { return &(pimpl_->box); }
|
---|
[8] | 57 |
|
---|
[69] | 58 | FollowMeCamera *Model::getFollowMeCamera(void) const { return pimpl_->camera; }
|
---|
[8] | 59 |
|
---|
[15] | 60 | void Model::setTriangleSelector(ITriangleSelector *selector) {
|
---|
[8] | 61 |
|
---|
[15] | 62 | pimpl_->selector = selector;
|
---|
| 63 | pimpl_->setTriangleSelector(selector);
|
---|
[8] | 64 | }
|
---|
| 65 |
|
---|
[69] | 66 | void Model::setCameraFarValue(float zf) { pimpl_->camera->getCameraSceneNode()->setFarValue(zf); }
|
---|
[8] | 67 | #endif
|
---|
| 68 |
|
---|
[15] | 69 | TabWidget *Model::GetTabWidget(void) const { return pimpl_->tabwidget; }
|
---|
[8] | 70 |
|
---|
[167] | 71 | double Model::dT(void) const { return pimpl_->dT->Value(); }
|
---|
[8] | 72 |
|
---|
[158] | 73 | int Model::GetId(void) const {
|
---|
| 74 | return pimpl_->modelId;
|
---|
| 75 | }
|
---|
| 76 |
|
---|
[8] | 77 | } // end namespace simulator
|
---|
| 78 | } // end namespace flair
|
---|