iMSTK
Interactive Medical Simulation Toolkit
imstkVisualObjectImporter.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 "imstkTexture.h"
10 #include "imstkMath.h"
11 
12 struct aiMaterial;
13 
14 namespace imstk
15 {
16 class AnimatedObject;
17 class RenderMaterial;
18 class SceneObject;
19 
26 class ObjectIO
27 {
28 public:
37  static std::shared_ptr<SceneObject> importSceneObject(
38  const std::string& objName,
39  const std::string& modelFilePath,
40  const std::string& textureFolderPath,
41  const Mat4d& transform = Mat4d::Identity());
42 
43 private:
47  static std::shared_ptr<Texture> createTexture(std::string textureFolderPath, std::string textureFilePath, Texture::Type textureType);
48 
52  static std::shared_ptr<RenderMaterial> readMaterial(aiMaterial* mat, std::string textureFolderPath);
53 
61  static std::string getSubstringGivenString(
62  const std::string& input,
63  const std::string& delimiter,
64  const bool lastInstance = false);
65 };
66 } // namespace imstk
Type
Texture type - determines filtering.
Definition: imstkTexture.h:30
static std::shared_ptr< SceneObject > importSceneObject(const std::string &objName, const std::string &modelFilePath, const std::string &textureFolderPath, const Mat4d &transform=Mat4d::Identity())
Import a scene object.
Compound Geometry.
ObjectIO provides SceneObject reading capabilities It is used to read complex visual objects or anima...