1 #ifndef LIBR2C2_OBJECT_H_
2 #define LIBR2C2_OBJECT_H_
5 #include "objecttype.h"
15 sigc::signal<void> signal_moved;
23 Object(Layout &l): layout(l) { }
27 virtual Object *clone(Layout * = 0) const = 0;
28 virtual const ObjectType &get_type() const = 0;
29 Layout &get_layout() const { return layout; }
30 virtual void set_position(const Vector &) = 0;
31 virtual void set_rotation(const Angle &) = 0;
32 virtual void set_tilt(const Angle &) = 0;
33 const Vector &get_position() const { return position; }
34 const Angle &get_rotation() const { return rotation; }
35 const Angle &get_tilt() const { return tilt; }
36 virtual Object *get_parent() const { return 0; }
38 virtual unsigned get_n_snap_nodes() const { return 0; }
39 virtual Snap get_snap_node(unsigned) const;
40 virtual bool snap(Snap &, float, SnapType = SNAP_DEFAULT) const;
41 virtual bool snap_to(const Object &, float, SnapType = SNAP_DEFAULT);
43 virtual SnapType get_default_snap_type_to(const Object &) const { return NO_SNAP; }
46 virtual unsigned get_n_link_slots() const { return 0; }
47 virtual Object *get_link(unsigned) const;
48 virtual int get_link_slot(const Object &) const { return -1; }
49 virtual bool link_to(Object &) { return false; }
50 virtual bool break_link(Object &);
51 virtual bool break_link(unsigned) { return false; }
52 virtual void break_links();
54 virtual bool collide_ray(const Ray &) const;
55 virtual BoundingBox get_bounding_box() const;