X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrack.h;h=7dfa7528081593a8982dd3975a25ab4d5fcef801;hb=7a36d396eded897c421424905b2c938d770df341;hp=883fb5eda506ab04a0614bbbebf1333560bbe41f;hpb=2910db1364914c0ab98a0f80250cc39137821577;p=r2c2.git diff --git a/source/libr2c2/track.h b/source/libr2c2/track.h index 883fb5e..7dfa752 100644 --- a/source/libr2c2/track.h +++ b/source/libr2c2/track.h @@ -54,13 +54,15 @@ public: void set_block(Block *); Block &get_block() const; virtual void set_position(const Vector &); - virtual void set_rotation(float); + virtual void set_rotation(const Angle &); void set_slope(float); void set_flex(bool); float get_slope() const { return slope; } bool get_flex() const { return flex; } +private: void check_slope(); +public: void set_turnout_id(unsigned); void set_sensor_id(unsigned); unsigned get_turnout_id() const { return turnout_id; } @@ -69,18 +71,23 @@ public: unsigned get_active_path() const { return active_path; } bool is_path_changing() const { return path_changing; } - int get_endpoint_by_link(Track &) const; - Vector get_endpoint_position(unsigned) const; - float get_endpoint_direction(unsigned) const; - bool snap_to(Track &, bool, float = 0); - bool snap(Vector &, float &) const; - void break_link(Track &); - void break_links(); - const std::vector &get_links() const { return links; } - Track *get_link(unsigned) const; TrackPoint get_point(unsigned, unsigned, float) const; TrackPoint get_point(unsigned, float) const; - TrackPoint get_nearest_point(const Vector &) const; + + virtual unsigned get_n_snap_nodes() const; + virtual Snap get_snap_node(unsigned) const; + virtual bool snap(Snap &, float, SnapType = SNAP_DEFAULT) const; +private: + virtual SnapType get_default_snap_type_to(const Object &) const; + +public: + virtual unsigned get_n_link_slots() const; + virtual Track *get_link(unsigned) const; + const std::vector &get_links() const { return links; } + virtual int get_link_slot(const Object &) const; + virtual bool link_to(Object &); + using Object::break_link; + virtual bool break_link(unsigned); virtual bool collide_ray(const Vector &, const Vector &) const;