MeshLib
 
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 <filesystem>
10#include <istream>
11#include <string>
12
13namespace MR
14{
15
16namespace MeshLoad
17{
18
22
24{
26 bool customXf = false;
27
29 bool countSkippedFaces = false;
30
33};
34
54
56MRMESH_API Expected<std::vector<NamedMesh>> fromSceneObjFile( const std::filesystem::path& file, bool combineAllObjects,
57 const ObjLoadSettings& settings = {} );
58
62MRMESH_API Expected<std::vector<NamedMesh>> fromSceneObjFile( std::istream& in, bool combineAllObjects, const std::filesystem::path& dir,
63 const ObjLoadSettings& settings = {} );
64
67MRMESH_API Expected<std::vector<NamedMesh>> fromSceneObjFile( const char* data, size_t size, bool combineAllObjects, const std::filesystem::path& dir,
68 const ObjLoadSettings& settings = {} );
69
70} // namespace MeshLoad
71
72} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:19
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:589
std::string name
Definition MRMeshLoadObj.h:37
VertUVCoords uvCoords
Definition MRMeshLoadObj.h:39
std::optional< Color > diffuseColor
Definition MRMeshLoadObj.h:43
int duplicatedVertexCount
counter of duplicated vertices (that created for resolve non-manifold geometry)
Definition MRMeshLoadObj.h:52
Vector< TextureId, FaceId > texturePerFace
Definition MRMeshLoadObj.h:42
AffineXf3f xf
transform of the loaded mesh, not identity only if ObjLoadSettings.customXf
Definition MRMeshLoadObj.h:46
int skippedFaceCount
counter of skipped faces (faces than can't be created), not zero only if ObjLoadSettings....
Definition MRMeshLoadObj.h:49
bool countSkippedFaces
if true, the number of skipped faces (faces than can't be created) will be counted
Definition MRMeshLoadObj.h:29
Mesh mesh
Definition MRMeshLoadObj.h:38
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 MRMeshLoadObj.h:40
bool customXf
if true then vertices will be returned relative to some transformation to avoid precision loss
Definition MRMeshLoadObj.h:26
Vector< std::filesystem::path, TextureId > textureFiles
Definition MRMeshLoadObj.h:41
ProgressCallback callback
callback for set progress and stop process
Definition MRMeshLoadObj.h:32
Definition MRCameraOrientationPlugin.h:7
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:32
tl::expected< T, E > Expected
Definition MRExpected.h:49
Definition MRMeshLoadObj.h:36
Definition MRMeshLoadObj.h:24
Definition MRMesh/MRMesh.h:23