mpri-graphics-project/Implicit.hpp

24 lines
667 B
C++
Raw Normal View History

2018-02-06 19:07:07 +01:00
#pragma once
#include "common_structures.hpp"
class ImplicitSurface {
public:
virtual double operator() (double x, double y, double z) const = 0;
double operator()(const Point& pt) const;
Point getCenter() const { return center;}
2018-02-13 13:22:41 +01:00
const Color& get_color() const { return color; }
void set_color(const Color& _color) { color = _color; }
virtual Point location_hint() const = 0;
2018-02-13 13:22:41 +01:00
/// Compute the normal vector to the isosurface at `pt`
Point normal_at(const Point& pt) const;
protected:
Point center;
Color color;
ImplicitSurface(Point _center) : center(_center) {}
2018-02-07 17:57:49 +01:00
};