WorldSim - 1.4.5
Utilities
Configuration
GA
NNFW
WorldSim
Total 99%
Experiments
Main Page
Classes
Files
File List
worldsim
include
wobject.h
1
/********************************************************************************
2
* WorldSim -- library for robot simulations *
3
* Copyright (C) 2008-2013 Gianluca Massera <emmegian@yahoo.it> *
4
* *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
9
* *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
14
* *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, write to the Free Software *
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
18
********************************************************************************/
19
20
#ifndef WOBJECT_H
21
#define WOBJECT_H
22
23
#include "worldsimconfig.h"
24
#include "ownable.h"
25
#include "wmatrix.h"
26
#include "wvector.h"
27
28
#include <QString>
29
#include <QColor>
30
31
namespace
farsa {
32
33
class
World;
34
39
class
FARSA_WSIM_API
WObject
:
public
QObject,
public
Ownable
{
40
Q_OBJECT
41
public
:
53
WObject
(
World
* world, QString name=
"unamed"
,
const
wMatrix
& tm =
wMatrix::identity
(),
bool
addToWorld =
true
);
55
virtual
~
WObject
();
57
const
wMatrix
& matrix()
const
;
59
void
setPosition(
const
wVector
& newpos );
61
void
setPosition(
real
x,
real
y,
real
z );
63
World
* world();
65
const
World
* world()
const
;
67
QString name()
const
;
69
void
setTexture( QString textureName );
71
QString texture()
const
;
77
void
setColor( QColor c );
79
void
setAlpha(
int
alpha );
81
QColor color()
const
;
83
bool
useColorTextureOfOwner()
const
;
85
void
setUseColorTextureOfOwner(
bool
b );
90
virtual
void
preUpdate();
95
virtual
void
postUpdate();
97
void
setMatrix(
const
wMatrix
& newm );
99
bool
isInvisible()
const
;
104
void
setInvisible(
bool
b );
114
void
drawLocalAxes(
bool
d);
121
bool
localAxesDrawn()
const
;
127
void
setLabel(QString label);
135
void
setLabel(QString label,
wVector
pos);
144
void
setLabel(QString label,
wVector
pos, QColor color);
150
const
QString& label()
const
;
156
void
setLabelPosition(
const
wVector
& pos);
162
const
wVector
& labelPosition()
const
;
168
void
setLabelColor(
const
QColor& color);
174
const
QColor& labelColor()
const
;
180
void
showLabel(
bool
show);
186
bool
labelShown()
const
;
187
protected
:
189
virtual
void
changedMatrix();
191
World
*
worldv
;
193
wMatrix
tm
;
195
QString
namev
;
197
QString
texturev
;
199
QColor
colorv
;
201
bool
invisible
;
203
bool
usecolortextureofowner
;
205
bool
localFrameOfReferenceDrawn
;
207
QString
labelv
;
209
wVector
labelpos
;
211
QColor
labelcol
;
213
bool
labeldrawn
;
214
};
215
216
}
// end namespace farsa
217
218
#endif