Mantid
Loading...
Searching...
No Matches
LoadBinaryStl.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
8#include <utility>
9
10#include <utility>
11
13
14namespace Mantid {
15namespace Kernel {
16class BinaryStreamReader;
17}
18
19namespace Geometry {
20class MeshObject;
21}
22namespace DataHandling {
23
24class MANTID_DATAHANDLING_DLL LoadBinaryStl : public LoadStl {
25public:
26 static constexpr int HEADER_SIZE = 80;
27 static constexpr uint32_t TRIANGLE_DATA_SIZE = 50;
28 static constexpr uint32_t TRIANGLE_COUNT_DATA_SIZE = 4;
29 static constexpr uint32_t VECTOR_DATA_SIZE = 12;
30 static constexpr std::ios_base::openmode openMode = std::ios::in | std::ios::binary;
31 LoadBinaryStl(std::string filename, ScaleUnits scaleType)
32 : LoadStl(std::move(std::move(filename)), openMode, scaleType) {}
33 LoadBinaryStl(std::string filename, ScaleUnits scaleType, ReadMaterial::MaterialParameters params)
34 : LoadStl(std::move(std::move(filename)), openMode, scaleType, std::move(std::move(params))) {}
35 std::unique_ptr<Geometry::MeshObject> readShape() override;
36 static bool isBinarySTL(const std::string &filename);
37
38private:
39 void readTriangle(Kernel::BinaryStreamReader, uint32_t &vertexCount);
40};
41
42} // namespace DataHandling
43} // namespace Mantid
LoadBinaryStl(std::string filename, ScaleUnits scaleType, ReadMaterial::MaterialParameters params)
Definition: LoadBinaryStl.h:33
LoadBinaryStl(std::string filename, ScaleUnits scaleType)
Definition: LoadBinaryStl.h:31
Assists with reading a binary file by providing standard overloads for the istream operators (>>) to ...
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