]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/object.h
Perform check_slope automatically with certain operations
[r2c2.git] / source / libr2c2 / object.h
index 206ec336d8e1cb99b1dd26f9dad09ea9bd3907a3..33b99a1443acb3b2f7452c8236e91354ab5ed8a4 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "geometry.h"
 #include "objecttype.h"
+#include "snap.h"
 
 namespace R2C2 {
 
@@ -27,6 +28,23 @@ public:
        const Vector &get_position() const { return position; }
        float get_rotation() const { return rotation; }
        virtual Object *get_parent() const { return 0; }
+
+       virtual unsigned get_n_snap_nodes() const { return 0; }
+       virtual Snap get_snap_node(unsigned) const;
+       virtual bool snap(Snap &, float, SnapType = SNAP_DEFAULT) const;
+       virtual bool snap_to(const Object &, float, SnapType = SNAP_DEFAULT);
+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;
 };