X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fobject.h;h=f8e895848f7ef17e17c59c1f535962a7a2dff12b;hb=0c1214ad0680c3bf65c1ee5f366dbafabc9d188d;hp=8ce521ab5366df54375973e3db4715e11cc0c81e;hpb=b88d3630a0e3fdd763db018bbe5dbfe3180a95f2;p=r2c2.git diff --git a/source/libr2c2/object.h b/source/libr2c2/object.h index 8ce521a..f8e8958 100644 --- a/source/libr2c2/object.h +++ b/source/libr2c2/object.h @@ -11,10 +11,14 @@ class Layout; class Object { +public: + sigc::signal signal_moved; + protected: Layout &layout; Vector position; - float rotation; + Angle rotation; + Angle tilt; Object(Layout &l): layout(l) { } public: @@ -24,9 +28,11 @@ 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; + virtual void set_tilt(const Angle &) = 0; const Vector &get_position() const { return position; } - float get_rotation() const { return rotation; } + const Angle &get_rotation() const { return rotation; } + const Angle &get_tilt() const { return tilt; } virtual Object *get_parent() const { return 0; } virtual unsigned get_n_snap_nodes() const { return 0; } @@ -37,7 +43,16 @@ protected: virtual SnapType get_default_snap_type_to(const Object &) const { return NO_SNAP; } public: - virtual bool collide_ray(const Vector &, const Vector &) const = 0; + 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 Ray &) const; + virtual BoundingBox get_bounding_box() const; }; } // namespace R2C2