25#ifndef LSST_GAUSS2D_CENTROID_H
26#define LSST_GAUSS2D_CENTROID_H
34namespace lsst::gauss2d {
46 virtual double get_x()
const = 0;
48 virtual std::array<double, 2>
get_xy()
const = 0;
50 virtual double get_y()
const = 0;
52 virtual void set_x(
double x) = 0;
53 virtual void set_xy(
const std::array<double, 2>& xy) = 0;
54 virtual void set_y(
double y) = 0;
60 virtual std::string
repr(
bool name_keywords =
false, std::string_view namespace_separator
63 virtual std::string
str()
const override = 0;
76 double get_x()
const override;
77 std::array<double, 2>
get_xy()
const override;
78 double get_y()
const override;
80 void set_x(
double x)
override;
81 void set_xy(
const std::array<double, 2>& xy)
override;
82 void set_y(
double y)
override;
84 std::string
repr(
bool name_keywords, std::string_view namespace_separator)
const override;
85 std::string
str()
const override;
96 CentroidValues(std::shared_ptr<double> x, std::shared_ptr<double> y);
102 std::shared_ptr<double> _x;
103 std::shared_ptr<double> _y;
116 explicit Centroid(std::shared_ptr<CentroidData> data);
117 explicit Centroid(
double x = 0,
double y = 0);
130 double get_x()
const;
132 std::array<double, 2>
get_xy()
const;
134 double get_y()
const;
149 void set_x(
double x);
150 void set_xy(
const std::array<double, 2>& xy);
151 void set_y(
double y);
153 std::string
repr(
bool name_keywords =
false,
155 std::string
str()
const override;
157 bool operator==(
const Centroid& other)
const;
158 bool operator!=(
const Centroid& other)
const;
161 std::shared_ptr<CentroidData> _data;
Interface for an object storing Centroid data.
Definition centroid.h:43
virtual double get_x() const =0
Get the x value.
virtual double get_y() const =0
Get the y value.
virtual std::array< double, 2 > get_xy() const =0
Get the x and y values.
virtual std::string str() const override=0
Return a brief, human-readable string representation of this.
virtual std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override=0
double get_y() const override
Get the y value.
Definition centroid.cc:37
std::string str() const override
Return a brief, human-readable string representation of this.
Definition centroid.cc:51
std::string repr(bool name_keywords, std::string_view namespace_separator) const override
Definition centroid.cc:46
CentroidValues(std::shared_ptr< double > x, std::shared_ptr< double > y)
Construct a new Centroid Values object.
Definition centroid.cc:62
std::array< double, 2 > get_xy() const override
Get the x and y values.
Definition centroid.cc:36
double get_x() const override
Get the x value.
Definition centroid.cc:35
double get_y() const
Get the y value.
Definition centroid.cc:80
std::shared_ptr< Centroid > make_convolution(const Centroid &cen) const
Return the convolution of this with another centroid.
Definition centroid.cc:82
std::array< double, 2 > get_xy() const
Get the x and y values.
Definition centroid.cc:78
std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
Definition centroid.cc:96
std::string str() const override
Return a brief, human-readable string representation of this.
Definition centroid.cc:101
std::unique_ptr< Centroid > make_convolution_uniq(const Centroid &cen) const
Same as make_convolution(), but returning a unique_ptr.
Definition centroid.cc:85
const CentroidData & get_data() const
Get this centroid's data.
Definition centroid.cc:74
double get_x() const
Get the x value.
Definition centroid.cc:76
void convolve(const Centroid &cen)
Convolve this with another centroid.
Definition centroid.cc:69
static constexpr std::string_view CC_NAMESPACE_SEPARATOR
The C++ namespace separator.
Definition object.h:45