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
9#include <iosfwd>
10#include <utility>
11
12namespace Mantid {
13
14namespace Kernel {
15class V3D;
16}
17
18namespace Geometry {
19class MeshObject;
20}
21namespace DataHandling {
22
23class MANTID_DATAHANDLING_DLL LoadAsciiStl : public LoadStl {
24public:
25 LoadAsciiStl(std::string filename, ScaleUnits scaleType)
26 : LoadStl(std::move(filename), std::ios_base::in, scaleType) {}
27 LoadAsciiStl(std::string filename, ScaleUnits scaleType, ReadMaterial::MaterialParameters params)
28 : LoadStl(std::move(filename), std::ios_base::in, scaleType, std::move(params)) {}
29 std::unique_ptr<Geometry::MeshObject> readShape() override;
30 static bool isAsciiSTL(const std::string &filename);
31
32private:
33 int m_lineNumber = 0;
34 bool readSTLTriangle(std::ifstream &file, Kernel::V3D &v1, Kernel::V3D &v2, Kernel::V3D &v3);
35 bool readSTLVertex(std::ifstream &file, Kernel::V3D &vertex);
36 bool readSTLLine(std::ifstream &file, std::string const &type);
37};
38
39} // namespace DataHandling
40} // namespace Mantid
LoadAsciiStl(std::string filename, ScaleUnits scaleType, ReadMaterial::MaterialParameters params)
Definition: LoadAsciiStl.h:27
LoadAsciiStl(std::string filename, ScaleUnits scaleType)
Definition: LoadAsciiStl.h:25
Class for 3D vectors.
Definition: V3D.h:34
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...
Definition: ReadMaterial.h:32