Skip to content

Commit

Permalink
python.h include should be last in bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Speierers committed Jul 22, 2020
1 parent a7be0ad commit 526a176
Show file tree
Hide file tree
Showing 40 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/libcore/python/bitmap.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <mitsuba/core/bitmap.h>
#include <mitsuba/core/filesystem.h>
#include <mitsuba/core/stream.h>
#include <mitsuba/python/python.h>
#include <pybind11/numpy.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(Bitmap) {
using Float = typename Bitmap::Float;
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/cast.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/logger.h>
#include <mitsuba/python/python.h>

using Caster = py::object(*)(mitsuba::Object *);

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/distr_2d_v.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/distr_2d.h>
#include <pybind11/numpy.h>
#include <enoki/stl.h>
#include <mitsuba/python/python.h>

template <typename Warp> auto bind_warp(py::module &m,
const char *name,
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/filesystem.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/filesystem.h>
#include <mitsuba/python/python.h>

using namespace mitsuba::filesystem;

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/main_v.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/vector.h>
#include <mitsuba/python/python.h>

MTS_PY_DECLARE(Object);
MTS_PY_DECLARE(BoundingBox);
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/math_v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include <enoki/morton.h>
#include <enoki/special.h>
#include <enoki/color.h>
#include <mitsuba/python/python.h>
#include <bitset>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(math) {
MTS_PY_IMPORT_TYPES()
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/mmap.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <mitsuba/core/mmap.h>
#include <mitsuba/core/filesystem.h>
#include <mitsuba/python/python.h>
#include <pybind11/numpy.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(MemoryMappedFile) {
MTS_PY_CLASS(MemoryMappedFile, Object, py::buffer_protocol())
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/object.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/logger.h>
#include <mitsuba/core/plugin.h>
#include <mitsuba/python/python.h>

extern py::object cast_object(Object *o);

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/object_v.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/transform.h>
#include <mitsuba/core/frame.h>
#include <mitsuba/python/python.h>

#define GET_ATTR(T) \
if (strcmp(type.name(), typeid(T).name()) == 0) \
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/progress.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/progress.h>
#include <mitsuba/core/logger.h>
#include <mitsuba/core/appender.h>
#include <mitsuba/core/thread.h>
#include <pybind11/eval.h>
#include <mitsuba/python/python.h>

/// Escape strings to make them HTML-safe
std::string escape_html(const std::string& data) {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/qmc_v.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/core/qmc.h>
#include <mitsuba/python/python.h>
#include <pybind11/numpy.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(qmc) {
MTS_PY_IMPORT_TYPES()
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/ray_v.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/ray.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(Ray) {
MTS_PY_IMPORT_TYPES_DYNAMIC()
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/rfilter.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/core/rfilter.h>
#include <mitsuba/python/python.h>
#include <pybind11/numpy.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(rfilter) {
py::enum_<FilterBoundaryCondition>(m, "FilterBoundaryCondition", D(FilterBoundaryCondition))
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/spline_v.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/core/spline.h>
#include <mitsuba/python/python.h>
#include <pybind11/numpy.h>
#include <mitsuba/python/python.h>

template<typename Float_>
void bind_spline(py::module &m) {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/struct.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <mitsuba/core/struct.h>
#include <mitsuba/core/simd.h>
#include <mitsuba/core/logger.h>
#include <mitsuba/python/python.h>
#include <pybind11/numpy.h>
#include <mitsuba/python/python.h>

/// Conversion between 'Struct' and NumPy 'dtype' data structures
py::dtype dtype_for_struct(const Struct *s) {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/transform_v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include <mitsuba/core/transform.h>
#include <mitsuba/core/frame.h>
#include <mitsuba/core/properties.h>
#include <mitsuba/python/python.h>
#include <pybind11/numpy.h>
#include <mitsuba/python/python.h>


template <typename Float>
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/vector_v.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/core/vector.h>
#include <mitsuba/python/python.h>
#include <mitsuba/core/fwd.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(vector) {
MTS_PY_IMPORT_TYPES()
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/python/warp_v.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/warp.h>
#include <enoki/stl.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(warp) {
MTS_PY_IMPORT_TYPES()
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/bsdf.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/bsdf.h>
#include <mitsuba/render/shape.h>
#include <mitsuba/core/properties.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(BSDFContext) {
py::enum_<TransportMode>(m, "TransportMode", D(TransportMode))
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/bsdf_v.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/bsdf.h>
#include <mitsuba/render/shape.h>
#include <mitsuba/core/properties.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(BSDFSample) {
MTS_PY_IMPORT_TYPES_DYNAMIC()
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/emitter.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/emitter.h>
#include <mitsuba/core/properties.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(EmitterExtras) {
py::enum_<EmitterFlags>(m, "EmitterFlags", D(EmitterFlags))
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/emitter_v.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/emitter.h>
#include <mitsuba/core/properties.h>
#include <mitsuba/python/python.h>

/// Trampoline for derived types implemented in Python
MTS_VARIANT class PyEmitter : public Emitter<Float, Spectrum> {
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/endpoint_v.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/bitmap.h>
#include <mitsuba/core/spectrum.h>
#include <mitsuba/core/transform.h>
Expand All @@ -7,6 +6,7 @@
#include <mitsuba/render/records.h>
#include <mitsuba/render/scene.h>
#include <mitsuba/render/shape.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(Endpoint) {
MTS_PY_IMPORT_TYPES()
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/fresnel_v.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/fresnel.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(fresnel) {
MTS_PY_IMPORT_TYPES()
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/imageblock_v.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/bitmap.h>
#include <mitsuba/render/imageblock.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(ImageBlock) {
MTS_PY_IMPORT_TYPES(ImageBlock, ReconstructionFilter)
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/integrator_v.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/integrator.h>
#include <mitsuba/core/properties.h>
#include <mitsuba/core/thread.h>
#include <mitsuba/core/tls.h>
#include <mitsuba/python/python.h>

#if defined(__APPLE__) || defined(__linux__)
# define MTS_HANDLE_SIGINT 1
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/interaction_v.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/bsdf.h>
#include <mitsuba/render/emitter.h>
#include <mitsuba/render/interaction.h>
#include <mitsuba/render/medium.h>
#include <mitsuba/render/records.h>
#include <mitsuba/render/scene.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(Interaction) {
MTS_PY_IMPORT_TYPES_DYNAMIC()
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/medium_v.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <mitsuba/core/properties.h>
#include <mitsuba/python/python.h>
#include <mitsuba/render/medium.h>
#include <mitsuba/render/phase.h>
#include <mitsuba/render/scene.h>
#include <mitsuba/python/python.h>

/// Trampoline for derived types implemented in Python
MTS_VARIANT class PyMedium : public Medium<Float, Spectrum> {
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/microfacet.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/properties.h>
#include <mitsuba/render/microfacet.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(MicrofacetType) {
py::enum_<MicrofacetType>(m, "MicrofacetType", D(MicrofacetType), py::arithmetic())
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/microfacet_v.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/python/python.h>
#include <mitsuba/core/properties.h>
#include <mitsuba/render/microfacet.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(MicrofacetDistribution) {
MTS_PY_IMPORT_TYPES(MicrofacetDistribution)
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/mueller_v.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/mueller.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(mueller) {
MTS_PY_IMPORT_TYPES()
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/phase.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <mitsuba/core/properties.h>
#include <mitsuba/python/python.h>
#include <mitsuba/render/medium.h>
#include <mitsuba/render/phase.h>
#include <mitsuba/python/python.h>



Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/phase_v.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <mitsuba/core/properties.h>
#include <mitsuba/python/python.h>
#include <mitsuba/render/medium.h>
#include <mitsuba/render/phase.h>
#include <mitsuba/python/python.h>

/// Trampoline for derived types implemented in Python
MTS_VARIANT class PyPhaseFunction : public PhaseFunction<Float, Spectrum> {
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/records_v.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/shape.h>
#include <mitsuba/render/records.h>
#include <mitsuba/render/scene.h>
#include <mitsuba/python/python.h>

template<typename Class, typename PyClass>
void bind_set_object(PyClass &cl) {
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/sampler_v.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/sampler.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(Sampler) {
MTS_PY_IMPORT_TYPES(Sampler)
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/scene_v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Mesh *>(s.shape(i)));
else
return py::cast(s.shape(i));
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/sensor_v.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/sensor.h>
#include <mitsuba/core/properties.h>
#include <mitsuba/python/python.h>

/// Trampoline for derived types implemented in Python
MTS_VARIANT class PySensor : public Sensor<Float, Spectrum> {
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/texture3d_v.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <mitsuba/core/properties.h>
#include <mitsuba/python/python.h>
#include <mitsuba/render/interaction.h>
#include <mitsuba/render/spectrum.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(Volume) {
MTS_PY_CLASS(Volume, Object)
Expand Down
2 changes: 1 addition & 1 deletion src/librender/python/texture_v.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <mitsuba/python/python.h>
#include <mitsuba/render/interaction.h>
#include <mitsuba/render/texture.h>
#include <mitsuba/python/python.h>

MTS_PY_EXPORT(Texture) {
MTS_PY_IMPORT_TYPES(Texture)
Expand Down
2 changes: 1 addition & 1 deletion src/libui/python/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mitsuba/python/python.h>
#include <mitsuba/ui/texture.h>
#include <mitsuba/python/python.h>

PYBIND11_DECLARE_HOLDER_TYPE(T, nanogui::ref<T>)

Expand Down

0 comments on commit 526a176

Please sign in to comment.