aboutsummaryrefslogtreecommitdiff
path: root/ports/openmvs/cgal-5.0.patch
blob: 042bf9dab240b88ec7e27ce193ecd336e0b8796d (plain)
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
diff --git a/libs/MVS/DepthMap.cpp b/libs/MVS/DepthMap.cpp
index 12973ac..f6621f0 100644
--- a/libs/MVS/DepthMap.cpp
+++ b/libs/MVS/DepthMap.cpp
@@ -1071,16 +1071,25 @@ void MVS::EstimatePointNormals(const ImageArr& images, PointCloud& pointcloud, i
 	// estimates normals direction;
 	// Note: pca_estimate_normals() requires an iterator over points
 	// as well as property maps to access each point's position and normal.
-	#if CGAL_VERSION_NR < 1040800000
-	CGAL::pca_estimate_normals(
-	#else
-	CGAL::pca_estimate_normals<CGAL::Sequential_tag>(
-	#endif
-		pointvectors.begin(), pointvectors.end(),
-		CGAL::First_of_pair_property_map<PointVectorPair>(),
-		CGAL::Second_of_pair_property_map<PointVectorPair>(),
-		numNeighbors
-	);
+        #if CGAL_VERSION_NR < 1041301000
+          #if CGAL_VERSION_NR < 1040800000
+          CGAL::pca_estimate_normals(
+          #else
+          CGAL::pca_estimate_normals<CGAL::Sequential_tag>(
+          #endif
+                pointvectors.begin(), pointvectors.end(),
+                CGAL::First_of_pair_property_map<PointVectorPair>(),
+                CGAL::Second_of_pair_property_map<PointVectorPair>(),
+                numNeighbors
+          );
+        #else
+        CGAL::pca_estimate_normals<CGAL::Sequential_tag>(
+              pointvectors,
+              numNeighbors,
+              CGAL::parameters::point_map(CGAL::First_of_pair_property_map<PointVectorPair>())
+              .normal_map(CGAL::Second_of_pair_property_map<PointVectorPair>())
+              );
+        #endif
 	// store the point normals
 	pointcloud.normals.Resize(pointcloud.points.GetSize());
 	FOREACH(i, pointcloud.normals) {