]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/slopetool.h
Split the Manipulator class into several Tools
[r2c2.git] / source / designer / slopetool.h
diff --git a/source/designer/slopetool.h b/source/designer/slopetool.h
new file mode 100644 (file)
index 0000000..b3b5e2b
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef SLOPETOOL_H_
+#define SLOPETOOL_H_
+
+#include "tool.h"
+#include "libr2c2/track.h"
+
+class SlopeTool: public Tool
+{
+private:
+       struct TrackOrder
+       {
+               R2C2::Track *track;
+               bool rev;
+
+               TrackOrder(R2C2::Track *t, bool r): track(t), rev(r) { }
+       };
+
+       std::list<R2C2::Track *> neighbors;
+       std::list<TrackOrder> tracks;
+       float total_length;
+
+public:
+       SlopeTool(Designer &, Msp::Input::Mouse &, const std::set<R2C2::Object *> &);
+
+       void even_slope(bool =false);
+       void flatten();
+private:
+       void set_slope(TrackOrder &, float, const R2C2::Angle &);
+};
+
+#endif