Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: build
# This workflow is triggered on pushes to the repository.
on: [push]

jobs:
build:
name: build-linux
runs-on: ubuntu-latest
container: tipibuild/tipi-ubuntu
steps:
- name: checkout
uses: actions/checkout@v2
- name: tipi builds project
run: |
export HOME=/root
mkdir -p ~/.tipi
tipi . -t linux --dont-upgrade --verbose --test all
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ libcity
unit_tests
doc
include
/build
6 changes: 6 additions & 0 deletions .tipi/deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"unittest-cpp/unittest-cpp" : { "@" : "v2.0.0",
"x:linux": ["UnitTest++/Win32/*"],
"x:macos": ["UnitTest++/Win32/*"],
"x:windows": ["UnitTest++/Posix/*"] }
}
16 changes: 16 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ BUILD
This will build both the staticaly and dynamicaly linked versions
and also extract headers from source tree into include/.

BUILD with tipi.build
To build and hack on libcity, you can build, install dependencies and run all tests with any of :
- `tipi . -t macos`
- `tipi . -t linux`
- `tipi . -t windows`

INSTALL with tipi.build
`libcity` can be easily used with the [tipi.build](https://tipi.build) dependency manager, by adding the following to a `.tipi/deps`:

```json
{
"CallForSanity/libcity": { }
}
```


DOCUMENTATION
Documentation can be extracted from the source codes with doxygen.

Expand Down
10 changes: 5 additions & 5 deletions src/geometry/point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ void Point::set(double const& xCoord, double const& yCoord, double const& zCoord
zPosition = zCoord;
}

bool Point::operator==(Point const& second)
bool Point::operator==(Point const& second) const
{
return std::abs(xPosition - second.x()) < libcity::COORDINATES_EPSILON &&
std::abs(yPosition - second.y()) < libcity::COORDINATES_EPSILON &&
std::abs(zPosition - second.z()) < libcity::COORDINATES_EPSILON;
}

bool Point::operator!=(Point const& second)
bool Point::operator!=(Point const& second) const
{
return !(*this == second);
}

bool Point::operator<(Point const& second)
bool Point::operator<(Point const& second) const
{
if (x() < second.x())
{
Expand All @@ -72,7 +72,7 @@ bool Point::operator<(Point const& second)
return false;
}

bool Point::operator>(Point const& second)
bool Point::operator>(Point const& second) const
{
if (x() > second.x())
{
Expand Down Expand Up @@ -110,4 +110,4 @@ std::string Point::toString() const
std::stringstream convertor;
convertor << "Point(" << xPosition << ", " << yPosition << ", " << zPosition << ")";
return convertor.str();
}
}
10 changes: 5 additions & 5 deletions src/geometry/point.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ class Point
void setY(double const& coordinate);
void setZ(double const& coordinate);

bool operator==(Point const& second);
bool operator!=(Point const& second);
bool operator<(Point const& second);
bool operator>(Point const& second);
bool operator==(Point const& second) const;
bool operator!=(Point const& second) const;
bool operator<(Point const& second) const;
bool operator>(Point const& second) const;

Point& operator+=(Vector const& difference);
Point operator+(Vector const& difference) const;
Expand Down Expand Up @@ -84,4 +84,4 @@ inline void Point::setZ(double const& coordinate)
zPosition = coordinate;
}

#endif
#endif