-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconcavechopper.h
More file actions
32 lines (25 loc) · 800 Bytes
/
concavechopper.h
File metadata and controls
32 lines (25 loc) · 800 Bytes
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
/*
* ConcaveChopper.h
* interact
*
* Created by Daniel Kunz on 23.04.08.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*
*/
#pragma once
#include <QPointF>
#include <QList>
/// A class for triangulating polygons.
class ConcaveChopper
{
public:
// triangulate a contour/polygon, places results in STL vector
// as series of triangles.
static QList<QPointF> triangulate(QList<QPointF> &contour);
// compute area of a contour/polygon
static float area(const QList<QPointF> &contour);
// decide if point Px/Py is inside triangle defined by
// (Ax,Ay) (Bx,By) (Cx,Cy)
static bool insideTriangle(float Ax, float Ay, float Bx, float By, float Cx, float Cy, float Px, float Py);
static bool snip(QList<QPointF> &contour, int u, int v, int w, int n, int *V);
};