forked from swayfreeda/ImageBasedModellingEduV1.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseam_leveling.h
executable file
·58 lines (44 loc) · 1.35 KB
/
seam_leveling.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright (C) 2015, Nils Moehrle
* TU Darmstadt - Graphics, Capture and Massively Parallel Computing
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD 3-Clause license. See the LICENSE.txt file for details.
*/
#ifndef TEX_SEAMLEVELING_HEADER
#define TEX_SEAMLEVELING_HEADER
#include <vector>
#include <core/mesh.h>
#include "defines.h"
#include "uni_graph.h"
TEX_NAMESPACE_BEGIN
struct VertexProjectionInfo {
std::size_t texture_patch_id;
math::Vec2f projection;
std::vector<std::size_t> faces;
bool operator<(VertexProjectionInfo const & other) const {
return texture_patch_id < other.texture_patch_id;
}
};
struct ProjectedEdgeInfo {
std::size_t texture_patch_id;
math::Vec2f p1;
math::Vec2f p2;
bool operator<(ProjectedEdgeInfo const & other) const {
return texture_patch_id < other.texture_patch_id;
}
};
struct MeshEdge {
std::size_t v1;
std::size_t v2;
};
void
find_seam_edges(UniGraph const & graph, core::TriangleMesh::ConstPtr mesh,
std::vector<MeshEdge> * seam_edges);
void
find_mesh_edge_projections(
std::vector<std::vector<VertexProjectionInfo> > const & vertex_projection_infos,
MeshEdge mesh_edge, std::vector<ProjectedEdgeInfo> * projected_edge_infos);
TEX_NAMESPACE_END
#endif /* TEX_SEAMLEVELING_HEADER */