From 47904bc7b2992189bb554833f00a79ff0fea9fb8 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 6 Aug 2010 13:13:25 +0000 Subject: SWORD25: Mass-astyle. svn-id: r53222 --- engines/sword25/math/line.h | 100 ++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 50 deletions(-) (limited to 'engines/sword25/math/line.h') diff --git a/engines/sword25/math/line.h b/engines/sword25/math/line.h index 86bcbd6537..5e442045f1 100644 --- a/engines/sword25/math/line.h +++ b/engines/sword25/math/line.h @@ -23,7 +23,7 @@ * */ -/* +/* * This code is based on Broken Sword 2.5 engine * * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer @@ -33,15 +33,15 @@ */ /* - BS_Line - ------- - This class contains only static methods, which have to do with straight line - segments. There is no real straight line segment class. Calculations will be - used with polygons, and it is important the process of starting and selecting - endpoints of lines is dynamic. This would prhobit a polygon from a set - being formed by fixed line segments - - Autor: Malte Thiesen + BS_Line + ------- + This class contains only static methods, which have to do with straight line + segments. There is no real straight line segment class. Calculations will be + used with polygons, and it is important the process of starting and selecting + endpoints of lines is dynamic. This would prhobit a polygon from a set + being formed by fixed line segments + + Autor: Malte Thiesen */ #ifndef SWORD25_LINE_H @@ -61,10 +61,10 @@ class BS_Line { public: /** * Determines whether a piont is left of a line - * @param a The start point of a line - * @param b The end point of a line - * @param c The test point - * @return Returns true if the point is to the left of the line. + * @param a The start point of a line + * @param b The end point of a line + * @param c The test point + * @return Returns true if the point is to the left of the line. * If the point is to the right of the line or on the line, false is returned. */ static bool IsVertexLeft(const BS_Vertex &a, const BS_Vertex &b, const BS_Vertex &c) { @@ -77,10 +77,10 @@ public: /** * Determines whether a piont is right of a line - * @param a The start point of a line - * @param b The end point of a line - * @param c The test point - * @return Returns true if the point is to the right of the line. + * @param a The start point of a line + * @param b The end point of a line + * @param c The test point + * @return Returns true if the point is to the right of the line. * If the point is to the right of the line or on the line, false is returned. */ static bool IsVertexRight(const BS_Vertex &a, const BS_Vertex &b, const BS_Vertex &c) { @@ -93,10 +93,10 @@ public: /** * Determines whether a piont is on a line - * @param a The start point of a line - * @param b The end point of a line - * @param c The test point - * @return Returns true if the point is on the line, false otherwise. + * @param a The start point of a line + * @param b The end point of a line + * @param c The test point + * @return Returns true if the point is on the line, false otherwise. */ static bool IsVertexOn(const BS_Vertex &a, const BS_Vertex &b, const BS_Vertex &c) { return _TriangleArea2(a, b, c) == 0; @@ -110,10 +110,10 @@ public: /** * Determines where a point is relative to a line. - * @param a The start point of a line - * @param b The end point of a line - * @param c The test point - * @return LEFT is returned if the point is to the left of the line. + * @param a The start point of a line + * @param b The end point of a line + * @param c The test point + * @return LEFT is returned if the point is to the left of the line. * RIGHT is returned if the point is to the right of the line. * ON is returned if the point is on the line. */ @@ -126,11 +126,11 @@ public: /** * Determines whether two lines intersect - * @param a The start point of the first line - * @param b The end point of the first line - * @param c The start point of the second line - * @param d The end point of the second line - * @remark In cases where a line only touches the other, false is returned (improper intersection) + * @param a The start point of the first line + * @param b The end point of the first line + * @param c The start point of the second line + * @param d The end point of the second line + * @remark In cases where a line only touches the other, false is returned (improper intersection) */ static bool DoesIntersectProperly(const BS_Vertex &a, const BS_Vertex &b, const BS_Vertex &c, const BS_Vertex &d) { VERTEX_CLASSIFICATION Class1 = ClassifyVertexToLine(a, b, c); @@ -140,14 +140,14 @@ public: if (Class1 == ON || Class2 == ON || Class3 == ON || Class4 == ON) return false; - return ((Class1 == LEFT) ^ (Class2 == LEFT)) && ((Class3 == LEFT) ^ (Class4 == LEFT)); + return ((Class1 == LEFT) ^(Class2 == LEFT)) && ((Class3 == LEFT) ^(Class4 == LEFT)); } /** * Determines whether a point is on a line segment - * @param a The start point of a line - * @param b The end point of a line - * @param c The test point + * @param a The start point of a line + * @param b The end point of a line + * @param c The test point */ static bool IsOnLine(const BS_Vertex &a, const BS_Vertex &b, const BS_Vertex &c) { // The items must all be Collinear, otherwise don't bothering testing the point @@ -156,14 +156,14 @@ public: // If the line segment is not vertical, check on the x-axis, otherwise the y-axis if (a.X != b.X) { return ((a.X <= c.X) && - (c.X <= b.X)) || - ((a.X >= c.X) && - (c.X >= b.X)); + (c.X <= b.X)) || + ((a.X >= c.X) && + (c.X >= b.X)); } else { return ((a.Y <= c.Y) && - (c.Y <= b.Y)) || - ((a.Y >= c.Y) && - (c.Y >= b.Y)); + (c.Y <= b.Y)) || + ((a.Y >= c.Y) && + (c.Y >= b.Y)); } } @@ -174,14 +174,14 @@ public: // If the line segment is not vertical, check on the x-axis, otherwise the y-axis if (a.X != b.X) { return ((a.X < c.X) && - (c.X < b.X)) || - ((a.X > c.X) && - (c.X > b.X)); + (c.X < b.X)) || + ((a.X > c.X) && + (c.X > b.X)); } else { return ((a.Y < c.Y) && - (c.Y < b.Y)) || - ((a.Y > c.Y) && - (c.Y > b.Y)); + (c.Y < b.Y)) || + ((a.Y > c.Y) && + (c.Y > b.Y)); } } @@ -189,13 +189,13 @@ private: /** * Return double the size of the triangle defined by the three passed points. * - * The result is positive if the points are arrange counterclockwise, + * The result is positive if the points are arrange counterclockwise, * and negative if they are arranged counter-clockwise. */ static int _TriangleArea2(const BS_Vertex &a, const BS_Vertex &b, const BS_Vertex &c) { return a.X * b.Y - a.Y * b.X + - a.Y * c.X - a.X * c.Y + - b.X * c.Y - c.X * b.Y; + a.Y * c.X - a.X * c.Y + + b.X * c.Y - c.X * b.Y; } }; -- cgit v1.2.3