source: flair-src/branches/sanscv/lib/FlairSimulator/src/Model.cpp@ 469

Last change on this file since 469 was 324, checked in by Sanahuja Guillaume, 5 years ago

removing opencv dependency

File size: 2.0 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 <DoubleSpinBox.h>
21
22#ifdef GL
23#include "FollowMeCamera.h"
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
33namespace flair {
34namespace simulator {
35
36Model::Model(std::string name,uint32_t modelId)
37 : IODevice(getSimulator(), name) {
38 pimpl_ = new Model_impl(this, name,modelId);
39}
40
41Model::~Model() { delete pimpl_; }
42#ifdef GL
43ISceneNode *Model::getSceneNode() const { return pimpl_; }
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*/
52void Model::setScale(float value) {
53 pimpl_->setScale(vector3df(value, value, value));
54}
55
56aabbox3d<f32> *Model::Box() const { return &(pimpl_->box); }
57
58FollowMeCamera *Model::getFollowMeCamera(void) const { return pimpl_->camera; }
59
60void Model::setTriangleSelector(ITriangleSelector *selector) {
61
62 pimpl_->selector = selector;
63 pimpl_->setTriangleSelector(selector);
64}
65
66void Model::setCameraFarValue(float zf) { pimpl_->camera->getCameraSceneNode()->setFarValue(zf); }
67#endif
68
69TabWidget *Model::GetTabWidget(void) const { return pimpl_->tabwidget; }
70
71double Model::dT(void) const { return pimpl_->dT->Value(); }
72
73int Model::GetId(void) const {
74 return pimpl_->modelId;
75}
76
77} // end namespace simulator
78} // end namespace flair
Note: See TracBrowser for help on using the repository browser.