From 526a1765824821bcdbbb02779c3a84ffb045c768 Mon Sep 17 00:00:00 2001 From: Sebastien Speierer Date: Mon, 20 Jul 2020 13:06:44 +0200 Subject: [PATCH] python.h include should be last in bindings --- src/libcore/python/bitmap.cpp | 2 +- src/libcore/python/cast.cpp | 2 +- src/libcore/python/distr_2d_v.cpp | 2 +- src/libcore/python/filesystem.cpp | 2 +- src/libcore/python/main_v.cpp | 2 +- src/libcore/python/math_v.cpp | 2 +- src/libcore/python/mmap.cpp | 2 +- src/libcore/python/object.cpp | 2 +- src/libcore/python/object_v.cpp | 2 +- src/libcore/python/progress.cpp | 2 +- src/libcore/python/qmc_v.cpp | 2 +- src/libcore/python/ray_v.cpp | 2 +- src/libcore/python/rfilter.cpp | 2 +- src/libcore/python/spline_v.cpp | 2 +- src/libcore/python/struct.cpp | 2 +- src/libcore/python/transform_v.cpp | 2 +- src/libcore/python/vector_v.cpp | 2 +- src/libcore/python/warp_v.cpp | 2 +- src/librender/python/bsdf.cpp | 2 +- src/librender/python/bsdf_v.cpp | 2 +- src/librender/python/emitter.cpp | 2 +- src/librender/python/emitter_v.cpp | 2 +- src/librender/python/endpoint_v.cpp | 2 +- src/librender/python/fresnel_v.cpp | 2 +- src/librender/python/imageblock_v.cpp | 2 +- src/librender/python/integrator_v.cpp | 2 +- src/librender/python/interaction_v.cpp | 2 +- src/librender/python/medium_v.cpp | 2 +- src/librender/python/microfacet.cpp | 2 +- src/librender/python/microfacet_v.cpp | 2 +- src/librender/python/mueller_v.cpp | 2 +- src/librender/python/phase.cpp | 2 +- src/librender/python/phase_v.cpp | 2 +- src/librender/python/records_v.cpp | 2 +- src/librender/python/sampler_v.cpp | 2 +- src/librender/python/scene_v.cpp | 2 +- src/librender/python/sensor_v.cpp | 2 +- src/librender/python/texture3d_v.cpp | 2 +- src/librender/python/texture_v.cpp | 2 +- src/libui/python/main.cpp | 2 +- 40 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/libcore/python/bitmap.cpp b/src/libcore/python/bitmap.cpp index c0368aeb5..8e52d2064 100644 --- a/src/libcore/python/bitmap.cpp +++ b/src/libcore/python/bitmap.cpp @@ -1,8 +1,8 @@ #include #include #include -#include #include +#include MTS_PY_EXPORT(Bitmap) { using Float = typename Bitmap::Float; diff --git a/src/libcore/python/cast.cpp b/src/libcore/python/cast.cpp index 751e1d973..4c517e151 100644 --- a/src/libcore/python/cast.cpp +++ b/src/libcore/python/cast.cpp @@ -1,5 +1,5 @@ -#include #include +#include using Caster = py::object(*)(mitsuba::Object *); diff --git a/src/libcore/python/distr_2d_v.cpp b/src/libcore/python/distr_2d_v.cpp index 05c6e19e2..9b26c3d34 100644 --- a/src/libcore/python/distr_2d_v.cpp +++ b/src/libcore/python/distr_2d_v.cpp @@ -1,7 +1,7 @@ -#include #include #include #include +#include template auto bind_warp(py::module &m, const char *name, diff --git a/src/libcore/python/filesystem.cpp b/src/libcore/python/filesystem.cpp index 34d1eecf0..8a6fd9f41 100644 --- a/src/libcore/python/filesystem.cpp +++ b/src/libcore/python/filesystem.cpp @@ -1,5 +1,5 @@ -#include #include +#include using namespace mitsuba::filesystem; diff --git a/src/libcore/python/main_v.cpp b/src/libcore/python/main_v.cpp index b0282afb0..133d665fc 100644 --- a/src/libcore/python/main_v.cpp +++ b/src/libcore/python/main_v.cpp @@ -1,5 +1,5 @@ -#include #include +#include MTS_PY_DECLARE(Object); MTS_PY_DECLARE(BoundingBox); diff --git a/src/libcore/python/math_v.cpp b/src/libcore/python/math_v.cpp index ae94fbc73..97a79d83d 100644 --- a/src/libcore/python/math_v.cpp +++ b/src/libcore/python/math_v.cpp @@ -2,8 +2,8 @@ #include #include #include -#include #include +#include MTS_PY_EXPORT(math) { MTS_PY_IMPORT_TYPES() diff --git a/src/libcore/python/mmap.cpp b/src/libcore/python/mmap.cpp index 65c54d928..7202bc876 100644 --- a/src/libcore/python/mmap.cpp +++ b/src/libcore/python/mmap.cpp @@ -1,7 +1,7 @@ #include #include -#include #include +#include MTS_PY_EXPORT(MemoryMappedFile) { MTS_PY_CLASS(MemoryMappedFile, Object, py::buffer_protocol()) diff --git a/src/libcore/python/object.cpp b/src/libcore/python/object.cpp index 04ef106b9..adf9024c5 100644 --- a/src/libcore/python/object.cpp +++ b/src/libcore/python/object.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include extern py::object cast_object(Object *o); diff --git a/src/libcore/python/object_v.cpp b/src/libcore/python/object_v.cpp index fe9a5b7f5..44bbade04 100644 --- a/src/libcore/python/object_v.cpp +++ b/src/libcore/python/object_v.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include #define GET_ATTR(T) \ if (strcmp(type.name(), typeid(T).name()) == 0) \ diff --git a/src/libcore/python/progress.cpp b/src/libcore/python/progress.cpp index 502e5e26c..f8fbfdf52 100644 --- a/src/libcore/python/progress.cpp +++ b/src/libcore/python/progress.cpp @@ -1,9 +1,9 @@ -#include #include #include #include #include #include +#include /// Escape strings to make them HTML-safe std::string escape_html(const std::string& data) { diff --git a/src/libcore/python/qmc_v.cpp b/src/libcore/python/qmc_v.cpp index db58b8402..10e6fe8c0 100644 --- a/src/libcore/python/qmc_v.cpp +++ b/src/libcore/python/qmc_v.cpp @@ -1,6 +1,6 @@ #include -#include #include +#include MTS_PY_EXPORT(qmc) { MTS_PY_IMPORT_TYPES() diff --git a/src/libcore/python/ray_v.cpp b/src/libcore/python/ray_v.cpp index b563bf20a..ff8436243 100644 --- a/src/libcore/python/ray_v.cpp +++ b/src/libcore/python/ray_v.cpp @@ -1,5 +1,5 @@ -#include #include +#include MTS_PY_EXPORT(Ray) { MTS_PY_IMPORT_TYPES_DYNAMIC() diff --git a/src/libcore/python/rfilter.cpp b/src/libcore/python/rfilter.cpp index 7e803f5f8..d748ca389 100644 --- a/src/libcore/python/rfilter.cpp +++ b/src/libcore/python/rfilter.cpp @@ -1,6 +1,6 @@ #include -#include #include +#include MTS_PY_EXPORT(rfilter) { py::enum_(m, "FilterBoundaryCondition", D(FilterBoundaryCondition)) diff --git a/src/libcore/python/spline_v.cpp b/src/libcore/python/spline_v.cpp index 9f2ed9f94..e48aa3dca 100644 --- a/src/libcore/python/spline_v.cpp +++ b/src/libcore/python/spline_v.cpp @@ -1,6 +1,6 @@ #include -#include #include +#include template void bind_spline(py::module &m) { diff --git a/src/libcore/python/struct.cpp b/src/libcore/python/struct.cpp index 37b4a52f0..f81f5649d 100644 --- a/src/libcore/python/struct.cpp +++ b/src/libcore/python/struct.cpp @@ -1,8 +1,8 @@ #include #include #include -#include #include +#include /// Conversion between 'Struct' and NumPy 'dtype' data structures py::dtype dtype_for_struct(const Struct *s) { diff --git a/src/libcore/python/transform_v.cpp b/src/libcore/python/transform_v.cpp index daf9f82e5..3e5d68949 100644 --- a/src/libcore/python/transform_v.cpp +++ b/src/libcore/python/transform_v.cpp @@ -2,8 +2,8 @@ #include #include #include -#include #include +#include template diff --git a/src/libcore/python/vector_v.cpp b/src/libcore/python/vector_v.cpp index 9022925ad..cfd450beb 100644 --- a/src/libcore/python/vector_v.cpp +++ b/src/libcore/python/vector_v.cpp @@ -1,6 +1,6 @@ #include -#include #include +#include MTS_PY_EXPORT(vector) { MTS_PY_IMPORT_TYPES() diff --git a/src/libcore/python/warp_v.cpp b/src/libcore/python/warp_v.cpp index e196a05ae..6885ac4e3 100644 --- a/src/libcore/python/warp_v.cpp +++ b/src/libcore/python/warp_v.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include MTS_PY_EXPORT(warp) { MTS_PY_IMPORT_TYPES() diff --git a/src/librender/python/bsdf.cpp b/src/librender/python/bsdf.cpp index 12f23514e..e3a85d085 100644 --- a/src/librender/python/bsdf.cpp +++ b/src/librender/python/bsdf.cpp @@ -1,7 +1,7 @@ -#include #include #include #include +#include MTS_PY_EXPORT(BSDFContext) { py::enum_(m, "TransportMode", D(TransportMode)) diff --git a/src/librender/python/bsdf_v.cpp b/src/librender/python/bsdf_v.cpp index 3c6dd4bc1..e2ebdfbb8 100644 --- a/src/librender/python/bsdf_v.cpp +++ b/src/librender/python/bsdf_v.cpp @@ -1,7 +1,7 @@ -#include #include #include #include +#include MTS_PY_EXPORT(BSDFSample) { MTS_PY_IMPORT_TYPES_DYNAMIC() diff --git a/src/librender/python/emitter.cpp b/src/librender/python/emitter.cpp index f91ae8985..4d909a0a5 100644 --- a/src/librender/python/emitter.cpp +++ b/src/librender/python/emitter.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include MTS_PY_EXPORT(EmitterExtras) { py::enum_(m, "EmitterFlags", D(EmitterFlags)) diff --git a/src/librender/python/emitter_v.cpp b/src/librender/python/emitter_v.cpp index d06aaadae..c6d1d4357 100644 --- a/src/librender/python/emitter_v.cpp +++ b/src/librender/python/emitter_v.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include /// Trampoline for derived types implemented in Python MTS_VARIANT class PyEmitter : public Emitter { diff --git a/src/librender/python/endpoint_v.cpp b/src/librender/python/endpoint_v.cpp index bdec64c4b..d9e7046b1 100644 --- a/src/librender/python/endpoint_v.cpp +++ b/src/librender/python/endpoint_v.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -7,6 +6,7 @@ #include #include #include +#include MTS_PY_EXPORT(Endpoint) { MTS_PY_IMPORT_TYPES() diff --git a/src/librender/python/fresnel_v.cpp b/src/librender/python/fresnel_v.cpp index 295639b12..449bb4258 100644 --- a/src/librender/python/fresnel_v.cpp +++ b/src/librender/python/fresnel_v.cpp @@ -1,5 +1,5 @@ -#include #include +#include MTS_PY_EXPORT(fresnel) { MTS_PY_IMPORT_TYPES() diff --git a/src/librender/python/imageblock_v.cpp b/src/librender/python/imageblock_v.cpp index 8b190a8ae..96a33c6a1 100644 --- a/src/librender/python/imageblock_v.cpp +++ b/src/librender/python/imageblock_v.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include MTS_PY_EXPORT(ImageBlock) { MTS_PY_IMPORT_TYPES(ImageBlock, ReconstructionFilter) diff --git a/src/librender/python/integrator_v.cpp b/src/librender/python/integrator_v.cpp index f8a62c3df..d0d1a8c64 100644 --- a/src/librender/python/integrator_v.cpp +++ b/src/librender/python/integrator_v.cpp @@ -1,8 +1,8 @@ -#include #include #include #include #include +#include #if defined(__APPLE__) || defined(__linux__) # define MTS_HANDLE_SIGINT 1 diff --git a/src/librender/python/interaction_v.cpp b/src/librender/python/interaction_v.cpp index a5ce8b299..cb1ec65e8 100644 --- a/src/librender/python/interaction_v.cpp +++ b/src/librender/python/interaction_v.cpp @@ -1,10 +1,10 @@ -#include #include #include #include #include #include #include +#include MTS_PY_EXPORT(Interaction) { MTS_PY_IMPORT_TYPES_DYNAMIC() diff --git a/src/librender/python/medium_v.cpp b/src/librender/python/medium_v.cpp index 6e3ce761f..3b9128d25 100644 --- a/src/librender/python/medium_v.cpp +++ b/src/librender/python/medium_v.cpp @@ -1,8 +1,8 @@ #include -#include #include #include #include +#include /// Trampoline for derived types implemented in Python MTS_VARIANT class PyMedium : public Medium { diff --git a/src/librender/python/microfacet.cpp b/src/librender/python/microfacet.cpp index bbe402d75..393b88b56 100644 --- a/src/librender/python/microfacet.cpp +++ b/src/librender/python/microfacet.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include MTS_PY_EXPORT(MicrofacetType) { py::enum_(m, "MicrofacetType", D(MicrofacetType), py::arithmetic()) diff --git a/src/librender/python/microfacet_v.cpp b/src/librender/python/microfacet_v.cpp index c9624354c..d3c0cf7c5 100644 --- a/src/librender/python/microfacet_v.cpp +++ b/src/librender/python/microfacet_v.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include MTS_PY_EXPORT(MicrofacetDistribution) { MTS_PY_IMPORT_TYPES(MicrofacetDistribution) diff --git a/src/librender/python/mueller_v.cpp b/src/librender/python/mueller_v.cpp index daa71ac7c..dfe8488b2 100644 --- a/src/librender/python/mueller_v.cpp +++ b/src/librender/python/mueller_v.cpp @@ -1,5 +1,5 @@ -#include #include +#include MTS_PY_EXPORT(mueller) { MTS_PY_IMPORT_TYPES() diff --git a/src/librender/python/phase.cpp b/src/librender/python/phase.cpp index 1e29d22a2..fe2ecba96 100644 --- a/src/librender/python/phase.cpp +++ b/src/librender/python/phase.cpp @@ -1,7 +1,7 @@ #include -#include #include #include +#include diff --git a/src/librender/python/phase_v.cpp b/src/librender/python/phase_v.cpp index 05ab22b2c..de10ed969 100644 --- a/src/librender/python/phase_v.cpp +++ b/src/librender/python/phase_v.cpp @@ -1,7 +1,7 @@ #include -#include #include #include +#include /// Trampoline for derived types implemented in Python MTS_VARIANT class PyPhaseFunction : public PhaseFunction { diff --git a/src/librender/python/records_v.cpp b/src/librender/python/records_v.cpp index 9e6626973..58f7cf3fc 100644 --- a/src/librender/python/records_v.cpp +++ b/src/librender/python/records_v.cpp @@ -1,7 +1,7 @@ -#include #include #include #include +#include template void bind_set_object(PyClass &cl) { diff --git a/src/librender/python/sampler_v.cpp b/src/librender/python/sampler_v.cpp index fda4b281c..ec5c74914 100644 --- a/src/librender/python/sampler_v.cpp +++ b/src/librender/python/sampler_v.cpp @@ -1,5 +1,5 @@ -#include #include +#include MTS_PY_EXPORT(Sampler) { MTS_PY_IMPORT_TYPES(Sampler) diff --git a/src/librender/python/scene_v.cpp b/src/librender/python/scene_v.cpp index 0c813547a..97c0d3add 100644 --- a/src/librender/python/scene_v.cpp +++ b/src/librender/python/scene_v.cpp @@ -19,7 +19,7 @@ MTS_PY_EXPORT(ShapeKDTree) { if (i >= s.primitive_count()) throw py::index_error(); Shape *shape = s.shape(i); - if (shape->class_()->derives_from(MTS_CLASS(Mesh))) + if (shape->is_mesh()) return py::cast(static_cast(s.shape(i))); else return py::cast(s.shape(i)); diff --git a/src/librender/python/sensor_v.cpp b/src/librender/python/sensor_v.cpp index 41c2cc73a..5810689c4 100644 --- a/src/librender/python/sensor_v.cpp +++ b/src/librender/python/sensor_v.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include /// Trampoline for derived types implemented in Python MTS_VARIANT class PySensor : public Sensor { diff --git a/src/librender/python/texture3d_v.cpp b/src/librender/python/texture3d_v.cpp index 886707b8d..e79339f64 100644 --- a/src/librender/python/texture3d_v.cpp +++ b/src/librender/python/texture3d_v.cpp @@ -1,7 +1,7 @@ #include -#include #include #include +#include MTS_PY_EXPORT(Volume) { MTS_PY_CLASS(Volume, Object) diff --git a/src/librender/python/texture_v.cpp b/src/librender/python/texture_v.cpp index e93a90f99..4ae8e9869 100644 --- a/src/librender/python/texture_v.cpp +++ b/src/librender/python/texture_v.cpp @@ -1,6 +1,6 @@ -#include #include #include +#include MTS_PY_EXPORT(Texture) { MTS_PY_IMPORT_TYPES(Texture) diff --git a/src/libui/python/main.cpp b/src/libui/python/main.cpp index 589f8cf41..06b257c63 100644 --- a/src/libui/python/main.cpp +++ b/src/libui/python/main.cpp @@ -1,5 +1,5 @@ -#include #include +#include PYBIND11_DECLARE_HOLDER_TYPE(T, nanogui::ref)