]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/object.h
Make use of the mspmath library
[r2c2.git] / source / libr2c2 / object.h
index 8ce521ab5366df54375973e3db4715e11cc0c81e..d36104fa3deed081c5ae26cb29cf89b4e3cf9606 100644 (file)
@@ -14,7 +14,7 @@ class Object
 protected:
        Layout &layout;
        Vector position;
-       float rotation;
+       Angle rotation;
 
        Object(Layout &l): layout(l) { }
 public:
@@ -24,9 +24,9 @@ public:
        virtual const ObjectType &get_type() const = 0;
        Layout &get_layout() const { return layout; }
        virtual void set_position(const Vector &) = 0;
-       virtual void set_rotation(float) = 0;
+       virtual void set_rotation(const Angle &) = 0;
        const Vector &get_position() const { return position; }
-       float get_rotation() const { return rotation; }
+       const Angle &get_rotation() const { return rotation; }
        virtual Object *get_parent() const { return 0; }
 
        virtual unsigned get_n_snap_nodes() const { return 0; }
@@ -37,6 +37,14 @@ protected:
        virtual SnapType get_default_snap_type_to(const Object &) const { return NO_SNAP; }
 
 public:
+       virtual unsigned get_n_link_slots() const { return 0; }
+       virtual Object *get_link(unsigned) const;
+       virtual int get_link_slot(const Object &) const { return -1; }
+       virtual bool link_to(Object &) { return false; }
+       virtual bool break_link(Object &);
+       virtual bool break_link(unsigned) { return false; }
+       virtual void break_links();
+
        virtual bool collide_ray(const Vector &, const Vector &) const = 0;
 };