Point Cloud Library (PCL)
1.10.0
|
29 #ifndef GEOMETRY_INCLUDED
30 #define GEOMETRY_INCLUDED
33 # pragma GCC system_header
39 #include <unordered_map>
49 template<
class Real >
73 double Length(
const Point3D<Real>& p);
79 double Distance(
const Point3D<Real>& p1,
const Point3D<Real>& p2);
82 double SquareDistance(
const Point3D<Real>& p1,
const Point3D<Real>& p2);
85 void CrossProduct(
const Point3D<Real>& p1,
const Point3D<Real>& p2,Point3D<Real>& p);
97 return sqrt(d[0]*d[0]+d[1]*d[1]);
106 double v1[3] , v2[3] , v[3];
107 for(
int d=0 ; d<3 ; d++ )
109 v1[d] =
p[1][d] -
p[0][d];
110 v2[d] =
p[2][d] -
p[0][d];
112 v[0] = v1[1]*v2[2] - v1[2]*v2[1];
113 v[1] = -v1[0]*v2[2] + v1[2]*v2[0];
114 v[2] = v1[0]*v2[1] - v1[1]*v2[0];
115 return sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ) / 2;
123 for(j=0;j<3;j++){d+=(
p[(i+1)%3][j]-
p[i][j])*(
p[(i+1)%3][j]-
p[i][j]);}
172 std::vector<TriangulationEdge>
edges;
175 int factor(
int tIndex,
int& p1,
int& p2,
int& p3);
177 double area(
int tIndex );
178 double area(
int p1 ,
int p2 ,
int p3 );
184 static long long EdgeIndex(
int p1 ,
int p2 );
203 virtual void resetIterator(
void ) = 0;
206 virtual int addPolygon(
const std::vector< CoredVertexIndex >& vertices ) = 0;
209 virtual int nextPolygon( std::vector< CoredVertexIndex >& vertices ) = 0;
211 virtual int outOfCorePointCount(
void)=0;
212 virtual int polygonCount(
void ) = 0;
231 value = ( p1[0] * p2[0] + p1[1] * p2[1] + p1[2] * p2[2] ) / ( p2[0] * p2[0] + p2[1] * p2[1] + p2[2] * p2[2] );
235 virtual void resetIterator(
void ) = 0;
237 virtual int addOutOfCorePoint(
const Vertex& v ) = 0;
238 virtual int addPolygon(
const std::vector< CoredVertexIndex >& vertices ) = 0;
240 virtual int nextOutOfCorePoint(
Vertex& v ) = 0;
241 virtual int nextPolygon( std::vector< CoredVertexIndex >& vertices ) = 0;
243 virtual int outOfCorePointCount(
void )=0;
244 virtual int polygonCount(
void ) = 0;
249 std::vector<Point3D<float> > oocPoints;
250 std::vector< std::vector< int > > polygons;
256 void resetIterator(
void);
259 int addPolygon(
const std::vector< CoredVertexIndex >& vertices );
262 int nextPolygon( std::vector< CoredVertexIndex >& vertices );
264 int outOfCorePointCount(
void);
265 int polygonCount(
void );
269 std::vector< CoredMeshData2::Vertex > oocPoints;
270 std::vector< std::vector< int > > polygons;
276 void resetIterator(
void);
279 int addPolygon(
const std::vector< CoredVertexIndex >& vertices );
282 int nextPolygon( std::vector< CoredVertexIndex >& vertices );
284 int outOfCorePointCount(
void );
285 int polygonCount(
void );
289 FILE *oocPointFile , *polygonFile;
290 int oocPoints , polygons;
298 int addPolygon(
const std::vector< CoredVertexIndex >& vertices );
301 int nextPolygon( std::vector< CoredVertexIndex >& vertices );
308 FILE *oocPointFile , *polygonFile;
309 int oocPoints , polygons;
317 int addPolygon(
const std::vector< CoredVertexIndex >& vertices );
320 int nextPolygon( std::vector< CoredVertexIndex >& vertices );
328 #include "geometry.hpp"
333 #endif // GEOMETRY_INCLUDED
Defines all the PCL and non-PCL macros used.
This file defines compatibility wrappers for low level I/O functions.
int nextOutOfCorePoint(CoredMeshData2::Vertex &v)
TriangulationTriangle(void)
int addOutOfCorePoint(const Point3D< float > &p)
void EdgeCollapse(const Real &edgeRatio, std::vector< TriangleIndex > &triangles, std::vector< Point3D< Real > > &positions, std::vector< Point3D< Real > > *normals)
std::vector< Vertex > inCorePoints
int nextPolygon(std::vector< CoredVertexIndex > &vertices)
Vertex(Point3D< float > s, Point3D< float > e, float v)
Point3D & operator*=(Real r)
void TriangleCollapse(const Real &edgeRatio, std::vector< TriangleIndex > &triangles, std::vector< Point3D< Real > > &positions, std::vector< Point3D< Real > > *normals)
int nextPolygon(std::vector< CoredVertexIndex > &vertices)
Point3D< Real > RandomSpherePoint(void)
std::vector< TriangulationTriangle > triangles
double SquareLength(const Point3D< Real > &p)
Vertex(Point3D< float > s, Point3D< float > e, Point3D< float > p)
Point3D & operator-=(Point3D p)
std::vector< Point3D< float > > inCorePoints
int addOutOfCorePoint(const CoredMeshData2::Vertex &v)
double Length(const Point3D< Real > &p)
Point3D operator*(Real r) const
Point3D< Real > RandomBallPoint(void)
double AspectRatio(void) const
int flipMinimize(int eIndex)
Point3D operator+(Point3D p) const
int factor(int tIndex, int &p1, int &p2, int &p3)
std::unordered_map< long long, int > edgeMap
Point3D & operator+=(Point3D p)
Point3D operator-(Point3D p) const
~CoredFileMeshData2(void)
std::vector< Point3D< Real > > points
int addTriangle(int p1, int p2, int p3)
static long long EdgeIndex(int p1, int p2)
double SquareDistance(const Point3D< Real > &p1, const Point3D< Real > &p2)
int outOfCorePointCount(void)
Point3D & operator/=(Real r)
double Distance(const Point3D< Real > &p1, const Point3D< Real > &p2)
int nextOutOfCorePoint(Point3D< float > &p)
int outOfCorePointCount(void)
std::vector< TriangulationEdge > edges
int addPolygon(const std::vector< CoredVertexIndex > &vertices)
void CrossProduct(const Point3D< Real > &p1, const Point3D< Real > &p2, Point3D< Real > &p)
bool operator==(const PCLHeader &lhs, const PCLHeader &rhs)
Point3D operator/(Real r) const
int addPolygon(const std::vector< CoredVertexIndex > &vertices)
double Length(void) const