diff options
| author | Franklin Wei <me@fwei.tk> | 2019-05-30 23:03:17 -0400 |
|---|---|---|
| committer | Franklin Wei <me@fwei.tk> | 2019-05-30 23:04:12 -0400 |
| commit | bc6dcafc3868d55d2653081d27f1eaf771c2d532 (patch) | |
| tree | 3fa44332d6981538247a85e0ad83d10c069ae431 /src/curve.h | |
| parent | cdfd5b37012935f7b0fb0a41ea8ca119ef8313b6 (diff) | |
| download | fieldviz-bc6dcafc3868d55d2653081d27f1eaf771c2d532.zip fieldviz-bc6dcafc3868d55d2653081d27f1eaf771c2d532.tar.gz fieldviz-bc6dcafc3868d55d2653081d27f1eaf771c2d532.tar.bz2 fieldviz-bc6dcafc3868d55d2653081d27f1eaf771c2d532.tar.xz | |
Generalize to 2-manifolds, refactor, improve
Moves some stuff to libfml
Diffstat (limited to 'src/curve.h')
| -rw-r--r-- | src/curve.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/curve.h b/src/curve.h index 891a6af..a3d743a 100644 --- a/src/curve.h +++ b/src/curve.h @@ -4,16 +4,19 @@ #include <cmath> #include <iostream> #include <fml/fml.h> + +#include "manifold.h" + using namespace fml; -/* All curves inherit this class */ -class Curve { +/* All curves inherit this class (which is empty because Manifold has + * everything we need). */ +class Curve : public Manifold { public: - virtual vec3 integrate(vec3 (*integrand)(vec3 s, vec3 ds), scalar delta) const = 0; - virtual const char *name() const = 0; + const int dimension() const { return 1; } }; -class LineSegment : Curve { +class LineSegment : public Curve { private: vec3 a, b; public: @@ -28,7 +31,7 @@ public: std::istream operator>>(std::istream &is, LineSegment &ls); -class Arc : Curve { +class Arc : public Curve { private: vec3 center; @@ -50,7 +53,7 @@ public: std::istream operator>>(std::istream &is, LineSegment &ls); -class Spiral : Curve { +class Spiral : public Curve { private: vec3 origin; @@ -75,7 +78,7 @@ public: std::istream operator>>(std::istream &is, LineSegment &ls); -class Toroid : Curve { +class Toroid : public Curve { private: vec3 origin; |