Skip to content
Snippets Groups Projects
Commit def5326d authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

- check_?_axis

parent fea4d381
No related branches found
No related tags found
1 merge request!931start cleanup of IHistogram internals
......@@ -54,14 +54,12 @@ size_t IHistogram::getTotalNumberOfBins() const
const IAxis& IHistogram::xAxis() const
{
check_x_axis();
return m_data->axis(0);
return m_frame->axis(0);
}
const IAxis& IHistogram::yAxis() const
{
check_y_axis();
return m_data->axis(1);
return m_frame->axis(1);
}
double IHistogram::xMin() const
......@@ -114,24 +112,22 @@ size_t IHistogram::findGlobalBin(double x, double y) const
size_t IHistogram::xAxisIndex(size_t i) const
{
return m_data->projectedIndex(i, 0);
return m_frame->projectedIndex(i, 0);
}
size_t IHistogram::yAxisIndex(size_t i) const
{
return m_data->projectedIndex(i, 1);
return m_frame->projectedIndex(i, 1);
}
double IHistogram::xAxisValue(size_t i)
{
check_x_axis();
return m_data->projectedCoord(i, 0);
return m_frame->projectedCoord(i, 0);
}
double IHistogram::yAxisValue(size_t i)
{
check_y_axis();
return m_data->projectedCoord(i, 1);
return m_frame->projectedCoord(i, 1);
}
double IHistogram::binContent(size_t i) const
......@@ -242,26 +238,6 @@ std::vector<double> IHistogram::meanVector() const
return result;
}
void IHistogram::check_x_axis() const
{
if (rank() < 1) {
std::ostringstream message;
message << "IHistogram::check_x_axis() -> Error. X-xis does not exist. ";
message << "Rank of histogram " << rank() << "." << std::endl;
throw std::runtime_error(message.str());
}
}
void IHistogram::check_y_axis() const
{
if (rank() < 2) {
std::ostringstream message;
message << "IHistogram::check_y_axis() -> Error. Y-axis does not exist. ";
message << "Rank of histogram " << rank() << "." << std::endl;
throw std::runtime_error(message.str());
}
}
void IHistogram::init_from_data(const Powerfield<double>& source)
{
if (rank() != source.rank()) {
......
......@@ -170,8 +170,6 @@ public:
std::vector<double> meanVector() const;
protected:
void check_x_axis() const;
void check_y_axis() const;
void init_from_data(const Powerfield<double>& source);
double binData(size_t i, DataType dataType) const;
std::vector<double> getDataVector(DataType dataType) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment