Mantid
Loading...
Searching...
No Matches
LoadAsciiStl.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
10#include <iosfwd>
11#include <utility>
12
13namespace Mantid {
14
15namespace Geometry {
16class MeshObject;
17}
18namespace DataHandling {
19
20class MANTID_DATAHANDLING_DLL LoadAsciiStl : public LoadStl {
21public:
22 LoadAsciiStl(std::string filename, ScaleUnits scaleType)
23 : LoadStl(std::move(filename), std::ios_base::in, scaleType) {}
24 LoadAsciiStl(std::string filename, ScaleUnits scaleType, ReadMaterial::MaterialParameters params)
25 : LoadStl(std::move(filename), std::ios_base::in, scaleType, std::move(params)) {}
26 std::unique_ptr<Geometry::MeshObject> readShape() override;
27 static bool isAsciiSTL(const std::string &filename);
28
29private:
30 int m_lineNumber = 0;
31 bool readSTLTriangle(std::ifstream &file, Kernel::V3D &v1, Kernel::V3D &v2, Kernel::V3D &v3);
32 bool readSTLVertex(std::ifstream &file, Kernel::V3D &vertex);
33 bool readSTLLine(std::ifstream &file, std::string const &type);
34};
35
36} // namespace DataHandling
37} // namespace Mantid
LoadAsciiStl(std::string filename, ScaleUnits scaleType, ReadMaterial::MaterialParameters params)
LoadAsciiStl(std::string filename, ScaleUnits scaleType)
Class for 3D vectors.
Definition V3D.h:35
Helper class which provides the Collimation Length for SANS instruments.
STL namespace.
This struct contains the parameters for constructing a material, and gives them a default value for e...