diff --git a/python/bindings/unused/renderer/drawable_lines.cpp b/python/bindings/unused/renderer/drawable_lines.cpp deleted file mode 100644 index 75db8415..00000000 --- a/python/bindings/unused/renderer/drawable_lines.cpp +++ /dev/null @@ -1,168 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include // __str__ - -#include -#include -#include -#include - - -#ifndef BINDER_PYBIND11_TYPE_CASTER - #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) - PYBIND11_MAKE_OPAQUE(std::shared_ptr) -#endif - -// easy3d::LinesDrawable file:easy3d/renderer/drawable_lines.h line:40 -struct PyCallBack_easy3d_LinesDrawable : public easy3d::LinesDrawable { - using easy3d::LinesDrawable::LinesDrawable; - - enum easy3d::Drawable::Type type() const override { - pybind11::gil_scoped_acquire gil; - pybind11::function overload = pybind11::get_overload(static_cast(this), "type"); - if (overload) { - auto o = overload.operator()(); - if (pybind11::detail::cast_is_temporary_value_reference::value) { - static pybind11::detail::override_caster_t caster; - return pybind11::detail::cast_ref(std::move(o), caster); - } - return pybind11::detail::cast_safe(std::move(o)); - } - return LinesDrawable::type(); - } - void update_buffers_internal() override { - pybind11::gil_scoped_acquire gil; - pybind11::function overload = pybind11::get_overload(static_cast(this), "update_buffers_internal"); - if (overload) { - auto o = overload.operator()(); - if (pybind11::detail::cast_is_temporary_value_reference::value) { - static pybind11::detail::override_caster_t caster; - return pybind11::detail::cast_ref(std::move(o), caster); - } - return pybind11::detail::cast_safe(std::move(o)); - } - return Drawable::update_buffers_internal(); - } -}; - -// easy3d::PointsDrawable file:easy3d/renderer/drawable_points.h line:42 -struct PyCallBack_easy3d_PointsDrawable : public easy3d::PointsDrawable { - using easy3d::PointsDrawable::PointsDrawable; - - enum easy3d::Drawable::Type type() const override { - pybind11::gil_scoped_acquire gil; - pybind11::function overload = pybind11::get_overload(static_cast(this), "type"); - if (overload) { - auto o = overload.operator()(); - if (pybind11::detail::cast_is_temporary_value_reference::value) { - static pybind11::detail::override_caster_t caster; - return pybind11::detail::cast_ref(std::move(o), caster); - } - return pybind11::detail::cast_safe(std::move(o)); - } - return PointsDrawable::type(); - } - void update_buffers_internal() override { - pybind11::gil_scoped_acquire gil; - pybind11::function overload = pybind11::get_overload(static_cast(this), "update_buffers_internal"); - if (overload) { - auto o = overload.operator()(); - if (pybind11::detail::cast_is_temporary_value_reference::value) { - static pybind11::detail::override_caster_t caster; - return pybind11::detail::cast_ref(std::move(o), caster); - } - return pybind11::detail::cast_safe(std::move(o)); - } - return Drawable::update_buffers_internal(); - } -}; - -// easy3d::TrianglesDrawable file:easy3d/renderer/drawable_triangles.h line:46 -struct PyCallBack_easy3d_TrianglesDrawable : public easy3d::TrianglesDrawable { - using easy3d::TrianglesDrawable::TrianglesDrawable; - - enum easy3d::Drawable::Type type() const override { - pybind11::gil_scoped_acquire gil; - pybind11::function overload = pybind11::get_overload(static_cast(this), "type"); - if (overload) { - auto o = overload.operator()(); - if (pybind11::detail::cast_is_temporary_value_reference::value) { - static pybind11::detail::override_caster_t caster; - return pybind11::detail::cast_ref(std::move(o), caster); - } - return pybind11::detail::cast_safe(std::move(o)); - } - return TrianglesDrawable::type(); - } - void update_buffers_internal() override { - pybind11::gil_scoped_acquire gil; - pybind11::function overload = pybind11::get_overload(static_cast(this), "update_buffers_internal"); - if (overload) { - auto o = overload.operator()(); - if (pybind11::detail::cast_is_temporary_value_reference::value) { - static pybind11::detail::override_caster_t caster; - return pybind11::detail::cast_ref(std::move(o), caster); - } - return pybind11::detail::cast_safe(std::move(o)); - } - return Drawable::update_buffers_internal(); - } -}; - -void bind_easy3d_renderer_drawable_lines(pybind11::module_& m) -{ - { // easy3d::LinesDrawable file:easy3d/renderer/drawable_lines.h line:40 - pybind11::class_, PyCallBack_easy3d_LinesDrawable, easy3d::Drawable> cl(m, "LinesDrawable", "The drawable for rendering a set of line segments, e.g., edges of a mesh, vector fields\n \n\n\n \n PointsDrawable, TrianglesDrawable"); - cl.def( pybind11::init( [](PyCallBack_easy3d_LinesDrawable const &o){ return new PyCallBack_easy3d_LinesDrawable(o); } ) ); - cl.def( pybind11::init( [](easy3d::LinesDrawable const &o){ return new easy3d::LinesDrawable(o); } ) ); - - pybind11::enum_(cl, "ImposterType", pybind11::arithmetic(), "") - .value("PLAIN", easy3d::LinesDrawable::PLAIN) - .value("CYLINDER", easy3d::LinesDrawable::CYLINDER) - .value("CONE", easy3d::LinesDrawable::CONE) - .export_values(); - - cl.def("type", (enum easy3d::Drawable::Type (easy3d::LinesDrawable::*)() const) &easy3d::LinesDrawable::type, "C++: easy3d::LinesDrawable::type() const --> enum easy3d::Drawable::Type"); - cl.def("impostor_type", (enum easy3d::LinesDrawable::ImposterType (easy3d::LinesDrawable::*)() const) &easy3d::LinesDrawable::impostor_type, "C++: easy3d::LinesDrawable::impostor_type() const --> enum easy3d::LinesDrawable::ImposterType"); - cl.def("set_impostor_type", (void (easy3d::LinesDrawable::*)(enum easy3d::LinesDrawable::ImposterType)) &easy3d::LinesDrawable::set_impostor_type, "C++: easy3d::LinesDrawable::set_impostor_type(enum easy3d::LinesDrawable::ImposterType) --> void", pybind11::arg("t")); - cl.def("line_width", (float (easy3d::LinesDrawable::*)() const) &easy3d::LinesDrawable::line_width, "C++: easy3d::LinesDrawable::line_width() const --> float"); - cl.def("set_line_width", (void (easy3d::LinesDrawable::*)(float)) &easy3d::LinesDrawable::set_line_width, "C++: easy3d::LinesDrawable::set_line_width(float) --> void", pybind11::arg("w")); - cl.def("assign", (class easy3d::LinesDrawable & (easy3d::LinesDrawable::*)(const class easy3d::LinesDrawable &)) &easy3d::LinesDrawable::operator=, "C++: easy3d::LinesDrawable::operator=(const class easy3d::LinesDrawable &) --> class easy3d::LinesDrawable &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - { // easy3d::PointsDrawable file:easy3d/renderer/drawable_points.h line:42 - pybind11::class_, PyCallBack_easy3d_PointsDrawable, easy3d::Drawable> cl(m, "PointsDrawable", "The drawable for rendering a set of points, e.g., point clouds, vertices of a mesh.\n \n\n\n \n LinesDrawable, TrianglesDrawable"); - cl.def( pybind11::init( [](PyCallBack_easy3d_PointsDrawable const &o){ return new PyCallBack_easy3d_PointsDrawable(o); } ) ); - cl.def( pybind11::init( [](easy3d::PointsDrawable const &o){ return new easy3d::PointsDrawable(o); } ) ); - - pybind11::enum_(cl, "ImposterType", pybind11::arithmetic(), "") - .value("PLAIN", easy3d::PointsDrawable::PLAIN) - .value("SPHERE", easy3d::PointsDrawable::SPHERE) - .value("SURFEL", easy3d::PointsDrawable::SURFEL) - .export_values(); - - cl.def("type", (enum easy3d::Drawable::Type (easy3d::PointsDrawable::*)() const) &easy3d::PointsDrawable::type, "C++: easy3d::PointsDrawable::type() const --> enum easy3d::Drawable::Type"); - cl.def("impostor_type", (enum easy3d::PointsDrawable::ImposterType (easy3d::PointsDrawable::*)() const) &easy3d::PointsDrawable::impostor_type, "Get/Set impostor type. \n\nC++: easy3d::PointsDrawable::impostor_type() const --> enum easy3d::PointsDrawable::ImposterType"); - cl.def("set_impostor_type", (void (easy3d::PointsDrawable::*)(enum easy3d::PointsDrawable::ImposterType)) &easy3d::PointsDrawable::set_impostor_type, "C++: easy3d::PointsDrawable::set_impostor_type(enum easy3d::PointsDrawable::ImposterType) --> void", pybind11::arg("t")); - cl.def("point_size", (float (easy3d::PointsDrawable::*)() const) &easy3d::PointsDrawable::point_size, "Get/Set point size. \n\nC++: easy3d::PointsDrawable::point_size() const --> float"); - cl.def("set_point_size", (void (easy3d::PointsDrawable::*)(float)) &easy3d::PointsDrawable::set_point_size, "C++: easy3d::PointsDrawable::set_point_size(float) --> void", pybind11::arg("s")); - cl.def("assign", (class easy3d::PointsDrawable & (easy3d::PointsDrawable::*)(const class easy3d::PointsDrawable &)) &easy3d::PointsDrawable::operator=, "C++: easy3d::PointsDrawable::operator=(const class easy3d::PointsDrawable &) --> class easy3d::PointsDrawable &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - { // easy3d::TrianglesDrawable file:easy3d/renderer/drawable_triangles.h line:46 - pybind11::class_, PyCallBack_easy3d_TrianglesDrawable, easy3d::Drawable> cl(m, "TrianglesDrawable", "The drawable for rendering a set of triangles, e.g., the surface of a triangular mesh.\n \n\n\n \n LinesDrawable, PointsDrawable\n\n \n TrianglesDrawable supports triangles only. Visualizing general polygons typically requires tessellating\n the faces into a set of triangles (using Tessellator or any other methods). Vertex coordinates and properties\n (e.g., color, normal) must be provided as consecutive triplets in an array to be transferred to GPU.\n See Drawable::update_vertex_buffer()."); - cl.def( pybind11::init( [](PyCallBack_easy3d_TrianglesDrawable const &o){ return new PyCallBack_easy3d_TrianglesDrawable(o); } ) ); - cl.def( pybind11::init( [](easy3d::TrianglesDrawable const &o){ return new easy3d::TrianglesDrawable(o); } ) ); - cl.def("type", (enum easy3d::Drawable::Type (easy3d::TrianglesDrawable::*)() const) &easy3d::TrianglesDrawable::type, "C++: easy3d::TrianglesDrawable::type() const --> enum easy3d::Drawable::Type"); - cl.def("smooth_shading", (bool (easy3d::TrianglesDrawable::*)() const) &easy3d::TrianglesDrawable::smooth_shading, "C++: easy3d::TrianglesDrawable::smooth_shading() const --> bool"); - cl.def("set_smooth_shading", (void (easy3d::TrianglesDrawable::*)(bool)) &easy3d::TrianglesDrawable::set_smooth_shading, "C++: easy3d::TrianglesDrawable::set_smooth_shading(bool) --> void", pybind11::arg("b")); - cl.def("opacity", (float (easy3d::TrianglesDrawable::*)() const) &easy3d::TrianglesDrawable::opacity, "Query the opacity of the drawable, in the range [0.0, 1.0].\n \n\n The opacity of the drawable.\n \n\n Opacity is effective only when transparency (e.g., DualDepthPeeling, AverageColorBlending) rendering is enabled.\n\nC++: easy3d::TrianglesDrawable::opacity() const --> float"); - cl.def("set_opacity", (void (easy3d::TrianglesDrawable::*)(float)) &easy3d::TrianglesDrawable::set_opacity, "Set the opacity of the drawable.\n \n\n The new opacity value, in the range [0.0, 1.0].\n \n\n Opacity is effective only when transparency (e.g., DualDepthPeeling, AverageColorBlending) rendering is enabled.\n\nC++: easy3d::TrianglesDrawable::set_opacity(float) --> void", pybind11::arg("opacity")); - cl.def("assign", (class easy3d::TrianglesDrawable & (easy3d::TrianglesDrawable::*)(const class easy3d::TrianglesDrawable &)) &easy3d::TrianglesDrawable::operator=, "C++: easy3d::TrianglesDrawable::operator=(const class easy3d::TrianglesDrawable &) --> class easy3d::TrianglesDrawable &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - -} diff --git a/python/bindings/unused/renderer/renderer.cpp b/python/bindings/unused/renderer/renderer.cpp deleted file mode 100644 index 1d40546a..00000000 --- a/python/bindings/unused/renderer/renderer.cpp +++ /dev/null @@ -1,136 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // __str__ -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - -#ifndef BINDER_PYBIND11_TYPE_CASTER - #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) - PYBIND11_MAKE_OPAQUE(std::shared_ptr) -#endif - -void bind_easy3d_renderer_renderer(pybind11::module_& m) -{ - { // easy3d::Renderer file:easy3d/renderer/renderer.h line:62 - pybind11::class_> cl(m, "Renderer", "A Renderer manages the drawables (and thus the rendering) of a model.\n \n\n Renderer also allow to create default drawables for most rendering purposes.\n \n\n\n \n Drawable, PointsDrawable, LinesDrawable, TrianglesDrawable\n\n The following code shows how to use renderer:\n \n\n\n\n\n \n\n\n\n "); - cl.def( pybind11::init( [](class easy3d::Model * a0){ return new easy3d::Renderer(a0); } ), "doc" , pybind11::arg("model")); - cl.def( pybind11::init(), pybind11::arg("model"), pybind11::arg("create_drawables") ); - - cl.def( pybind11::init( [](easy3d::Renderer const &o){ return new easy3d::Renderer(o); } ) ); - cl.def("model", (class easy3d::Model * (easy3d::Renderer::*)()) &easy3d::Renderer::model, "The model to which this renderer is attached.\n\nC++: easy3d::Renderer::model() --> class easy3d::Model *", pybind11::return_value_policy::automatic); - cl.def("is_visible", (bool (easy3d::Renderer::*)() const) &easy3d::Renderer::is_visible, "Returns whether the model is currently visible.\n\nC++: easy3d::Renderer::is_visible() const --> bool"); - cl.def("set_visible", (void (easy3d::Renderer::*)(bool)) &easy3d::Renderer::set_visible, "Shows/Hides the model.\n\nC++: easy3d::Renderer::set_visible(bool) --> void", pybind11::arg("b")); - cl.def("is_selected", (bool (easy3d::Renderer::*)() const) &easy3d::Renderer::is_selected, "Returns whether the model has been selected.\n\nC++: easy3d::Renderer::is_selected() const --> bool"); - cl.def("set_selected", (void (easy3d::Renderer::*)(bool)) &easy3d::Renderer::set_selected, "Select/Deselect the model. The state of all its drawables will change accordingly.\n\nC++: easy3d::Renderer::set_selected(bool) --> void", pybind11::arg("b")); - cl.def("update", (void (easy3d::Renderer::*)()) &easy3d::Renderer::update, "Invalidates the rendering buffers of the model and thus updates the rendering (delayed in rendering).\n \n\n This method triggers an update of the rendering buffers of all the drawables of the model to which\n this renderer is attached. The effect is equivalent to calling Drawable::update() functions for all\n the drawables of this model.\n todo: for better performance, it is wise to update only the affected drawables and buffers.\n \n\n Drawable::update()\n\nC++: easy3d::Renderer::update() --> void"); - cl.def("get_points_drawable", [](easy3d::Renderer const &o, const std::string & a0) -> easy3d::PointsDrawable * { return o.get_points_drawable(a0); }, "", pybind11::return_value_policy::automatic, pybind11::arg("name")); - cl.def("get_points_drawable", (class easy3d::PointsDrawable * (easy3d::Renderer::*)(const std::string &, bool) const) &easy3d::Renderer::get_points_drawable, "Get the points drawable with a given name.\n Return nullptr if the drawable does not exist.\n\nC++: easy3d::Renderer::get_points_drawable(const std::string &, bool) const --> class easy3d::PointsDrawable *", pybind11::return_value_policy::automatic, pybind11::arg("name"), pybind11::arg("warning_not_found")); - cl.def("get_lines_drawable", [](easy3d::Renderer const &o, const std::string & a0) -> easy3d::LinesDrawable * { return o.get_lines_drawable(a0); }, "", pybind11::return_value_policy::automatic, pybind11::arg("name")); - cl.def("get_lines_drawable", (class easy3d::LinesDrawable * (easy3d::Renderer::*)(const std::string &, bool) const) &easy3d::Renderer::get_lines_drawable, "Get the lines drawable with a given name.\n Return nullptr if the drawable does not exist.\n\nC++: easy3d::Renderer::get_lines_drawable(const std::string &, bool) const --> class easy3d::LinesDrawable *", pybind11::return_value_policy::automatic, pybind11::arg("name"), pybind11::arg("warning_not_found")); - cl.def("get_triangles_drawable", [](easy3d::Renderer const &o, const std::string & a0) -> easy3d::TrianglesDrawable * { return o.get_triangles_drawable(a0); }, "", pybind11::return_value_policy::automatic, pybind11::arg("name")); - cl.def("get_triangles_drawable", (class easy3d::TrianglesDrawable * (easy3d::Renderer::*)(const std::string &, bool) const) &easy3d::Renderer::get_triangles_drawable, "Get the triangles drawable with a given name.\n Return nullptr if the drawable does not exist.\n\nC++: easy3d::Renderer::get_triangles_drawable(const std::string &, bool) const --> class easy3d::TrianglesDrawable *", pybind11::return_value_policy::automatic, pybind11::arg("name"), pybind11::arg("warning_not_found")); - cl.def("add_points_drawable", (class easy3d::PointsDrawable * (easy3d::Renderer::*)(const std::string &)) &easy3d::Renderer::add_points_drawable, "Create a new points drawable and add it to this renderer.\n \n\n The name of the points drawable to be created.\n \n\n The created points drawable. If a points drawable with 'name' already exists, the creation will be\n ignored and the existing drawable is returned.\n\nC++: easy3d::Renderer::add_points_drawable(const std::string &) --> class easy3d::PointsDrawable *", pybind11::return_value_policy::automatic, pybind11::arg("name")); - cl.def("add_lines_drawable", (class easy3d::LinesDrawable * (easy3d::Renderer::*)(const std::string &)) &easy3d::Renderer::add_lines_drawable, "Create a new lines drawable and add it to this renderer.\n \n\n The name of the lines drawable to be created.\n \n\n The created lines drawable. If a lines drawable with 'name' already exists, the creation will be\n ignored and the existing drawable is returned.\n\nC++: easy3d::Renderer::add_lines_drawable(const std::string &) --> class easy3d::LinesDrawable *", pybind11::return_value_policy::automatic, pybind11::arg("name")); - cl.def("add_triangles_drawable", (class easy3d::TrianglesDrawable * (easy3d::Renderer::*)(const std::string &)) &easy3d::Renderer::add_triangles_drawable, "Create a new triangles drawable and add it to this renderer.\n \n\n The name of the triangles drawable to be created.\n \n\n The created triangles drawable. If a triangles drawable with 'name' already exists, the creation will\n be ignored and the existing drawable is returned.\n\nC++: easy3d::Renderer::add_triangles_drawable(const std::string &) --> class easy3d::TrianglesDrawable *", pybind11::return_value_policy::automatic, pybind11::arg("name")); - cl.def("points_drawables", (const class std::vector & (easy3d::Renderer::*)() const) &easy3d::Renderer::points_drawables, "All available points drawables managed by this renderer.\n\nC++: easy3d::Renderer::points_drawables() const --> const class std::vector &", pybind11::return_value_policy::automatic); - cl.def("lines_drawables", (const class std::vector & (easy3d::Renderer::*)() const) &easy3d::Renderer::lines_drawables, "All available lines drawables managed by this renderer.\n\nC++: easy3d::Renderer::lines_drawables() const --> const class std::vector &", pybind11::return_value_policy::automatic); - cl.def("triangles_drawables", (const class std::vector & (easy3d::Renderer::*)() const) &easy3d::Renderer::triangles_drawables, "All available triangles drawables managed by this renderer.\n\nC++: easy3d::Renderer::triangles_drawables() const --> const class std::vector &", pybind11::return_value_policy::automatic); - cl.def_static("create_default_drawables", (void (*)(class easy3d::Model *)) &easy3d::Renderer::create_default_drawables, "Create default drawables for rendering.\n \n\n This method creates defaults drawables for rendering a model. The supported default drawables are\n - PointCloud: \"vertices\".\n - SurfaceMesh: \"faces\", \"vertices\", \"edges\", \"borders\".\n - Graph: \"vertices\", \"edges\".\n These drawables are usually sufficient for basic rendering of the model. In case\n the default drawables don't meet the particular visualization purpose, you can\n override this function or set 'create_default_drawables' to false and create the\n drawables by calling Model::add_[type]_drawable().\n\nC++: easy3d::Renderer::create_default_drawables(class easy3d::Model *) --> void", pybind11::arg("model")); - cl.def_static("set_default_rendering_state", (void (*)(class easy3d::PointCloud *, class easy3d::PointsDrawable *)) &easy3d::Renderer::set_default_rendering_state, "Set the default rendering state of the \"vertices\" drawable of a point cloud.\n \n\n The default rendering state is determined by the availability of the vertex properties.\n The motivation is that the most appealing rendering is demonstrated by default. The following\n priority applies:\n 1. per-vertex color: in \"v:color\";\n 2. per-vertex texture coordinates: in \"v:texcoord\";\n 3. segmentation: in \"v:primitive_index\";\n 4. scalar field;\n 5. uniform color.\n\nC++: easy3d::Renderer::set_default_rendering_state(class easy3d::PointCloud *, class easy3d::PointsDrawable *) --> void", pybind11::arg("model"), pybind11::arg("drawable")); - cl.def_static("set_default_rendering_state", (void (*)(class easy3d::SurfaceMesh *, class easy3d::TrianglesDrawable *)) &easy3d::Renderer::set_default_rendering_state, "Set the default rendering state of the \"faces\" drawable of a surface mesh.\n \n\n The default rendering state is determined by the availability of the vertex/face properties.\n The motivation is that the most appealing rendering is demonstrated by default. The following\n priority applies:\n 1. per-face color: in \"f:color\";\n 2. per-vertex color: in \"v:color\";\n 3. per-halfedge texture coordinates: in \"h:texcoord\";\n 4. per-vertex texture coordinates: in \"v:texcoord\";\n 5. segmentation: in \"f:chart\";\n 6. scalar field on faces;\n 7. scalar field on vertices;\n 8. uniform color\n\nC++: easy3d::Renderer::set_default_rendering_state(class easy3d::SurfaceMesh *, class easy3d::TrianglesDrawable *) --> void", pybind11::arg("model"), pybind11::arg("drawable")); - cl.def_static("set_default_rendering_state", (void (*)(class easy3d::Graph *, class easy3d::PointsDrawable *)) &easy3d::Renderer::set_default_rendering_state, "Set the default rendering state of the \"vertices\" drawable of a graph.\n \n\n The default rendering state is determined by the availability of the vertex properties.\n The motivation is that the most appealing rendering is demonstrated by default. The following\n priority applies:\n 1. per-vertex color: in \"v:color\";\n 2. per-vertex texture coordinates: in \"v:texcoord\";\n 3. scalar field;\n 4. uniform color.\n\nC++: easy3d::Renderer::set_default_rendering_state(class easy3d::Graph *, class easy3d::PointsDrawable *) --> void", pybind11::arg("model"), pybind11::arg("drawable")); - cl.def("assign", (class easy3d::Renderer & (easy3d::Renderer::*)(const class easy3d::Renderer &)) &easy3d::Renderer::operator=, "C++: easy3d::Renderer::operator=(const class easy3d::Renderer &) --> class easy3d::Renderer &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - { // easy3d::ShaderProgram file:easy3d/renderer/shader_program.h line:77 - pybind11::class_> cl(m, "ShaderProgram", "OpenGL Shader Compilation\n\n \n\n To use the shader program class, you need to do the following:\n - Call load_shader_from_code(ShaderProgram::VERTEX, vert_file) to create vertex shader and\n load_shader_from_code(ShaderProgram::FRAGMENT, frag_file) to create fragment shader\n (you may also need to create other types of shaders depending on your needs).\n - Call set_attrib_name(ShaderProgram::POSITION, \"position\") for vertex attribute \"position\".\n You may also need to set other attributes like normal, color, etc. To know what vertex\n attributes need to be set, check your shader code or call print_active_attributes().\n - Call link_program() to link the program.\n\n For rendering\n - Call bind();\n - Call set_uniform() to set all the necessary uniforms. You may also need to call set_block(),\n set_block_uniform(), and/or set_block_uniform_array_element(). To know what uniforms need to\n be set, check your shader code or call print_active_uniforms(), print_active_uniform_blocks().\n - Call the drawable's draw() function\n - Call release();\n\n To retrieve the model view projection matrix, call camera's modelViewProjectionMatrix() "); - cl.def( pybind11::init( [](){ return new easy3d::ShaderProgram(); } ), "doc" ); - cl.def( pybind11::init(), pybind11::arg("name") ); - - - pybind11::enum_(cl, "AttribType", pybind11::arithmetic(), "") - .value("POSITION", easy3d::ShaderProgram::POSITION) - .value("COLOR", easy3d::ShaderProgram::COLOR) - .value("NORMAL", easy3d::ShaderProgram::NORMAL) - .value("TEXCOORD", easy3d::ShaderProgram::TEXCOORD) - .export_values(); - - - pybind11::enum_(cl, "ShaderType", pybind11::arithmetic(), "") - .value("VERTEX", easy3d::ShaderProgram::VERTEX) - .value("FRAGMENT", easy3d::ShaderProgram::FRAGMENT) - .value("GEOMETRY", easy3d::ShaderProgram::GEOMETRY) - .value("TESS_CONTROL", easy3d::ShaderProgram::TESS_CONTROL) - .value("TESS_EVALUATION", easy3d::ShaderProgram::TESS_EVALUATION) - .value("COMPUTE", easy3d::ShaderProgram::COMPUTE) - .value("NUM_SHADER_TYPES", easy3d::ShaderProgram::NUM_SHADER_TYPES) - .export_values(); - - cl.def_static("is_supported", (bool (*)()) &easy3d::ShaderProgram::is_supported, "C++: easy3d::ShaderProgram::is_supported() --> bool"); - cl.def("set_name", (void (easy3d::ShaderProgram::*)(const std::string &)) &easy3d::ShaderProgram::set_name, "C++: easy3d::ShaderProgram::set_name(const std::string &) --> void", pybind11::arg("name")); - cl.def("name", (const std::string & (easy3d::ShaderProgram::*)() const) &easy3d::ShaderProgram::name, "C++: easy3d::ShaderProgram::name() const --> const std::string &", pybind11::return_value_policy::automatic); - cl.def("set_verbose", (void (easy3d::ShaderProgram::*)(bool)) &easy3d::ShaderProgram::set_verbose, "Sets true to log any issues found.\n\nC++: easy3d::ShaderProgram::set_verbose(bool) --> void", pybind11::arg("v")); - cl.def("get_program", (unsigned int (easy3d::ShaderProgram::*)() const) &easy3d::ShaderProgram::get_program, "Returns the program index.\n\nC++: easy3d::ShaderProgram::get_program() const --> unsigned int"); - cl.def("clear", (void (easy3d::ShaderProgram::*)()) &easy3d::ShaderProgram::clear, "Removes (deletes) all shaders\n\nC++: easy3d::ShaderProgram::clear() --> void"); - cl.def("load_shader_from_file", [](easy3d::ShaderProgram &o, enum easy3d::ShaderProgram::ShaderType const & a0, const std::string & a1) -> bool { return o.load_shader_from_file(a0, a1); }, "", pybind11::arg("st"), pybind11::arg("file_name")); - cl.def("load_shader_from_file", (bool (easy3d::ShaderProgram::*)(enum easy3d::ShaderProgram::ShaderType, const std::string &, const std::string &)) &easy3d::ShaderProgram::load_shader_from_file, "Loads the text in the file to the source of the specified shader\n \n\n one of the enum values of ShaderType\n \n\n the full path of the file where the source is to be found\n \n\n the include identifier string (e.g., \"#include\")\n\nC++: easy3d::ShaderProgram::load_shader_from_file(enum easy3d::ShaderProgram::ShaderType, const std::string &, const std::string &) --> bool", pybind11::arg("st"), pybind11::arg("file_name"), pybind11::arg("inc_id")); - cl.def("load_shader_from_code", (bool (easy3d::ShaderProgram::*)(enum easy3d::ShaderProgram::ShaderType, const std::string &)) &easy3d::ShaderProgram::load_shader_from_code, "Loads the code to the source of the specified shader\n \n\n one of the enum values of ShaderType\n \n\n the string of the shader source code\n\nC++: easy3d::ShaderProgram::load_shader_from_code(enum easy3d::ShaderProgram::ShaderType, const std::string &) --> bool", pybind11::arg("st"), pybind11::arg("code")); - cl.def("set_attrib_name", (void (easy3d::ShaderProgram::*)(enum easy3d::ShaderProgram::AttribType, const std::string &) const) &easy3d::ShaderProgram::set_attrib_name, "Defines semantics for the input vertex attributes. This is required for other libraries to know how to\n send data to the shader.\n \n\n The semantic of the attribute\n \n\n The name of the vertex attribute\n \n\n To specify a location for an attribute you must do it prior to linking the program, or, if the\n program is already linked, to link it again afterwards (call method link_program)\n\nC++: easy3d::ShaderProgram::set_attrib_name(enum easy3d::ShaderProgram::AttribType, const std::string &) const --> void", pybind11::arg("at"), pybind11::arg("name")); - cl.def("set_attrib_names", (void (easy3d::ShaderProgram::*)(const class std::vector > &) const) &easy3d::ShaderProgram::set_attrib_names, "C++: easy3d::ShaderProgram::set_attrib_names(const class std::vector > &) const --> void", pybind11::arg("attributes")); - cl.def("link_program", (bool (easy3d::ShaderProgram::*)()) &easy3d::ShaderProgram::link_program, "Prepares program for usage. Links it and collects information about uniform variables and uniform blocks.\n\nC++: easy3d::ShaderProgram::link_program() --> bool"); - cl.def("set_program_output", (void (easy3d::ShaderProgram::*)(int, const std::string &) const) &easy3d::ShaderProgram::set_program_output, "Bind a user-defined varying out variable to a fragment shader color number\n Note: linking is required for this operation to take effect\n (call method prepare_program afterwards)\n \n\n The fragment color number\n \n\n The name of the fragment's shader variable\n\nC++: easy3d::ShaderProgram::set_program_output(int, const std::string &) const --> void", pybind11::arg("index"), pybind11::arg("name")); - cl.def("program_output", (int (easy3d::ShaderProgram::*)(const std::string &) const) &easy3d::ShaderProgram::program_output, "Returns the fragment shader color number bound to a user-defined varying out variable\n Note: linking is required for this operation to take effect\n (call method prepare_program afterwards)\n \n\n name of the fragment's shader variable\n \n\n the fragment color number\n\nC++: easy3d::ShaderProgram::program_output(const std::string &) const --> int", pybind11::arg("name")); - cl.def("bind", (void (easy3d::ShaderProgram::*)() const) &easy3d::ShaderProgram::bind, "Starts using the program.\n\nC++: easy3d::ShaderProgram::bind() const --> void"); - cl.def("set_uniform", (class easy3d::ShaderProgram * (easy3d::ShaderProgram::*)(const std::string &, const void *)) &easy3d::ShaderProgram::set_uniform, "C++: easy3d::ShaderProgram::set_uniform(const std::string &, const void *) --> class easy3d::ShaderProgram *", pybind11::return_value_policy::automatic, pybind11::arg("name"), pybind11::arg("value")); - cl.def("set_uniform", (class easy3d::ShaderProgram * (easy3d::ShaderProgram::*)(const std::string &, int)) &easy3d::ShaderProgram::set_uniform, "C++: easy3d::ShaderProgram::set_uniform(const std::string &, int) --> class easy3d::ShaderProgram *", pybind11::return_value_policy::automatic, pybind11::arg("name"), pybind11::arg("value")); - cl.def("set_uniform", (class easy3d::ShaderProgram * (easy3d::ShaderProgram::*)(const std::string &, unsigned int)) &easy3d::ShaderProgram::set_uniform, "C++: easy3d::ShaderProgram::set_uniform(const std::string &, unsigned int) --> class easy3d::ShaderProgram *", pybind11::return_value_policy::automatic, pybind11::arg("name"), pybind11::arg("value")); - cl.def("set_uniform", (class easy3d::ShaderProgram * (easy3d::ShaderProgram::*)(const std::string &, float)) &easy3d::ShaderProgram::set_uniform, "C++: easy3d::ShaderProgram::set_uniform(const std::string &, float) --> class easy3d::ShaderProgram *", pybind11::return_value_policy::automatic, pybind11::arg("name"), pybind11::arg("value")); - cl.def("set_block", (class easy3d::ShaderProgram * (easy3d::ShaderProgram::*)(const std::string &, const void *)) &easy3d::ShaderProgram::set_block, "Sets a uniform block as a whole\n\nC++: easy3d::ShaderProgram::set_block(const std::string &, const void *) --> class easy3d::ShaderProgram *", pybind11::return_value_policy::automatic, pybind11::arg("name"), pybind11::arg("value")); - cl.def("set_block_uniform", (class easy3d::ShaderProgram * (easy3d::ShaderProgram::*)(const std::string &, const std::string &, const void *)) &easy3d::ShaderProgram::set_block_uniform, "Sets a uniform inside a named block\n Warning: Be careful when using uniform blocks. Please refer to OpenGL Specification Version 4.5\n (Core Profile) - May 28, 2015 (https://www.opengl.org/registry/doc/glspec45.core.pdf#page=159)\n In \"Standard Uniform Block Layout\", it says \"If the member is a three-component vector with components\n consuming N basic machine units, the base alignment is 4N\" (see rule 3 of section 7.6.2.2 in page.159).\n That means the array stride (the bytes between array elements) is always rounded up to the size of a\n vec4 (i.e., 16-bytes).\n So we have to avoid using vec3/mat3 (use vec4/mat4/mat43 instead) in a uniform block. Otherwise,\n you have to manually pad your structures/arrays out.\n\nC++: easy3d::ShaderProgram::set_block_uniform(const std::string &, const std::string &, const void *) --> class easy3d::ShaderProgram *", pybind11::return_value_policy::automatic, pybind11::arg("blockName"), pybind11::arg("uniformName"), pybind11::arg("value")); - cl.def("set_block_uniform_array_element", (class easy3d::ShaderProgram * (easy3d::ShaderProgram::*)(const std::string &, const std::string &, int, const void *)) &easy3d::ShaderProgram::set_block_uniform_array_element, "Sets an element of an array of uniforms inside a block\n\nC++: easy3d::ShaderProgram::set_block_uniform_array_element(const std::string &, const std::string &, int, const void *) --> class easy3d::ShaderProgram *", pybind11::return_value_policy::automatic, pybind11::arg("blockName"), pybind11::arg("uniformName"), pybind11::arg("arrayIndex"), pybind11::arg("value")); - cl.def("bind_texture", [](easy3d::ShaderProgram &o, const std::string & a0, unsigned int const & a1, int const & a2) -> easy3d::ShaderProgram * { return o.bind_texture(a0, a1, a2); }, "", pybind11::return_value_policy::automatic, pybind11::arg("name"), pybind11::arg("tex_id"), pybind11::arg("unit")); - cl.def("bind_texture", (class easy3d::ShaderProgram * (easy3d::ShaderProgram::*)(const std::string &, unsigned int, int, unsigned int)) &easy3d::ShaderProgram::bind_texture, "C++: easy3d::ShaderProgram::bind_texture(const std::string &, unsigned int, int, unsigned int) --> class easy3d::ShaderProgram *", pybind11::return_value_policy::automatic, pybind11::arg("name"), pybind11::arg("tex_id"), pybind11::arg("unit"), pybind11::arg("tex_target")); - cl.def("release_texture", [](easy3d::ShaderProgram &o) -> easy3d::ShaderProgram * { return o.release_texture(); }, "", pybind11::return_value_policy::automatic); - cl.def("release_texture", (class easy3d::ShaderProgram * (easy3d::ShaderProgram::*)(unsigned int)) &easy3d::ShaderProgram::release_texture, "C++: easy3d::ShaderProgram::release_texture(unsigned int) --> class easy3d::ShaderProgram *", pybind11::return_value_policy::automatic, pybind11::arg("tex_target")); - cl.def("release", (void (easy3d::ShaderProgram::*)() const) &easy3d::ShaderProgram::release, "Ends using the program.\n\nC++: easy3d::ShaderProgram::release() const --> void"); - cl.def("get_attribute_location", (int (easy3d::ShaderProgram::*)(const std::string &) const) &easy3d::ShaderProgram::get_attribute_location, "C++: easy3d::ShaderProgram::get_attribute_location(const std::string &) const --> int", pybind11::arg("name")); - cl.def("is_uniform_used", (bool (easy3d::ShaderProgram::*)(const std::string &)) &easy3d::ShaderProgram::is_uniform_used, "C++: easy3d::ShaderProgram::is_uniform_used(const std::string &) --> bool", pybind11::arg("name")); - cl.def("is_attribute_used", (bool (easy3d::ShaderProgram::*)(const std::string &)) &easy3d::ShaderProgram::is_attribute_used, "C++: easy3d::ShaderProgram::is_attribute_used(const std::string &) --> bool", pybind11::arg("name")); - cl.def("is_program_valid", (bool (easy3d::ShaderProgram::*)() const) &easy3d::ShaderProgram::is_program_valid, "C++: easy3d::ShaderProgram::is_program_valid() const --> bool"); - cl.def("is_program_linked", (bool (easy3d::ShaderProgram::*)() const) &easy3d::ShaderProgram::is_program_linked, "Returns true if program linked, false otherwise.\n\nC++: easy3d::ShaderProgram::is_program_linked() const --> bool"); - cl.def("is_bound", (bool (easy3d::ShaderProgram::*)() const) &easy3d::ShaderProgram::is_bound, "Returns true if the program is being used (i.e., between bind() and release()).\n\nC++: easy3d::ShaderProgram::is_bound() const --> bool"); - cl.def("shader_info_log", (bool (easy3d::ShaderProgram::*)(std::string &, unsigned int) const) &easy3d::ShaderProgram::shader_info_log, "C++: easy3d::ShaderProgram::shader_info_log(std::string &, unsigned int) const --> bool", pybind11::arg("log"), pybind11::arg("shader")); - cl.def("program_info_log", (bool (easy3d::ShaderProgram::*)(std::string &) const) &easy3d::ShaderProgram::program_info_log, "C++: easy3d::ShaderProgram::program_info_log(std::string &) const --> bool", pybind11::arg("log")); - cl.def("print_active_attributes", (void (easy3d::ShaderProgram::*)()) &easy3d::ShaderProgram::print_active_attributes, "C++: easy3d::ShaderProgram::print_active_attributes() --> void"); - cl.def("print_active_uniforms", (void (easy3d::ShaderProgram::*)()) &easy3d::ShaderProgram::print_active_uniforms, "C++: easy3d::ShaderProgram::print_active_uniforms() --> void"); - cl.def("print_active_uniform_blocks", (void (easy3d::ShaderProgram::*)()) &easy3d::ShaderProgram::print_active_uniform_blocks, "C++: easy3d::ShaderProgram::print_active_uniform_blocks() --> void"); - cl.def("load_binary", (bool (easy3d::ShaderProgram::*)(const std::string &)) &easy3d::ShaderProgram::load_binary, "C++: easy3d::ShaderProgram::load_binary(const std::string &) --> bool", pybind11::arg("file_name")); - cl.def("save_binary", (bool (easy3d::ShaderProgram::*)(const std::string &)) &easy3d::ShaderProgram::save_binary, "C++: easy3d::ShaderProgram::save_binary(const std::string &) --> bool", pybind11::arg("file_name")); - cl.def_static("load_shader_source", [](const std::string & a0) -> std::string { return easy3d::ShaderProgram::load_shader_source(a0); }, "", pybind11::arg("file_name")); - cl.def_static("load_shader_source", (std::string (*)(const std::string &, const std::string &)) &easy3d::ShaderProgram::load_shader_source, "Auxiliary function that loads the shader source code from a file.\n \n\n the full path of the file where the source is to be found\n \n\n the include identifier string (e.g., \"#include\")\n\nC++: easy3d::ShaderProgram::load_shader_source(const std::string &, const std::string &) --> std::string", pybind11::arg("file_name"), pybind11::arg("inc_id")); - } -} diff --git a/python/bindings/unused/renderer/state.cpp b/python/bindings/unused/renderer/state.cpp deleted file mode 100644 index faf3e315..00000000 --- a/python/bindings/unused/renderer/state.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include -#include -#include -#include -#include // __str__ -#include -#include -#include - -#include -#include -#include -#include - - -#ifndef BINDER_PYBIND11_TYPE_CASTER - #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) - PYBIND11_MAKE_OPAQUE(std::shared_ptr) -#endif - -void bind_easy3d_renderer_state(pybind11::module_& m) -{ - { // easy3d::State file:easy3d/renderer/state.h line:45 - pybind11::class_> cl(m, "State", "Class representing the rendering state of a drawable\n\n \n\n "); - cl.def( pybind11::init( [](){ return new easy3d::State(); } ) ); - cl.def( pybind11::init( [](easy3d::State const &o){ return new easy3d::State(o); } ) ); - - pybind11::enum_(cl, "Method", pybind11::arithmetic(), "A complete description of a color scheme contains the coloring method, and (if not uniform color) the\n location and name of a property.\n Available coloring methods:\n - UNIFORM_COLOR: uniformly colored;\n - COLOR_PROPERTY: using a color property;\n - SCALAR_FIELD: using a scalar field;\n - TEXTURED: using texture(s).\n Possible properties for coloring a drawable:\n - color properties defined on vertices, faces, or edges. A color property is specified by its name,\n e.g., \"v:color\", \"f:color\", \"e:color\";\n - scalar fields defined on vertices, faces, or edges. A scalar field is specified by its name, e.g.,\n \"v:curvature\", \"v:height\", \"f:segment_id\";\n - texture coordinates defined on vertices or halfedges. A texture coordinates property is specified by its\n name, e.g., \"v:texcoord\", \"h:texcoord\".") - .value("UNIFORM_COLOR", easy3d::State::UNIFORM_COLOR) - .value("COLOR_PROPERTY", easy3d::State::COLOR_PROPERTY) - .value("SCALAR_FIELD", easy3d::State::SCALAR_FIELD) - .value("TEXTURED", easy3d::State::TEXTURED) - .export_values(); - - - pybind11::enum_(cl, "Location", pybind11::arithmetic(), "The location of a coloring property. It is denoted by the type of the geometric primitives on which the\n property is defined.") - .value("VERTEX", easy3d::State::VERTEX) - .value("FACE", easy3d::State::FACE) - .value("EDGE", easy3d::State::EDGE) - .value("HALFEDGE", easy3d::State::HALFEDGE) - .export_values(); - - cl.def("assign", (class easy3d::State & (easy3d::State::*)(const class easy3d::State &)) &easy3d::State::operator=, "assign to performs a deep copy of all member variables.\n\nC++: easy3d::State::operator=(const class easy3d::State &) --> class easy3d::State &", pybind11::return_value_policy::automatic, pybind11::arg("rhs")); - cl.def("is_visible", (bool (easy3d::State::*)() const) &easy3d::State::is_visible, "C++: easy3d::State::is_visible() const --> bool"); - cl.def("set_visible", (void (easy3d::State::*)(bool)) &easy3d::State::set_visible, "C++: easy3d::State::set_visible(bool) --> void", pybind11::arg("v")); - cl.def("is_selected", (bool (easy3d::State::*)() const) &easy3d::State::is_selected, "C++: easy3d::State::is_selected() const --> bool"); - cl.def("set_selected", (void (easy3d::State::*)(bool)) &easy3d::State::set_selected, "C++: easy3d::State::set_selected(bool) --> void", pybind11::arg("b")); - cl.def("set_uniform_coloring", (void (easy3d::State::*)(const class easy3d::Vec<4, float> &)) &easy3d::State::set_uniform_coloring, "Constructs a uniform coloring scheme.\n \n\n The color.\n\nC++: easy3d::State::set_uniform_coloring(const class easy3d::Vec<4, float> &) --> void", pybind11::arg("color")); - cl.def("set_property_coloring", [](easy3d::State &o, enum easy3d::State::Location const & a0) -> void { return o.set_property_coloring(a0); }, "", pybind11::arg("color_location")); - cl.def("set_property_coloring", (void (easy3d::State::*)(enum easy3d::State::Location, const std::string &)) &easy3d::State::set_property_coloring, "Constructs a scheme for rendering a drawable with per-element color.\n \n\n The location of the color property.\n \n\n The name of the color property.\n\nC++: easy3d::State::set_property_coloring(enum easy3d::State::Location, const std::string &) --> void", pybind11::arg("color_location"), pybind11::arg("color_name")); - cl.def("set_coloring", (void (easy3d::State::*)(enum easy3d::State::Method, enum easy3d::State::Location, const std::string &)) &easy3d::State::set_coloring, "Sets the coloring. A generic version of the set_[method]_coloring() method.\n \n\n The coloring method.\n \n\n The the location of the coloring property.\n \n\n The name of the coloring property.\n \n\n The texture for the coloring.\n\nC++: easy3d::State::set_coloring(enum easy3d::State::Method, enum easy3d::State::Location, const std::string &) --> void", pybind11::arg("method"), pybind11::arg("location"), pybind11::arg("name")); - cl.def("set_coloring_method", (void (easy3d::State::*)(enum easy3d::State::Method)) &easy3d::State::set_coloring_method, "Sets the coloring method.\n \n\n It has the same effect as if set_coloring() is called without changing the location (2nd argument)\n and name (3rd argument) of the coloring property. \n\n set_coloring()\n \n\n The coloring method.\n\nC++: easy3d::State::set_coloring_method(enum easy3d::State::Method) --> void", pybind11::arg("method")); - cl.def("coloring_method", (enum easy3d::State::Method (easy3d::State::*)() const) &easy3d::State::coloring_method, "Returns the coloring method being used for rendering. \n\nC++: easy3d::State::coloring_method() const --> enum easy3d::State::Method"); - cl.def("color", (const class easy3d::Vec<4, float> & (easy3d::State::*)() const) &easy3d::State::color, "The color, which is effective only when the coloring method was set to UNIFORM_COLOR.\n Call set_uniform_coloring() to change this color.\n\nC++: easy3d::State::color() const --> const class easy3d::Vec<4, float> &", pybind11::return_value_policy::automatic); - cl.def("set_color", (void (easy3d::State::*)(const class easy3d::Vec<4, float> &)) &easy3d::State::set_color, "C++: easy3d::State::set_color(const class easy3d::Vec<4, float> &) --> void", pybind11::arg("c")); - cl.def("property_location", (enum easy3d::State::Location (easy3d::State::*)() const) &easy3d::State::property_location, "The location of the color property. \n\nC++: easy3d::State::property_location() const --> enum easy3d::State::Location"); - cl.def("property_name", (const std::string & (easy3d::State::*)() const) &easy3d::State::property_name, "The name of the color attribute. \n\nC++: easy3d::State::property_name() const --> const std::string &", pybind11::return_value_policy::automatic); - cl.def("lighting", (bool (easy3d::State::*)() const) &easy3d::State::lighting, "returns whether lighting is enabled.\n\nC++: easy3d::State::lighting() const --> bool"); - cl.def("set_lighting", (void (easy3d::State::*)(bool)) &easy3d::State::set_lighting, "enables/disables lighting.\n\nC++: easy3d::State::set_lighting(bool) --> void", pybind11::arg("l")); - cl.def("lighting_two_sides", (bool (easy3d::State::*)() const) &easy3d::State::lighting_two_sides, "returns whether double-sided lighting is enabled.\n\nC++: easy3d::State::lighting_two_sides() const --> bool"); - cl.def("set_lighting_two_sides", (void (easy3d::State::*)(bool)) &easy3d::State::set_lighting_two_sides, "enables/disables double-sided lighting.\n\nC++: easy3d::State::set_lighting_two_sides(bool) --> void", pybind11::arg("b")); - cl.def("distinct_back_color", (bool (easy3d::State::*)() const) &easy3d::State::distinct_back_color, "returns whether a different color is used for rendering the backside of a drawable.\n \n\n effective only when two-sides lighting is enabled\n\nC++: easy3d::State::distinct_back_color() const --> bool"); - cl.def("set_distinct_back_color", (void (easy3d::State::*)(bool)) &easy3d::State::set_distinct_back_color, "enables/disables different backside color.\n \n\n effective only when two-sides lighting is enabled\n\nC++: easy3d::State::set_distinct_back_color(bool) --> void", pybind11::arg("b")); - cl.def("back_color", (const class easy3d::Vec<4, float> & (easy3d::State::*)() const) &easy3d::State::back_color, "returns the backside color.\n \n\n effective only when two-sides lighting and distinct back color are enabled.\n \n\n lighting_two_sides(), distinct_back_color()\n\nC++: easy3d::State::back_color() const --> const class easy3d::Vec<4, float> &", pybind11::return_value_policy::automatic); - cl.def("set_back_color", (void (easy3d::State::*)(const class easy3d::Vec<4, float> &)) &easy3d::State::set_back_color, "sets the backside color.\n \n\n effective only when two-sides lighting and distinct back color are enabled.\n \n\n set_lighting_two_sides(), set_distinct_back_color()\n\nC++: easy3d::State::set_back_color(const class easy3d::Vec<4, float> &) --> void", pybind11::arg("c")); - cl.def("texture_repeat", (float (easy3d::State::*)() const) &easy3d::State::texture_repeat, "How many times do you want to repeat the texture? \n\nC++: easy3d::State::texture_repeat() const --> float"); - cl.def("set_texture_repeat", (void (easy3d::State::*)(float)) &easy3d::State::set_texture_repeat, "C++: easy3d::State::set_texture_repeat(float) --> void", pybind11::arg("r")); - cl.def("texture_fractional_repeat", (float (easy3d::State::*)() const) &easy3d::State::texture_fractional_repeat, "Controls the texture repeat at a finer level: 100 fractional repeat == 1 repeat. \n\nC++: easy3d::State::texture_fractional_repeat() const --> float"); - cl.def("set_texture_fractional_repeat", (void (easy3d::State::*)(float)) &easy3d::State::set_texture_fractional_repeat, "C++: easy3d::State::set_texture_fractional_repeat(float) --> void", pybind11::arg("fr")); - cl.def("is_ssao_enabled", (bool (easy3d::State::*)() const) &easy3d::State::is_ssao_enabled, "C++: easy3d::State::is_ssao_enabled() const --> bool"); - cl.def("enable_ssao", (void (easy3d::State::*)(bool)) &easy3d::State::enable_ssao, "C++: easy3d::State::enable_ssao(bool) --> void", pybind11::arg("b")); - cl.def("set_ssao_texture", (void (easy3d::State::*)(unsigned int)) &easy3d::State::set_ssao_texture, "C++: easy3d::State::set_ssao_texture(unsigned int) --> void", pybind11::arg("tex")); - cl.def("clamp_range", (bool (easy3d::State::*)() const) &easy3d::State::clamp_range, "Clamp the value range of a scalar field. \n\nC++: easy3d::State::clamp_range() const --> bool"); - cl.def("set_clamp_range", (void (easy3d::State::*)(bool)) &easy3d::State::set_clamp_range, "C++: easy3d::State::set_clamp_range(bool) --> void", pybind11::arg("b")); - cl.def("clamp_lower", (float (easy3d::State::*)() const) &easy3d::State::clamp_lower, "Clamp the lower side of the value range of a scalar field. Value is in [0, 1] (i.e., 0% to 100%).\n\nC++: easy3d::State::clamp_lower() const --> float"); - cl.def("set_clamp_lower", (void (easy3d::State::*)(float)) &easy3d::State::set_clamp_lower, "C++: easy3d::State::set_clamp_lower(float) --> void", pybind11::arg("v")); - cl.def("clamp_upper", (float (easy3d::State::*)() const) &easy3d::State::clamp_upper, "Clamp the upper side of the value range of a scalar field. Value is in [0, 1] (i.e., 0% to 100%).\n\nC++: easy3d::State::clamp_upper() const --> float"); - cl.def("set_clamp_upper", (void (easy3d::State::*)(float)) &easy3d::State::set_clamp_upper, "C++: easy3d::State::set_clamp_upper(float) --> void", pybind11::arg("v")); - cl.def("material", (struct easy3d::State::Material & (easy3d::State::*)()) &easy3d::State::material, "C++: easy3d::State::material() --> struct easy3d::State::Material &", pybind11::return_value_policy::automatic); - cl.def("set_material", (void (easy3d::State::*)(const struct easy3d::State::Material &)) &easy3d::State::set_material, "C++: easy3d::State::set_material(const struct easy3d::State::Material &) --> void", pybind11::arg("m")); - cl.def("plane_clip_discard_primitive", (bool (easy3d::State::*)() const) &easy3d::State::plane_clip_discard_primitive, "Controls the behavior for vertex clipping.\n \n\n If plane_clip_discard_primitive() is (default value, standard plane clip), the clip\n distances will be linearly interpolated across the primitive (e.g., line, triangle) and the portion\n of the primitive with interpolated distances less than 0.0 will be clipped.\n If plane_clip_discard_primitive() is a primitive will be completely discarded if one of its\n vertices has a negative clip distance.\n\nC++: easy3d::State::plane_clip_discard_primitive() const --> bool"); - cl.def("set_plane_clip_discard_primitive", (void (easy3d::State::*)(bool)) &easy3d::State::set_plane_clip_discard_primitive, "C++: easy3d::State::set_plane_clip_discard_primitive(bool) --> void", pybind11::arg("b")); - cl.def("highlight", (bool (easy3d::State::*)() const) &easy3d::State::highlight, "Highlight a subset of primitives of this drawable. Primitives with indices within the range\n [highlight_id_low_, highlight_id_high_] will be highlighted.\n \n\n Specifies the min and max indices of the primitives to be highlighted. Providing [-1, -1] will\n un-highlight any previously highlighted primitives.\n \n\n For non-triangular surface meshes, all polygonal faces are internally triangulated to allow a\n unified rendering APIs. The range must be given on the triangulated faces! If you have face range,\n you should convert the face range to triangle range. For each face, its triangles are defined on\n SurfaceMesh::face_property >(\"f:triangle_range\").\n\nC++: easy3d::State::highlight() const --> bool"); - cl.def("set_highlight", (void (easy3d::State::*)(bool)) &easy3d::State::set_highlight, "C++: easy3d::State::set_highlight(bool) --> void", pybind11::arg("b")); - cl.def("set_highlight_range", (void (easy3d::State::*)(const struct std::pair &)) &easy3d::State::set_highlight_range, "C++: easy3d::State::set_highlight_range(const struct std::pair &) --> void", pybind11::arg("range")); - cl.def("highlight_range", (const struct std::pair & (easy3d::State::*)() const) &easy3d::State::highlight_range, "C++: easy3d::State::highlight_range() const --> const struct std::pair &", pybind11::return_value_policy::automatic); - - { // easy3d::State::Material file:easy3d/renderer/state.h line:79 - auto & enclosing_class = cl; - pybind11::class_> cl(enclosing_class, "Material", "Material definition."); - cl.def( pybind11::init( [](){ return new easy3d::State::Material(); } ) ); - cl.def( pybind11::init &, const class easy3d::Vec<4, float> &, float>(), pybind11::arg("ambi"), pybind11::arg("spec"), pybind11::arg("shin") ); - - cl.def_readwrite("ambient", &easy3d::State::Material::ambient); - cl.def_readwrite("specular", &easy3d::State::Material::specular); - cl.def_readwrite("shininess", &easy3d::State::Material::shininess); - cl.def("assign", (struct easy3d::State::Material & (easy3d::State::Material::*)(const struct easy3d::State::Material &)) &easy3d::State::Material::operator=, "C++: easy3d::State::Material::operator=(const struct easy3d::State::Material &) --> struct easy3d::State::Material &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - - } - -} diff --git a/python/examples/example_Offscreen.py b/python/examples/example_Offscreen.py deleted file mode 100644 index 040f04ae..00000000 --- a/python/examples/example_Offscreen.py +++ /dev/null @@ -1,24 +0,0 @@ -import sys -sys.path.append("../../cmake-build-release/lib/python") -import easy3d - - -# Initialize Easy3D -easy3d.initialize(True) # True to print detailed log - -file_name = easy3d.directory() + "/data/bunny.ply" -print("input file name: " + file_name) - -renderer = easy3d.OffScreen() -model = renderer.add_model(file_name) -renderer.render(file_name + ".png") - -camera = renderer.camera() -pos = camera.position() -pos = easy3d.Vec_3UL_float_t(pos.x + 0.1, pos.y + 0.2, pos.z + 0.2) -camera.setPosition(pos) -renderer.render(file_name + "2.png") -print("done") - -# ToDo: fix the crash due to reference valued in add_model() -# Solution: use std::shared_ptr in add_model() \ No newline at end of file diff --git a/python/examples/example_PointCloudNormalEstimtion.py b/python/examples/example_PointCloudNormalEstimtion.py deleted file mode 100644 index 5fbc9b9c..00000000 --- a/python/examples/example_PointCloudNormalEstimtion.py +++ /dev/null @@ -1,44 +0,0 @@ -import sys -sys.path.append("../../cmake-build-release/lib/python") - -import easy3d - - -# Initialize Easy3D -easy3d.initialize(True) # True to print detailed log - -file_name = easy3d.directory() + "/data/bunny.bin" -print("input file name: " + file_name) - -stopwatch = easy3d.StopWatch() -stopwatch.start() - -# Load the point cloud from a file -pc = easy3d.PointCloudIO.load(file_name) -if not pc: - raise ValueError("Failed to load the point cloud.") - -# Estimate normals for the point cloud -if not easy3d.PointCloudNormals.estimate(pc, 16, False): - raise ValueError("Normal estimation failed.") - -# Optional: Reorient normals if needed -if not easy3d.PointCloudNormals.reorient(pc, 16): - raise ValueError("Normal reorientation failed.") - -print("Done. Time: " + stopwatch.time_string()) - -# # Visualize the point cloud -# ToDo: python binding for the viewer is not ready -# The viewer crashes when closing it (due to the ownership of pc?) -# Solution: use std::shared_ptr in Viewer::add_model() -viewer = easy3d.Viewer("Easy3D Viewer") -viewer.set_usage("") -# print(pc.name()) -viewer.add_model(pc) -# viewer.add_model(file_name) -viewer.run() - -# Save the point cloud into a file -if not easy3d.PointCloudIO.save(file_name + "-result.ply", pc): - raise ValueError("Saving file failed.") \ No newline at end of file diff --git a/python/examples/example_viewer.py b/python/examples/example_viewer.py deleted file mode 100644 index f142ff8b..00000000 --- a/python/examples/example_viewer.py +++ /dev/null @@ -1,10 +0,0 @@ -import sys -sys.path.append("../../cmake-build-release/lib/python") - - -import easy3d - -easy3d.initialize() -viewer = easy3d.Viewer("Test") -viewer.add_model(easy3d.directory() + "/data/bunny.ply") -viewer.run() \ No newline at end of file diff --git a/python/examples/experiment.py b/python/examples/experiment.py deleted file mode 100644 index ef777303..00000000 --- a/python/examples/experiment.py +++ /dev/null @@ -1,10 +0,0 @@ -import sys -# sys.path.append("../../cmake-build-release/lib/python") -sys.path.append("/Users/lnan/Documents/Projects/PyEasy3D/cmake-build-release") - -import easy3d - -easy3d.initialize() -viewer = easy3d.Viewer("Test") -viewer.add_model(easy3d.directory() + "/data/bunny.ply") -viewer.run() \ No newline at end of file