]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/track.h
Add a generic link interface as well
[r2c2.git] / source / libr2c2 / track.h
index 883fb5eda506ab04a0614bbbebf1333560bbe41f..7ad7dd141907d18d48ad382fb7d3b300e56f3eeb 100644 (file)
@@ -69,18 +69,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<Track *> &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<Track *> &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;