virtual ~Object3D() { }
virtual Point get_node() const = 0;
+ virtual bool is_visible() const = 0;
};
} // namespace Marklin
for(map<const Object3D *, Icon *>::const_iterator i=icons.begin(); i!=icons.end(); ++i)
{
+ if(!i->first->is_visible())
+ continue;
+
const Icon &icon = *i->second;
Point node = i->first->get_node();
Path3D &get_path() { return *path; }
virtual Point get_node() const;
+ virtual bool is_visible() const { return true; }
void apply_matrix() const;
virtual void render(const Msp::GL::Tag &) const;
return Point(p.x, p.y, p.z+0.01+vehicle.get_type().get_height());
}
+bool Vehicle3D::is_visible() const
+{
+ return vehicle.get_track();
+}
+
void Vehicle3D::render(const GL::Tag &tag) const
{
+ if(!vehicle.get_track())
+ return;
+
if(tag==0)
{
GL::PushMatrix push_mat;
Vehicle &get_vehicle() const { return vehicle; }
virtual Point get_node() const;
+ virtual bool is_visible() const;
virtual void render(const Msp::GL::Tag &) const;
};