mirror of
https://github.com/jhasse/poly2tri.git
synced 2025-08-14 03:05:39 +02:00
added AddHole to api; added random distribution example
This commit is contained in:
@@ -43,6 +43,10 @@ void CDT::AddHole(std::vector<Point*> polyline)
|
||||
sweep_context_->AddHole(polyline);
|
||||
}
|
||||
|
||||
void CDT::AddPoint(Point* point) {
|
||||
sweep_context_->AddPoint(point);
|
||||
}
|
||||
|
||||
void CDT::Triangulate()
|
||||
{
|
||||
sweep_->Triangulate(*sweep_context_);
|
||||
|
@@ -42,6 +42,8 @@ public:
|
||||
CDT(std::vector<Point*> polyline);
|
||||
/// Add a hole
|
||||
void AddHole(std::vector<Point*> polyline);
|
||||
/// Add a single point
|
||||
void AddPoint(Point* point);
|
||||
/// Triangulate points
|
||||
void Triangulate();
|
||||
/// Get Delaunay triangles
|
||||
|
@@ -53,6 +53,10 @@ void SweepContext::AddHole(std::vector<Point*> polyline)
|
||||
}
|
||||
}
|
||||
|
||||
void SweepContext::AddPoint(Point* point) {
|
||||
points_.push_back(point);
|
||||
}
|
||||
|
||||
std::vector<Triangle*> SweepContext::GetTriangles()
|
||||
{
|
||||
return triangles_;
|
||||
|
@@ -46,43 +46,48 @@ class AdvancingFront;
|
||||
class SweepContext {
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
/// Constructor
|
||||
SweepContext(std::vector<Point*> polyline);
|
||||
// Destructor
|
||||
/// Destructor
|
||||
~SweepContext();
|
||||
|
||||
void set_head(Point* p1);
|
||||
|
||||
Point* head();
|
||||
|
||||
void set_tail(Point* p1);
|
||||
|
||||
Point* tail();
|
||||
|
||||
int point_count();
|
||||
|
||||
Node& LocateNode(Point& point);
|
||||
|
||||
void RemoveNode(Node* node);
|
||||
|
||||
void CreateAdvancingFront();
|
||||
|
||||
// Try to map a node to all sides of this triangle that don't have a neighbor
|
||||
/// Try to map a node to all sides of this triangle that don't have a neighbor
|
||||
void MapTriangleToNodes(Triangle& t);
|
||||
|
||||
void AddToMap(Triangle* triangle);
|
||||
|
||||
Point* GetPoint(const int& index);
|
||||
|
||||
Point* GetPoints();
|
||||
|
||||
void RemoveFromMap(Triangle* triangle);
|
||||
|
||||
void AddHole(std::vector<Point*> polyline);
|
||||
|
||||
void AddPoint(Point* point);
|
||||
|
||||
AdvancingFront* front();
|
||||
|
||||
void MeshClean(Triangle& triangle);
|
||||
|
||||
std::vector<Triangle*> GetTriangles();
|
||||
std::list<Triangle*> GetMap();
|
||||
|
||||
std::vector<Edge*> edge_list;
|
||||
|
||||
struct Basin {
|
||||
|
Reference in New Issue
Block a user