#ifndef ACTIVEPOINT_H
#define ACTIVEPOINT_H
#include "vector.h"
#include "color.h"
#include "handle.h"
class ActivePoint: public Shared {
public:
typedef HandleT<ActivePoint> Handle;
Vector position;
Color color;
Real radius;
bool enabled;
bool visible;
bool active;
private:
ActivePoint(const ActivePoint&): ActivePoint() { }
ActivePoint& operator= (const ActivePoint&) { return *this; }
public:
ActivePoint(
const Vector &position,
const Color &color,
const Real &radius = 5,
bool enabled = true,
bool visible = true
):
position(position),
color(color),
radius(radius),
enabled(enabled),
visible(visible),
active()
{ }
explicit ActivePoint(
const Vector &position = Vector()
): ActivePoint(position, Color::white()) { }
bool is_inside(const Vector &p) const
{ return lesseq((position - p).lensqr(), radius*radius); }
};
#endif