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

merge DetectorContext 2/n

parent 91909772
No related branches found
No related tags found
1 merge request!1142simplify ISimulation2D and IDetector, improve comments
......@@ -51,6 +51,7 @@ std::vector<const INode*> ISimulation2D::nodeChildren() const
void ISimulation2D::prepareSimulation()
{
m_active_indices = m_detector->active_indices();
m_detector_context = std::make_unique<DetectorContext>(m_detector.get());
}
......@@ -71,9 +72,7 @@ void ISimulation2D::setRegionOfInterest(double xlow, double ylow, double xup, do
size_t ISimulation2D::numberOfElements() const
{
if (!m_detector_context)
throw std::runtime_error("Error in numberOfElements(): no detector context");
return m_detector_context->numberOfElements();
return m_active_indices.size();
}
std::unique_ptr<IComputation> ISimulation2D::createComputation(const ReSample& re_sample,
......
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