created vector for nodes

This commit is contained in:
zzzzrrr 2010-04-23 12:34:55 -04:00
parent 1bdb0893cd
commit 4ca5a5c8ca
2 changed files with 7 additions and 4 deletions

View File

@ -172,6 +172,8 @@ Node& Sweep::NewFrontTriangle(SweepContext& tcx, Point& point, Node& node)
tcx.AddToMap(triangle); tcx.AddToMap(triangle);
Node* new_node = new Node(point); Node* new_node = new Node(point);
nodes_.push_back(new_node);
new_node->next = node.next; new_node->next = node.next;
new_node->prev = &node; new_node->prev = &node;
node.next->prev = new_node; node.next->prev = new_node;
@ -629,8 +631,6 @@ void Sweep::FillRightConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node)
} }
} }
delete &node.next;
} }
void Sweep::FillRightConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) void Sweep::FillRightConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node)
@ -712,8 +712,6 @@ void Sweep::FillLeftConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node)
} }
} }
delete &node.prev;
} }
void Sweep::FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t, Point& p) void Sweep::FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t, Point& p)

View File

@ -39,6 +39,8 @@
#ifndef SWEEP_H #ifndef SWEEP_H
#define SWEEP_H #define SWEEP_H
#include <vector>
namespace p2t { namespace p2t {
class SweepContext; class SweepContext;
@ -113,6 +115,9 @@ Point& NextFlipPoint(Point& ep, Point& eq, Triangle& ot, Point& op);
void FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle& flip_triangle, Triangle& t, Point& p); void FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle& flip_triangle, Triangle& t, Point& p);
void FinalizationPolygon(SweepContext& tcx); void FinalizationPolygon(SweepContext& tcx);
std::vector<Node*> nodes_;
}; };
} }