/* $Id$
This file is part of R²C²
-Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
+Copyright © 2006-2011 Mikkosoft Productions, Mikko Rasa
Distributed under the GPL
*/
void turnout_id(unsigned);
};
+ sigc::signal<void, unsigned, Track *> signal_link_changed;
sigc::signal<void, unsigned> signal_path_changed;
private:
Layout &layout;
const TrackType &type;
Block *block;
- Point pos;
+ Vector pos;
float rot;
float slope;
bool flex;
void set_block(Block *);
Block &get_block() const;
- void set_position(const Point &);
+ void set_position(const Vector &);
void set_rotation(float);
void set_slope(float);
void set_flex(bool);
- const Point &get_position() const { return pos; }
+ const Vector &get_position() const { return pos; }
float get_rotation() const { return rot; }
float get_slope() const { return slope; }
bool get_flex() const { return flex; }
unsigned get_active_path() const { return active_path; }
int get_endpoint_by_link(Track &) const;
- Point get_endpoint_position(unsigned) const;
+ Vector get_endpoint_position(unsigned) const;
float get_endpoint_direction(unsigned) const;
bool snap_to(Track &, bool, float = 0);
- bool snap(Point &, float &) const;
+ bool snap(Vector &, float &) const;
void break_link(Track &);
void break_links();
const std::vector<Track *> &get_links() const { return links; }
TrackPoint get_point(unsigned, unsigned, float) const;
TrackPoint get_point(unsigned, float) const;
+ bool collide_ray(const Vector &, const Vector &);
+
void save(std::list<Msp::DataFile::Statement> &) const;
private:
- void turnout_event(unsigned, bool);
+ void turnout_event(unsigned, unsigned);
};
} // namespace R2C2