Coverage Report

Created: 2025-07-17 06:34

/src/geos/src/geom/Position.cpp
Line
Count
Source (jump to first uncovered line)
1
/**********************************************************************
2
 *
3
 * GEOS - Geometry Engine Open Source
4
 * http://geos.osgeo.org
5
 *
6
 * Copyright (C) 2001-2002 Vivid Solutions Inc.
7
 * Copyright (C) 2005 Refractions Research Inc.
8
 *
9
 * This is free software; you can redistribute and/or modify it under
10
 * the terms of the GNU Lesser General Public Licence as published
11
 * by the Free Software Foundation.
12
 * See the COPYING file for more information.
13
 *
14
 **********************************************************************
15
 *
16
 * Last port: geom/Position.java rev. 1.4 (JTS-1.10)
17
 *
18
 **********************************************************************/
19
20
#include <geos/geom/Position.h>
21
22
#ifndef GEOS_DEBUG
23
#define GEOS_DEBUG 0
24
#endif
25
26
#if GEOS_DEBUG
27
#include <iostream>
28
#endif
29
30
namespace geos {
31
namespace geom { // geos.geom
32
33
/**
34
 * Returns LEFT if the position is RIGHT, RIGHT if the position is LEFT, or the position
35
 * otherwise.
36
 */
37
int
38
Position::opposite(int position)
39
0
{
40
0
    if(position == LEFT) {
41
0
        return RIGHT;
42
0
    }
43
0
    if(position == RIGHT) {
44
0
        return LEFT;
45
0
    }
46
#if GEOS_DEBUG
47
    std::cerr << "Position::opposite: position is neither LEFT (" << LEFT << ") nor RIGHT (" << RIGHT << ") but " <<
48
              position << std::endl;
49
#endif
50
0
    return position;
51
0
}
52
53
} // namespace geos.geom
54
} // namespace geos