Skip to content
Snippets Groups Projects
JSONInstrumentBuilder.h 1.26 KiB
Newer Older
Moore's avatar
Moore committed
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
//     NScD Oak Ridge National Laboratory, European Spallation Source
//     & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTID_NEXUSGEOMETRY_JSONINSTRUMENTBUILDER_H_
#define MANTID_NEXUSGEOMETRY_JSONINSTRUMENTBUILDER_H_

#include "MantidGeometry/Instrument_fwd.h"
Moore's avatar
Moore committed
#include "MantidNexusGeometry/DllConfig.h"
Moore's avatar
Moore committed
#include <memory>
Moore's avatar
Moore committed
#include <string>
#include <vector>
Moore's avatar
Moore committed

namespace Mantid {
namespace NexusGeometry {
Moore's avatar
Moore committed
class JSONGeometryParser;
struct Chopper;
Moore's avatar
Moore committed
/** JSONInstrumentBuilder : Builds in-memory instrument from json string
 * representing Nexus instrument geometry.
 */
class MANTID_NEXUSGEOMETRY_DLL JSONInstrumentBuilder {
public:
Moore's avatar
Moore committed
  explicit JSONInstrumentBuilder(const std::string &jsonGeometry);
Moore's avatar
Moore committed
  ~JSONInstrumentBuilder() = default;

  /// Choppers are not first-class citizens in mantid currently so forward this
  /// on from the parser
  const std::vector<Chopper> &choppers() const;
Moore's avatar
Moore committed
  Geometry::Instrument_const_uptr buildGeometry() const;
Moore's avatar
Moore committed

private:
Moore's avatar
Moore committed
  std::unique_ptr<JSONGeometryParser> m_parser;
Moore's avatar
Moore committed
};

} // namespace NexusGeometry
} // namespace Mantid

Moore's avatar
Moore committed
#endif /* MANTID_NEXUSGEOMETRY_JSONINSTRUMENTBUILDER_H_ */