iMSTK
Interactive Medical Simulation Toolkit
imstkVegaMeshIO.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 "imstkMath.h"
10 #include "imstkMeshIO.h"
11 #include "imstkVecDataArray.h"
12 
13 namespace vega
14 {
15 class VolumetricMesh;
16 } // namespace vega
17 
18 namespace imstk
19 {
20 template<typename T, int N> class VecDataArray;
21 
29 {
30 public:
31  VegaMeshIO() = default;
32  virtual ~VegaMeshIO() = default;
33 
37  static std::shared_ptr<PointSet> read(const std::string& filePath, MeshFileType meshType);
38 
42  static std::shared_ptr<vega::VolumetricMesh> readVegaMesh(const std::string& filePath);
43 
47  static bool write(const std::shared_ptr<imstk::PointSet> imstkMesh, const std::string& filePath, const MeshFileType meshType);
48 
52  static std::shared_ptr<PointSet> convertVegaMeshToVolumetricMesh(std::shared_ptr<vega::VolumetricMesh> vegaVolumeMesh);
53 
57  static std::shared_ptr<vega::VolumetricMesh> convertVolumetricMeshToVegaMesh(const std::shared_ptr<PointSet> volumeMesh);
58 
59 protected:
63  static void copyVertices(std::shared_ptr<vega::VolumetricMesh> vegaMesh, VecDataArray<double, 3>& vertices);
64 
68  template<size_t dim>
69  static void copyCells(std::shared_ptr<vega::VolumetricMesh> vegaMesh, VecDataArray<int, dim>& cells);
70 };
71 } // namespace imstk
MeshFileType
Enumeration the mesh file type.
Definition: imstkMeshIO.h:19
Compound Geometry.
Contains utility classes that convert vega volume mesh to volume mesh and vice-versa.