iMSTK
Interactive Medical Simulation Toolkit
imstkMeshIO.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include <memory>
10 #include <string>
11 
12 namespace imstk
13 {
14 class PointSet;
15 
19 enum class MeshFileType
20 {
21  UNKNOWN,
22  VTK,
23  VTU,
24  VTP,
25  STL,
26  PLY,
27  OBJ,
28  DAE,
29  FBX,
30  _3DS,
31  VEG,
32  MSH,
33  NRRD,
34  DCM,
35  NII,
36  MHD,
37  JPG,
38  PNG,
39  BMP
40 };
41 
47 class MeshIO
48 {
49 public:
50  MeshIO() = default;
51  virtual ~MeshIO() = default;
52 
56  static std::shared_ptr<PointSet> read(const std::string& filePath);
57 
58  template<typename T>
59  static std::shared_ptr<T> read(const std::string& filePath) { return std::dynamic_pointer_cast<T>(read(filePath)); }
60 
64  static bool write(const std::shared_ptr<imstk::PointSet> imstkMesh, const std::string& filePath);
65 
70  static bool fileExists(const std::string& file, bool& isDirectory);
71 
75  static const MeshFileType getFileType(const std::string& filePath);
76 };
77 } // namespace imstk
MeshFileType
Enumeration the mesh file type.
Definition: imstkMeshIO.h:19
Compound Geometry.
Mesh data IO.
Definition: imstkMeshIO.h:47