Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libstage
model_lightindicator.cc
Go to the documentation of this file.
1
#include "
stage.hh
"
2
3
using namespace
Stg
;
4
5
ModelLightIndicator::ModelLightIndicator
(
World
* world,
6
Model
* parent,
7
const
std::string& type ) :
8
Model
( world, parent, type ),
9
m_IsOn(false)
10
{
11
}
12
13
14
ModelLightIndicator::~ModelLightIndicator
()
15
{
16
}
17
18
19
void
ModelLightIndicator::SetState
(
bool
isOn)
20
{
21
m_IsOn
= isOn;
22
}
23
24
25
void
ModelLightIndicator::DrawBlocks
()
26
{
27
if
(
m_IsOn
)
28
{
29
Model::DrawBlocks
();
30
}
31
else
32
{
33
const
double
scaleFactor = 0.8;
34
35
Color
keep = this->
GetColor
();
36
Color
c = this->
GetColor
();
37
c.
r
*= scaleFactor;
38
c.
g
*= scaleFactor;
39
c.
b
*= scaleFactor;
40
41
this->
SetColor
( c );
42
Model::DrawBlocks
();
43
44
this->
SetColor
( keep );
45
}
46
}
Stg::Model
Model class
Definition:
stage.hh:1742
Stg::Model::DrawBlocks
virtual void DrawBlocks()
Definition:
model_draw.cc:251
Stg::World
World class
Definition:
stage.hh:814
Stg
The Stage library uses its own namespace.
Definition:
canvas.hh:8
Stg::ModelLightIndicator::ModelLightIndicator
ModelLightIndicator(World *world, Model *parent, const std::string &type)
Definition:
model_lightindicator.cc:5
Stg::ModelLightIndicator::~ModelLightIndicator
~ModelLightIndicator()
Definition:
model_lightindicator.cc:14
stage.hh
Stg::Model::GetColor
Color GetColor() const
Definition:
stage.hh:2362
Stg::ModelLightIndicator::DrawBlocks
virtual void DrawBlocks()
Definition:
model_lightindicator.cc:25
Stg::Color::r
double r
Definition:
stage.hh:200
Stg::Color::b
double b
Definition:
stage.hh:200
Stg::Color::g
double g
Definition:
stage.hh:200
Stg::Color
Definition:
stage.hh:197
Stg::ModelLightIndicator::SetState
void SetState(bool isOn)
Definition:
model_lightindicator.cc:19
Stg::ModelLightIndicator::m_IsOn
bool m_IsOn
Definition:
stage.hh:2569
Stg::Model::SetColor
void SetColor(Color col)
Definition:
model.cc:1260
stage
Author(s): Richard Vaughan
, Brian Gerkey
, Reed Hedges
, Andrew Howard
, Toby Collett
, Pooya Karimian
, Jeremy Asher
, Alex Couture-Beil
, Geoff Biggs
, Rich Mattes
, Abbas Sadat
autogenerated on Mon Jun 10 2019 15:06:09