MeshLib C++ Docs
Loading...
Searching...
No Matches
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 <iosfwd>
12#include <string>
13
14namespace MR
15{
16
17namespace MeshLoad
18{
19
23
42
66
68MRMESH_API Expected<std::vector<NamedMesh>> fromSceneObjFile( const std::filesystem::path& file, bool combineAllObjects,
69 const ObjLoadSettings& settings = {} );
70
74MRMESH_API Expected<std::vector<NamedMesh>> fromSceneObjFile( std::istream& in, bool combineAllObjects, const std::filesystem::path& dir,
75 const ObjLoadSettings& settings = {} );
76
79MRMESH_API Expected<std::vector<NamedMesh>> fromSceneObjFile( const char* data, size_t size, bool combineAllObjects, const std::filesystem::path& dir,
80 const ObjLoadSettings& settings = {} );
81
83MRMESH_API Expected<LoadedObjects> loadObjectFromObj( const std::filesystem::path& file, const ProgressCallback& cb = {} );
84
85}
86
87}
#define MRMESH_API
Definition MRMeshFwd.h:85
Vector<T> is indexed by size_t.
Definition MRVector.h:24
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:790
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:59
tl::expected< T, E > Expected
Definition MRExpected.h:31
phmap::flat_hash_map< K, V, Hash, Eq, Allocator< std::pair< const K, V > > > HashMap
Definition MRMeshFwd.h:631
std::string name
the name from the o line of the object; empty for the faces before the first o line,...
Definition MRMeshLoadObj.h:46
Expected< LoadedObjects > loadObjectFromObj(const std::filesystem::path &file, const ProgressCallback &cb={})
reads all objects from .OBJ file
VertUVCoords uvCoords
Definition MRMeshLoadObj.h:48
std::optional< Color > diffuseColor
Definition MRMeshLoadObj.h:55
int duplicatedVertexCount
counter of duplicated vertices (that created for resolve non-manifold geometry)
Definition MRMeshLoadObj.h:64
Vector< TextureId, FaceId > texturePerFace
Definition MRMeshLoadObj.h:54
HashMap< std::filesystem::path, std::string > * mtlErrors
Definition MRMeshLoadObj.h:40
AffineXf3f xf
transform of the loaded mesh, not identity only if ObjLoadSettings.customXf
Definition MRMeshLoadObj.h:58
int skippedFaceCount
counter of skipped faces (faces than can't be created), not zero only if ObjLoadSettings....
Definition MRMeshLoadObj.h:61
Expected< std::vector< NamedMesh > > fromSceneObjFile(const std::filesystem::path &file, bool combineAllObjects, const ObjLoadSettings &settings={})
loads meshes from .obj file
bool telemetrySignal
permit telemetry signal about loading
Definition MRMeshLoadObj.h:36
bool countSkippedFaces
if true, the number of skipped faces (faces than can't be created) will be counted
Definition MRMeshLoadObj.h:30
Mesh mesh
Definition MRMeshLoadObj.h:47
VertColors colors
Definition MRMeshLoadObj.h:49
bool customXf
if true then vertices will be returned relative to some transformation to avoid precision loss
Definition MRMeshLoadObj.h:27
Vector< std::filesystem::path, TextureId > textureFiles
Definition MRMeshLoadObj.h:53
ProgressCallback callback
callback for set progress and stop process
Definition MRMeshLoadObj.h:33
compatibility names
Definition MRCtm.h:21
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
Definition MRMeshLoadObj.h:44
Definition MRMeshLoadObj.h:25
Definition MRMesh.h:24