Go to the documentation of this file.
11 #ifndef TRIANGULATE_HPP
12 #define TRIANGULATE_HPP
39 mgx_EXPORT std::vector<Point3d>
orderPolygonSegs(std::vector<std::pair<Point3d,Point3d> > &polygonSegs,
bool keepPolySegs =
true);
40 mgx_EXPORT std::vector<std::vector<Point3d> >
orderPolygonSegsMulti(std::vector<std::pair<Point3d,Point3d> > &polygonSegs);
60 mgx_EXPORT
bool isDataPlanar(std::vector<Point3d>& inputVertices);
127 std::vector<Point3i> &triList, std::vector<Point3d> &ptList,
bool boundary,
bool inOrder,
bool pointsCenter);
159 mgx_EXPORT
bool pointInPolygon(
Point3d pointToTest, std::vector<Point3d>& polygon,
bool debug =
false);
170 mgx_EXPORT std::vector<Point2d>
lloydKMeans2D(std::vector<Point2d>& clusters, std::vector<Point2d>& data,
int maxStep = -1);
182 mgx_EXPORT
bool lloydKMeans(std::vector<std::vector<double> >& inputClusters,
183 std::vector<AttrMap<int, double> >& dataPoints,
int maxStep = -1,
double convergenceThreshold = 0.01);
188 mgx_EXPORT
void drawCross(QImage& image,
int x,
int y,
int size,
int crossSize, QRgb color);
189 mgx_EXPORT
void drawCircle(QImage& image,
int x,
int y,
int size, QRgb color);
203 mgx_EXPORT
double gauss2D(
double x,
double y,
double muX,
double muY,
double sigmaX,
double sigmaY);
221 mgx_EXPORT QRgb
calcRGB(
double maxValue,
double currentValue);
mgx_EXPORT QRgb getColorFromLabel(int label)
mgx_EXPORT Point3d orthogonalVector(Point3d vec)
orthogonalVector
mgx_EXPORT QRgb calcRGB(double maxValue, double currentValue)
Matrix< 3, 3, double > Matrix3d
mgx_EXPORT void drawCircle(QImage &image, int x, int y, int size, QRgb color)
mgx_EXPORT std::vector< Point3d > orderPolygonSegs(std::vector< std::pair< Point3d, Point3d > > &polygonSegs, bool keepPolySegs=true)
orderPolygonSegs
mgx_EXPORT Point3d calcNearestPointOnBezierLine(const Point3d &targetPoint, std::vector< Point3d > &bezierVec, int &bezIdx, double &bezWeight)
calculates the nearest point of a tragetPoint on a bezier line (bMap) as the bezier is discretized,...
Distributed matrix library.
mgx_EXPORT void inplaceMatrixMultiply(std::vector< Point3d > &P, const Matrix3d &M)
inplaceMatrixMultiply P := P*M
mgx_EXPORT Point3d calcNearestPointOnBezierGrid(const Point3d &targetPoint, std::vector< std::vector< Point3d > > &bezier, Point2i &bezIdx)
calculates the nearest point of a tragetPoint on a bezier grid (bezier)
mgx_EXPORT double interpolateArrayIndex(double value, double min, double max, double newRange)
T CU_HOST_DEVICE max(const T a, const T b)
mgx_EXPORT std::vector< std::vector< Point3d > > orderPolygonSegsMulti(std::vector< std::pair< Point3d, Point3d > > &polygonSegs)
Vector< 3, double > Point3d
mgx_EXPORT bool pointInPolygon(Point3d pointToTest, std::vector< Point3d > &polygon, bool debug=false)
mgx_EXPORT bool triangleOrientationCheck(std::vector< Point3i > &triList, int idxRefTri=-1)
triangleOrientationCheck
mgx_EXPORT void drawCross(QImage &image, int x, int y, int size, int crossSize, QRgb color)
mgx_EXPORT double gauss2D(double x, double y, double muX, double muY, double sigmaX, double sigmaY)
returns the value of a 2D gaussian function
mgx_EXPORT bool triangulatePolygon3D(float maxArea, Point3d polygonNormal, std::vector< Point3d > &pointsPolygon, std::vector< Point3i > &triList, std::vector< Point3d > &ptList, bool boundary, bool inOrder, bool pointsCenter)
triangulatePolygon3D
mgx_EXPORT bool lloydKMeans(std::vector< std::vector< double > > &inputClusters, std::vector< AttrMap< int, double > > &dataPoints, int maxStep=-1, double convergenceThreshold=0.01)
k means function for n-D data (lloyds algorithm) NOTE: dimensions have to match, otherwise function r...
mgx_EXPORT std::vector< Point2d > lloydKMeans2D(std::vector< Point2d > &clusters, std::vector< Point2d > &data, int maxStep=-1)
k means function for 2D data (lloyds algorithm)
mgx_EXPORT double angleVectors(Point3d v1, Point3d v2, bool directed=false)
CU_HOST_DEVICE T min(const T a, const T b)
mgx_EXPORT Matrix3d calcRotMatrix(Point3d nrmlStart, Point3d nrmlEnd, Point3d rot_axis=Point3d(0, 0, 0))
calcRotMatrix
mgx_EXPORT Matrix3d calcProjectedGrowthTensor(Matrix3d tensor, Point3d planeNrml)
projectPointOnPlane
mgx_EXPORT bool findPolygonPlane(std::vector< Point3d > &pointsPolygon, Point3d &planePos, Point3d &planeNrml)
findPolygonPlane
mgx_EXPORT bool isDataPlanar(std::vector< Point3d > &inputVertices)
isDataPlanar
mgx_EXPORT bool projectPointsOnPlane(std::vector< Point3d > &points, Point3d planePos, Point3d planeNrml)
projectPointsOnPlane
mgx_EXPORT void rotatePointsIntoXY(Point3d polygonNormal, std::vector< Point3d > &pointsPolygon, Matrix3d &inv_rot_polygon_plane)
rotatePointsIntoXY
mgx_EXPORT Point3d getPolygonNrml(std::vector< Point3d > &pointsPolygon)
getPolygonNrml