diff --git a/poly2tri/common/shapes.cc b/poly2tri/common/shapes.cc index d0de13e..f3471dd 100644 --- a/poly2tri/common/shapes.cc +++ b/poly2tri/common/shapes.cc @@ -29,6 +29,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "shapes.h" + +#include #include namespace p2t { @@ -362,4 +364,4 @@ void Triangle::DebugPrint() cout << points_[2]->x << "," << points_[2]->y << endl; } -} \ No newline at end of file +} diff --git a/poly2tri/common/shapes.h b/poly2tri/common/shapes.h index aa582b1..e72cefa 100644 --- a/poly2tri/common/shapes.h +++ b/poly2tri/common/shapes.h @@ -33,10 +33,10 @@ #ifndef SHAPES_H #define SHAPES_H -#include -#include -#include #include +#include +#include +#include namespace p2t { @@ -136,7 +136,7 @@ struct Edge { p = &p2; } else if (p1.x == p2.x) { // Repeat points - assert(false); + throw std::runtime_error("Edge::Edge: p1 == p2"); } } @@ -320,4 +320,4 @@ inline void Triangle::IsInterior(bool b) } -#endif \ No newline at end of file +#endif diff --git a/poly2tri/sweep/advancing_front.cc b/poly2tri/sweep/advancing_front.cc index 38723be..37e832d 100644 --- a/poly2tri/sweep/advancing_front.cc +++ b/poly2tri/sweep/advancing_front.cc @@ -30,6 +30,8 @@ */ #include "advancing_front.h" +#include + namespace p2t { AdvancingFront::AdvancingFront(Node& head, Node& tail) @@ -105,4 +107,4 @@ AdvancingFront::~AdvancingFront() { } -} \ No newline at end of file +} diff --git a/poly2tri/sweep/sweep.cc b/poly2tri/sweep/sweep.cc index e31ffde..2f4cf24 100644 --- a/poly2tri/sweep/sweep.cc +++ b/poly2tri/sweep/sweep.cc @@ -28,12 +28,14 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include "sweep.h" #include "sweep_context.h" #include "advancing_front.h" #include "../common/utils.h" +#include +#include + namespace p2t { // Triangulate simple polygon with holes