color = c;
for(PathMap::const_iterator i=paths.begin(); i!=paths.end(); ++i)
{
- float intensity = 0.5+train.get_block_allocator().is_block_current(*i->first)*0.5;
+ GL::Color block_color = get_color_for_block(*i->first);
for(PathList::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
- (*j)->set_color(color*intensity);
+ (*j)->set_color(block_color);
}
}
+GL::Color Allocation3D::get_color_for_block(const Block &block) const
+{
+ float intensity = 0.25+train.get_block_allocator().is_block_current(block)*0.75;
+ return color*intensity;
+}
+
void Allocation3D::block_reserved(Block &block, Train *t)
{
if(t==&train)
return;
PathList &bpaths = paths[&block];
+ GL::Color block_color = get_color_for_block(block);
const Block::TrackSet &tracks = block.get_tracks();
for(Block::TrackSet::const_iterator i=tracks.begin(); i!=tracks.end(); ++i)
{
Path3D *path = new Path3D(layout.get_3d(**i));
bpaths.push_back(path);
path->set_layer(1);
- float intensity = 0.5+train.get_block_allocator().is_block_current(block)*0.5;
- path->set_color(color*intensity);
+ path->set_color(block_color);
path->set_automatic();
}
}
Allocation3D(Layout3D &, Train &);
void set_color(const Msp::GL::Color &);
-
private:
+ Msp::GL::Color get_color_for_block(const Block &) const;
+
void block_reserved(Block &, Train *);
void train_advanced(Block &);
};
{
GL::MeshBuilder bld(icon.background);
- bld.color(0.2f, 0.2f, 0.2f, 0.7f);
+ bld.color(0.05f, 0.05f, 0.05f, 0.7f);
bld.begin(GL::TRIANGLE_FAN);
bld.vertex(0.4, 0.5);