Skip to content

Commit 61ada83

Browse files
committed
Fix include guard (#ifedf -> #ifndef).
1 parent e08537e commit 61ada83

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

PathCompacter.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2828
THE SOFTWARE.
2929
*/
3030

31-
#ifdef PATH_COMPACTER_HEADER_INCLUDED
31+
#ifndef PATH_COMPACTER_HEADER_INCLUDED
3232
#define PATH_COMPACTER_HEADER_INCLUDED
3333

3434
// The following struct represents a double precision 2D point.
@@ -40,10 +40,12 @@ typedef struct DVector2D
4040

4141
// Use a typedef'd function pointer to refer to the metric calculation callbacks.
4242
// These accept the start and end point of the path or subproblem, and the intermediate
43-
// point in consideration. The segment length is passed in as well so that the callback does
44-
// not have to recalculate it every time it gets called.
43+
// point in consideration. The square of the segment length is passed in as well so that the
44+
// callback does not have to recalculate it every time it gets called.
45+
// These callbacks must return the square of the actual value that they intend to be compared
46+
// against epsilon. This is because squaring often is better than sqrt'ing sometimes.
4547
typedef double (*DeviationMetric)(DVector2D startOfSegment, DVector2D endOfSegment,
46-
DVector2D point, double dSegmentLength);
48+
DVector2D point, double dSquareSegmentLength);
4749

4850
// This function iteratively simulates the recursive Ramer-Douglas-Peucker algorithm.
4951
// https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm
@@ -60,7 +62,7 @@ extern int compactPath(DVector2D *pPointArray, int iPointsInCurrentPath,
6062

6163
// Declare several metric function implementations.
6264

63-
extern DeviationMetric perpendicularOffsetDeviationMetric;
65+
extern DeviationMetric perpendicularDistanceDeviationMetric;
6466
extern DeviationMetric shortestDistanceToSegmentDeviationMetric;
6567

6668
#endif

0 commit comments

Comments
 (0)