kopia lustrzana https://github.com/OpenDroneMap/ODM
Added overflow check in normalsDirectionCount
rodzic
7f44885bfd
commit
e1a3fedd4e
|
@ -25,7 +25,11 @@ void PlyInterpreter::process_line(CGAL::Ply_reader& reader) {
|
|||
Point3 p(x, y, z);
|
||||
Vector3 n(nx, ny, nz);
|
||||
|
||||
zNormalsDirectionCount += nz >= 0 ? 1 : -1;
|
||||
if (nz >= 0 && zNormalsDirectionCount < std::numeric_limits<long>::max()){
|
||||
zNormalsDirectionCount++;
|
||||
}else if (nz < 0 && zNormalsDirectionCount > std::numeric_limits<long>::min()){
|
||||
zNormalsDirectionCount--;
|
||||
}
|
||||
|
||||
points.push_back(std::make_pair(p, n));
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
#include <limits>
|
||||
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/property_map.h>
|
||||
|
@ -19,7 +20,7 @@ typedef std::pair<Point3, Vector3> Pwn;
|
|||
|
||||
class PlyInterpreter {
|
||||
std::vector<Pwn>& points;
|
||||
int zNormalsDirectionCount;
|
||||
long zNormalsDirectionCount;
|
||||
|
||||
public:
|
||||
PlyInterpreter (std::vector<Pwn>& points)
|
||||
|
|
Ładowanie…
Reference in New Issue