diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5c58a2e --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.gitignore b/.gitignore index c59dc9c..fa87f69 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ libcity unit_tests doc include +/build diff --git a/.tipi/deps b/.tipi/deps new file mode 100644 index 0000000..9907c1b --- /dev/null +++ b/.tipi/deps @@ -0,0 +1,6 @@ +{ + "unittest-cpp/unittest-cpp" : { "@" : "v2.0.0", + "x:linux": ["UnitTest++/Win32/*"], + "x:macos": ["UnitTest++/Win32/*"], + "x:windows": ["UnitTest++/Posix/*"] } +} diff --git a/README b/README index 1185200..6ac381d 100644 --- a/README +++ b/README @@ -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. diff --git a/src/geometry/point.cpp b/src/geometry/point.cpp index d86a8f0..e9189ea 100644 --- a/src/geometry/point.cpp +++ b/src/geometry/point.cpp @@ -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()) { @@ -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()) { @@ -110,4 +110,4 @@ std::string Point::toString() const std::stringstream convertor; convertor << "Point(" << xPosition << ", " << yPosition << ", " << zPosition << ")"; return convertor.str(); -} \ No newline at end of file +} diff --git a/src/geometry/point.h b/src/geometry/point.h index 6d9ba4d..b6dd027 100644 --- a/src/geometry/point.h +++ b/src/geometry/point.h @@ -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; @@ -84,4 +84,4 @@ inline void Point::setZ(double const& coordinate) zPosition = coordinate; } -#endif \ No newline at end of file +#endif