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
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ To install the Python package:

`pip install visilibity`

### On Windows

Make sure you have the buildtools installed:
1. Download [Buildtools für Visual Studio 2022](https://aka.ms/vs/17/release/vs_BuildTools.exe)
2. Select `C++ Tools for Linux Development` and install

After that you need to install the `swig` and `cython`. When using conda just run
```
conda install swig boost cython
```

Now you can install the package with
```
pip install .
```

## Run test with example

After installation, it would possible to run the test example `visilibity_test.py`.
Expand Down
22 changes: 12 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from distutils.core import setup, Extension
from distutils.command.build import build
from setuptools import setup, Extension
from setuptools.command.build import build


class CustomBuild(build):
sub_commands = [
('build_ext', build.has_ext_modules),
('build_py', build.has_pure_modules),
('build_clib', build.has_c_libraries),
('build_scripts', build.has_scripts),
]
('build_ext', lambda self: True),
('build_py', lambda self: True),
('build_clib', lambda self: True),
('build_scripts', lambda self: True),
]

module = Extension('_visilibity', swig_opts=['-c++'],
sources=['visilibity.i', 'visilibity.cpp'],
include_dirs=['.']) # Assuming 'visilibity.hpp' is in the current directory

module = Extension('_visilibity', swig_opts = ['-c++'],
sources = ['visilibity.i', 'visilibity.cpp'],
headers = ['visilibity.hpp'], include = ['visilibity.hpp'])

setup (name = 'VisiLibity',
version = '1.0.10',
Expand Down
6 changes: 2 additions & 4 deletions visilibity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ License along with VisiLibity. If not, see <http://www.gnu.org/licenses/>.

//Uncomment these lines when compiling under
//Microsoft Visual Studio
/*

#include <limits>
#define NAN std::numeric_limits<double>::quiet_NaN()
#define INFINITY std::numeric_limits<double>::infinity()
#define M_PI 3.141592653589793238462643
#define and &&
#define or ||
*/
// uncomment end

#include <cmath> //math functions in std namespace
#include <vector>
Expand Down