MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMesh/MRMeshLoadObj.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMesh.h"
4#include "MRMeshTexture.h"
6#include "MRExpected.h"
8#include "MRAffineXf3.h"
9#include "MRLoadedObjects.h"
10#include <filesystem>
11#include <istream>
12#include <string>
13
14namespace MR
15{
16
17namespace MeshLoad
18{
19
23
25{
27 bool customXf = false;
28
30 bool countSkippedFaces = false;
31
34};
35
55
57MRMESH_API Expected<std::vector<NamedMesh>> fromSceneObjFile( const std::filesystem::path& file, bool combineAllObjects,
58 const ObjLoadSettings& settings = {} );
59
63MRMESH_API Expected<std::vector<NamedMesh>> fromSceneObjFile( std::istream& in, bool combineAllObjects, const std::filesystem::path& dir,
64 const ObjLoadSettings& settings = {} );
65
68MRMESH_API Expected<std::vector<NamedMesh>> fromSceneObjFile( const char* data, size_t size, bool combineAllObjects, const std::filesystem::path& dir,
69 const ObjLoadSettings& settings = {} );
70
72MRMESH_API Expected<LoadedObjects> loadObjectFromObj( const std::filesystem::path& file, const ProgressCallback& cb = {} );
73
74} // namespace MeshLoad
75
76} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:68
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:20
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:600
std::string name
Definition MRMesh/MRMeshLoadObj.h:38
VertUVCoords uvCoords
Definition MRMesh/MRMeshLoadObj.h:40
std::optional< Color > diffuseColor
Definition MRMesh/MRMeshLoadObj.h:44
int duplicatedVertexCount
counter of duplicated vertices (that created for resolve non-manifold geometry)
Definition MRMesh/MRMeshLoadObj.h:53
Vector< TextureId, FaceId > texturePerFace
Definition MRMesh/MRMeshLoadObj.h:43
AffineXf3f xf
transform of the loaded mesh, not identity only if ObjLoadSettings.customXf
Definition MRMesh/MRMeshLoadObj.h:47
int skippedFaceCount
counter of skipped faces (faces than can't be created), not zero only if ObjLoadSettings....
Definition MRMesh/MRMeshLoadObj.h:50
bool countSkippedFaces
if true, the number of skipped faces (faces than can't be created) will be counted
Definition MRMesh/MRMeshLoadObj.h:30
Mesh mesh
Definition MRMesh/MRMeshLoadObj.h:39
MRMESH_API Expected< std::vector< NamedMesh > > fromSceneObjFile(const std::filesystem::path &file, bool combineAllObjects, const ObjLoadSettings &settings={})
loads meshes from .obj file
VertColors colors
Definition MRMesh/MRMeshLoadObj.h:41
bool customXf
if true then vertices will be returned relative to some transformation to avoid precision loss
Definition MRMesh/MRMeshLoadObj.h:27
Vector< std::filesystem::path, TextureId > textureFiles
Definition MRMesh/MRMeshLoadObj.h:42
MRMESH_API Expected< LoadedObjects > loadObjectFromObj(const std::filesystem::path &file, const ProgressCallback &cb={})
reads all objects from .OBJ file
ProgressCallback callback
callback for set progress and stop process
Definition MRMesh/MRMeshLoadObj.h:33
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:32
tl::expected< T, E > Expected
Definition MRExpected.h:58
Definition MRMesh/MRMeshLoadObj.h:37
Definition MRMesh/MRMeshLoadObj.h:25
Definition MRMesh/MRMesh.h:23