From 1aaa93c9ded0301d4d5a79ce10eac06a6e6a37dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Mororo=20Costa?= <43460229+mororo250@users.noreply.github.com> Date: Tue, 30 Jun 2020 13:00:08 -0300 Subject: [PATCH 1/4] add sun positioning algorithm --- src/appleseed.python/CMakeLists.txt | 1 + src/appleseed.python/bindsunpositioner.cpp | 77 +++ src/appleseed.python/module.cpp | 2 + src/appleseed/CMakeLists.txt | 2 + .../utility/solarpositionalgorithm.cpp | 440 ++++++++++++++++++ .../renderer/utility/solarpositionalgorithm.h | 111 +++++ 6 files changed, 633 insertions(+) create mode 100644 src/appleseed.python/bindsunpositioner.cpp create mode 100644 src/appleseed/renderer/utility/solarpositionalgorithm.cpp create mode 100644 src/appleseed/renderer/utility/solarpositionalgorithm.h diff --git a/src/appleseed.python/CMakeLists.txt b/src/appleseed.python/CMakeLists.txt index 4ca2da6910..480c2f030a 100644 --- a/src/appleseed.python/CMakeLists.txt +++ b/src/appleseed.python/CMakeLists.txt @@ -106,6 +106,7 @@ set (sources bindshadercompiler.cpp bindshadergroup.cpp bindshaderquery.cpp + bindsunpositioner.cpp bindsurfaceshader.cpp bindtexture.cpp bindtilecallback.cpp diff --git a/src/appleseed.python/bindsunpositioner.cpp b/src/appleseed.python/bindsunpositioner.cpp new file mode 100644 index 0000000000..59518a02df --- /dev/null +++ b/src/appleseed.python/bindsunpositioner.cpp @@ -0,0 +1,77 @@ + +// +// This source file is part of appleseed. +// Visit https://appleseedhq.net/ for additional information and resources. +// +// This software is released under the MIT license. +// +// Copyright (c) 2020 Joao Marcos Costa, The appleseedhq Organization +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#pragma once + +// appleseed.python headers. +#include "bindentitycontainers.h" +#include "dict2dict.h" +#include "metadata.h" + +// appleseed.renderer header. +#include "renderer/utility/solarpositionalgorithm.h" + +// appleseed.foundation headers. +#include "foundation/platform/python.h" + +namespace bpy = boost::python; +using namespace foundation; +using namespace renderer; + +namespace +{ + auto_release_ptr create_sun_positioner(const bpy::dict& params) + { + return SunPositionerFactory::create("Sun Positioner", bpy_dict_to_param_array(params)); + } + + void compute_sun_position(SunPositioner* sun_position) + { + sun_position->fetch_data(); + sun_position->compute_sun_position(); + } + + bpy::list get_input_metadata() + { + return dictionary_array_to_bpy_list(SunPositionerFactory::get_input_metadata()); + } +} + +void bind_sun_positioner() +{ + bpy::class_, bpy::bases, boost::noncopyable>("SunPositioner", bpy::no_init) + .def("get_input_metadata", get_input_metadata).staticmethod("get_input_metadata") + .def("__init__", bpy::make_constructor(create_sun_positioner)) + .def("compute_sun_position", compute_sun_position) + + .def("get_zenith", &SunPositioner::get_zenith) + .def("get_azimuth", &SunPositioner::get_azimuth) + .def("get_solar_noon", &SunPositioner::get_solar_noon) + .def("get_sunrise", &SunPositioner::get_sunrise) + .def("get_sunset", &SunPositioner::get_sunset); +} diff --git a/src/appleseed.python/module.cpp b/src/appleseed.python/module.cpp index f77001a6cf..5f82a5465b 100644 --- a/src/appleseed.python/module.cpp +++ b/src/appleseed.python/module.cpp @@ -66,6 +66,7 @@ void bind_scene(); void bind_shader_compiler(); void bind_shader_group(); void bind_shader_query(); +void bind_sun_positioner(); void bind_surface_shader(); void bind_texture(); void bind_tile_callback(); @@ -132,6 +133,7 @@ extern "C" void bind_appleseed_python_classes() bind_fresnel(); bind_display(); bind_project(); + bind_sun_positioner(); bind_renderer_controller(); bind_tile_callback(); diff --git a/src/appleseed/CMakeLists.txt b/src/appleseed/CMakeLists.txt index 68b428c1e4..2c5c06e83d 100644 --- a/src/appleseed/CMakeLists.txt +++ b/src/appleseed/CMakeLists.txt @@ -2187,6 +2187,8 @@ set (renderer_utility_sources renderer/utility/settingsparsing.cpp renderer/utility/settingsparsing.h renderer/utility/shadowterminator.h + renderer/utility/solarpositionalgorithm.cpp + renderer/utility/solarpositionalgorithm.h renderer/utility/spectrumclamp.h renderer/utility/stochasticcast.h renderer/utility/testutils.cpp diff --git a/src/appleseed/renderer/utility/solarpositionalgorithm.cpp b/src/appleseed/renderer/utility/solarpositionalgorithm.cpp new file mode 100644 index 0000000000..3dbe843d76 --- /dev/null +++ b/src/appleseed/renderer/utility/solarpositionalgorithm.cpp @@ -0,0 +1,440 @@ + +// +// This source file is part of appleseed. +// Visit https://appleseedhq.net/ for additional information and resources. +// +// This software is released under the MIT license. +// +// Copyright (c) 2020 Joao Marcos Costa, The appleseedhq Organization +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +// Interface header. +#include "solarpositionalgorithm.h" + +// appleseed.foundation headers. +#include "foundation/math/scalar.h" +#include "foundation/utility/job/abortswitch.h" +#include "foundation/utility/uid.h" + +// appleseed.renderer headers. +#include "renderer/modeling/project/project.h" +#include "renderer/modeling/scene/basegroup.h" +#include "renderer/modeling/entity/onframebeginrecorder.h" +#include "renderer/utility/paramarray.h" + +// Standard headers. +#include + +using namespace foundation; + +namespace renderer +{ + + namespace + { + const UniqueID g_class_uid = new_guid(); + } + + double get_julian_century(double jd) + { + return (jd - 2451545.0) / 36525.0; + } + + double get_julian_day(int year, int month, int day, double decimal_day) + { + decimal_day += day; + + if (month < 3) + { + month += 12; + year--; + } + + double julian_day = std::floor(365.25 * (year + 4716.0)) + + std::floor(30.6001 * (month + 1)) + decimal_day - 1524.5; + + // Test whether to change to gregorian caledar calculation. + if (julian_day > 2299160.0) { + double A = std::floor(year / 100); + julian_day += (2 - A + std::floor(A / 4)); + } + + return julian_day; + } + + struct SunPositioner::Impl + { + // Input time. + int year; + int month; + int day; + int hour; + int minute; + int second; + int timezone; + + // Input location. + double longitude; // Observer longitude (negative west of Greenwich) + double latitude; // Observer latitude (negative south of equator) + double elevation; // Observer elevation [meters] + double azm_rotation; // Surface azimuth rotation. + + double zenith; // Topocentric zenith angle [degrees] + double azimuth; // Topocentric azimuth angle (eastward from north) [for navigators and solar radiation] + + double solar_noon; + double sunrise; // Local sunrise time (+/- 30 seconds). + double sunset; // Local sunset time (+/- 30 seconds). + }; + + // Constructor + SunPositioner::SunPositioner(const char* name, const ParamArray& params) + : Entity(g_class_uid, params), + impl(new Impl()) + { + } + + inline double SunPositioner::mean_obliquity_ecliptic(const double jc) const + { + return 23.0 + (26.0 + (21.448 - jc * (46.815 + jc * (0.00059 - jc * 0.001813))) / 60.0) / 60.0; + } + + inline double SunPositioner::obliquity_correction(const double jc) const + { + return mean_obliquity_ecliptic(jc) + 0.00256 * std::cos(deg_to_rad(125.04 - 1934.136 * jc)); + } + + inline double SunPositioner::mean_sun_anomaly(const double jc) const + { + return 357.52911 + jc * (35999.05029 - 0.0001537 * jc); + } + + inline double SunPositioner::sun_eqc_of_center(const double jc, const double msa) const + { + return std::sin(deg_to_rad(msa))* (1.914602 - jc * (0.004817 + 0.000014 * jc)) + + std::sin(deg_to_rad(2 * msa)) * (0.019993 - 0.000101 * jc) + + std::sin(deg_to_rad(3 * msa)) * 0.000289; + } + + inline double SunPositioner::mean_longitude_sun(const double jc) const + { + return std::fmod(280.46646 + jc * (36000.76983 + jc * 0.0003032), 360); + } + + inline double SunPositioner::sun_true_longitude(const double jc, const double mean_long_sun, const double mean_sun_ano) const + { + return mean_long_sun + sun_eqc_of_center(jc, mean_sun_ano); + } + + inline double SunPositioner::apparent_longitude_of_sun(const double jc, const double mean_long_sun, const double mean_sun_ano) const + { + return sun_true_longitude(jc, mean_long_sun, mean_sun_ano) - 0.00569 - 0.00478 * std::sin(deg_to_rad(125.04 - 1934.136 * jc)); + } + + inline double SunPositioner::sun_declination(const double obl_cor, const double app_lon_sun) const + { + return std::asin(std::sin(deg_to_rad(obl_cor)) * std::sin(deg_to_rad(app_lon_sun))); + } + + inline double SunPositioner::equation_of_time(const double jc, const double obl_cor, const double mean_long_sun, const double mean_sun_ano) const + { + const double eccent_earth_orbit = 0.016708634 - jc * (0.000042037 + 0.0000001267 * jc); + const double y = std::tan(deg_to_rad(obl_cor / 2.0)) * + std::tan(deg_to_rad(obl_cor / 2.0)); + + double eq_of_time = y * std::sin(2 * deg_to_rad(mean_long_sun)); + eq_of_time -= 2 * eccent_earth_orbit * std::sin(deg_to_rad(mean_sun_ano)); + eq_of_time += 4 * eccent_earth_orbit * y * std::sin(deg_to_rad(mean_sun_ano)) * std::cos(2 * deg_to_rad(mean_long_sun)); + eq_of_time -= 0.5 * y * y * std::sin(4 * deg_to_rad(mean_long_sun)); + eq_of_time -= 1.25 * eccent_earth_orbit * eccent_earth_orbit * std::sin(2 * deg_to_rad(mean_sun_ano)); + + return 4 * rad_to_deg(eq_of_time); + } + + void SunPositioner::compute_sun_position() + { + const double decimal_day = (impl->hour - impl->timezone + (impl->minute + (impl->second) / 60.0) / 60.0) / 24.0; + const double jc = get_julian_century(get_julian_day(impl->year, impl->month, impl->day, decimal_day)); + const double obl_cor = obliquity_correction(jc); + const double mean_long_sun = mean_longitude_sun(jc); + const double mean_sun_ano = mean_sun_anomaly(jc); + const double app_lon_sun = apparent_longitude_of_sun(jc, mean_long_sun, mean_sun_ano); + const double sun_dcli = sun_declination(obl_cor, app_lon_sun); + const double solar_time = + std::fmod((decimal_day * 1440 + equation_of_time(jc, obl_cor, mean_long_sun, mean_sun_ano) + 4 * impl->longitude), 1440); + double hour_angle = solar_time / 4; + hour_angle += (hour_angle < 0) ? 180 : -180; + + // Compute zenith and azimuth. + const double sin_lat = std::sin(deg_to_rad(impl->latitude)); + const double cos_lat = std::cos(deg_to_rad(impl->latitude)); + const double sin_sun_dcli = std::sin(sun_dcli); + const double cos_sun_dcli = std::cos(sun_dcli); + + impl->zenith = std::acos(sin_lat * sin_sun_dcli + cos_lat * cos_sun_dcli * std::cos(deg_to_rad(hour_angle))); + + const double sin_zenith = std::sin(impl->zenith); + const double cos_zenith = std::cos(impl->zenith); + + impl->azimuth = rad_to_deg(std::acos(((sin_lat * cos_zenith) - sin_sun_dcli) / (cos_lat * sin_zenith))); + + if (hour_angle > 0) + impl->azimuth += 180; + else + impl->azimuth = 540 - impl->azimuth; + + impl->zenith = rad_to_deg(impl->zenith); + impl->azimuth = std::fmod(impl->azimuth, 360); + } + + void SunPositioner::fetch_data() + { + impl->year = m_params.get_optional("year", 2020); + impl->month = m_params.get_optional("month", 1); + impl->day = m_params.get_optional("day", 1); + impl->hour = m_params.get_optional("hour", 12); + impl->minute = m_params.get_optional("minute", 0); + impl->second = m_params.get_optional("second", 0); + impl->timezone = m_params.get_optional("timezone", 0); + + impl->azm_rotation = m_params.get_optional("north", 0); + impl->longitude = m_params.get_optional("longitude", 0); + impl->latitude = m_params.get_optional("latitude", 0); + } + + float SunPositioner::get_zenith() const + { + return static_cast(impl->zenith); + } + + float SunPositioner::get_azimuth() const + { + return static_cast(impl->azimuth); + } + + float SunPositioner::get_solar_noon() const + { + return static_cast(impl->solar_noon); + } + + float SunPositioner::get_sunrise() const + { + return static_cast(impl->sunrise); + } + + float SunPositioner::get_sunset() const + { + return static_cast(impl->sunset); + } + + void SunPositioner::release() + { + delete this; + } + + const char* SunPositionerFactory::get_model() + { + return nullptr; + } + + DictionaryArray SunPositionerFactory::get_input_metadata() + { + DictionaryArray metadata; + + metadata.push_back( + Dictionary() + .insert("name", "hour") + .insert("label", "hour") + .insert("type", "integer") + .insert("min", + Dictionary() + .insert("value", "0") + .insert("type", "hard")) + .insert("max", + Dictionary() + .insert("value", "24") + .insert("type", "hard")) + .insert("use", "optional") + .insert("default", "12") + .insert("help", "...")); + + metadata.push_back( + Dictionary() + .insert("name", "minute") + .insert("label", "minute") + .insert("type", "integer") + .insert("min", + Dictionary() + .insert("value", "0") + .insert("type", "hard")) + .insert("max", + Dictionary() + .insert("value", "59") + .insert("type", "hard")) + .insert("use", "optional") + .insert("default", "0") + .insert("help", "...")); + + metadata.push_back( + Dictionary() + .insert("name", "second") + .insert("label", "second") + .insert("type", "integer") + .insert("min", + Dictionary() + .insert("value", "0") + .insert("type", "hard")) + .insert("max", + Dictionary() + .insert("value", "59") + .insert("type", "hard")) + .insert("use", "optional") + .insert("default", "0") + .insert("help", "...")); + + metadata.push_back( + Dictionary() + .insert("name", "year") + .insert("label", "year") + .insert("type", "integer") + .insert("min", + Dictionary() + .insert("value", "-2000") + .insert("type", "soft")) + .insert("max", + Dictionary() + .insert("value", "3000") + .insert("type", "hard")) + .insert("use", "optional") + .insert("default", "2020") + .insert("help", "...")); + + metadata.push_back( + Dictionary() + .insert("name", "month") + .insert("label", "month ") + .insert("type", "integer") + .insert("min", + Dictionary() + .insert("value", "1") + .insert("type", "hard")) + .insert("max", + Dictionary() + .insert("value", "12") + .insert("type", "hard")) + .insert("use", "optional") + .insert("default", "1") + .insert("help", "...")); + + metadata.push_back( + Dictionary() + .insert("name", "day") + .insert("label", "day") + .insert("type", "integer") + .insert("min", + Dictionary() + .insert("value", "1") + .insert("type", "hard")) + .insert("max", + Dictionary() + .insert("value", "31") + .insert("type", "hard")) + .insert("use", "optional") + .insert("default", "1") + .insert("help", "...")); + + metadata.push_back( + Dictionary() + .insert("name", "timezone") + .insert("label", "timezone") + .insert("type", "integer") + .insert("min", + Dictionary() + .insert("value", "-14") + .insert("type", "hard")) + .insert("max", + Dictionary() + .insert("value", "13") + .insert("type", "hard")) + .insert("use", "optional") + .insert("default", "0") + .insert("help", "UTC time zone")); + + metadata.push_back( + Dictionary() + .insert("name", "north") + .insert("label", "north") + .insert("type", "numeric") + .insert("min", + Dictionary() + .insert("value", "-180") + .insert("type", "hard")) + .insert("max", + Dictionary() + .insert("value", "180") + .insert("type", "hard")) + .insert("use", "optional") + .insert("default", "0") + .insert("help", "...")); + + metadata.push_back( + Dictionary() + .insert("name", "longitude") + .insert("label", "longitude") + .insert("type", "numeric") + .insert("min", + Dictionary() + .insert("value", "-180.0") + .insert("type", "hard")) + .insert("max", + Dictionary() + .insert("value", "180.0") + .insert("type", "hard")) + .insert("use", "optional") + .insert("default", "0.0") + .insert("help", "...")); + + metadata.push_back( + Dictionary() + .insert("name", "latitude") + .insert("label", "latitude") + .insert("type", "numeric") + .insert("min", + Dictionary() + .insert("value", "-90.0") + .insert("type", "hard")) + .insert("max", + Dictionary() + .insert("value", "90.0") + .insert("type", "hard")) + .insert("use", "optional") + .insert("default", "0") + .insert("help", "...")); + + return metadata; + } + + auto_release_ptr SunPositionerFactory::create(const char* name, const ParamArray& param) + { + return foundation::auto_release_ptr(new SunPositioner(name, param)); + } + +} // namespace renderer diff --git a/src/appleseed/renderer/utility/solarpositionalgorithm.h b/src/appleseed/renderer/utility/solarpositionalgorithm.h new file mode 100644 index 0000000000..7988a2283e --- /dev/null +++ b/src/appleseed/renderer/utility/solarpositionalgorithm.h @@ -0,0 +1,111 @@ + +// +// This source file is part of appleseed. +// Visit https://appleseedhq.net/ for additional information and resources. +// +// This software is released under the MIT license. +// +// Copyright(c) 2020 Joao Marcos Costa, The appleseedhq Organization +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +// This sun positioning algorithm is based on the National Oceanic and Atmospheric +// Administration's (NOAA) Solar Position Calculator which uses the calculations +// presented by Jean Meeus in his book Astronomical Algorithms. + +// The Use of NOAA data and products are in the public domain and may be used +// freely by the public as specify in www.nws.noaa.gov/disclaimer.php + +#pragma once + +// appleseed.renderer headers. +#include "renderer/modeling/entity/entity.h" + +// appleseed.foundation headers. +#include "foundation/memory/autoreleaseptr.h" +#include "foundation/utility/api/specializedapiarrays.h" + +// Forward declarations. +namespace foundation { class IAbortSwitch; } +namespace renderer { class BaseGroup; } +namespace renderer { class OnFrameBeginRecorder; } +namespace renderer { class ParamArray; } +namespace renderer { class Project; } +namespace renderer { class ShadingContext; } + +namespace renderer +{ + +class APPLESEED_DLLSYMBOL SunPositioner + :public Entity +{ + public: + + // Constructor + SunPositioner( + const char* name, + const ParamArray& params); + + void compute_sun_position(); + void fetch_data(); + + float get_zenith() const; + float get_azimuth() const; + float get_solar_noon() const; + float get_sunrise() const; + float get_sunset() const; + + void SunPositioner::release(); + + private: + struct Impl; + Impl* impl; + + double mean_obliquity_ecliptic(const double jc) const; + double obliquity_correction(const double jc) const; + + double mean_sun_anomaly(const double jc) const; + double mean_longitude_sun(const double jc) const; + double sun_eqc_of_center(const double jc, const double msa) const; + double sun_true_longitude(const double jc, const double mean_long_sun, const double mean_sun_ano) const; + double apparent_longitude_of_sun(const double jc, const double mean_long_sun, const double mean_sun_ano) const; + + double sun_declination(const double obj_cor, const double app_lon_sun) const; + + double equation_of_time(const double jc, const double obl_cor, const double mean_long_sun, const double mean_sun_ano) const; + +}; + +class APPLESEED_DLLSYMBOL SunPositionerFactory +{ + public: + // Return string identifying the sun positioner. + static const char* get_model(); + + // Return a set of input metadata the sun positioner. + static foundation::DictionaryArray get_input_metadata(); + + // Create new SunPositioner. + static foundation::auto_release_ptr create( + const char* name, + const ParamArray& param); +}; + +} // namespace renderer From b203c666028f9bef6639a96c370f6117dfca874a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Mororo=20Costa?= <43460229+mororo250@users.noreply.github.com> Date: Wed, 1 Jul 2020 19:15:18 -0300 Subject: [PATCH 2/4] small fix. --- src/appleseed/renderer/utility/solarpositionalgorithm.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/appleseed/renderer/utility/solarpositionalgorithm.h b/src/appleseed/renderer/utility/solarpositionalgorithm.h index 7988a2283e..ac413589cf 100644 --- a/src/appleseed/renderer/utility/solarpositionalgorithm.h +++ b/src/appleseed/renderer/utility/solarpositionalgorithm.h @@ -54,10 +54,9 @@ namespace renderer { class APPLESEED_DLLSYMBOL SunPositioner - :public Entity + :public Entity { public: - // Constructor SunPositioner( const char* name, @@ -72,7 +71,7 @@ class APPLESEED_DLLSYMBOL SunPositioner float get_sunrise() const; float get_sunset() const; - void SunPositioner::release(); + void SunPositioner::release() override; private: struct Impl; @@ -88,9 +87,7 @@ class APPLESEED_DLLSYMBOL SunPositioner double apparent_longitude_of_sun(const double jc, const double mean_long_sun, const double mean_sun_ano) const; double sun_declination(const double obj_cor, const double app_lon_sun) const; - double equation_of_time(const double jc, const double obl_cor, const double mean_long_sun, const double mean_sun_ano) const; - }; class APPLESEED_DLLSYMBOL SunPositionerFactory From 519e8759e1f34fb85d048bafc578147474befef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Mororo=20Costa?= <43460229+mororo250@users.noreply.github.com> Date: Wed, 1 Jul 2020 21:27:54 -0300 Subject: [PATCH 3/4] Fix travis build --- src/appleseed/renderer/utility/solarpositionalgorithm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appleseed/renderer/utility/solarpositionalgorithm.h b/src/appleseed/renderer/utility/solarpositionalgorithm.h index ac413589cf..cb1ecf31df 100644 --- a/src/appleseed/renderer/utility/solarpositionalgorithm.h +++ b/src/appleseed/renderer/utility/solarpositionalgorithm.h @@ -71,7 +71,7 @@ class APPLESEED_DLLSYMBOL SunPositioner float get_sunrise() const; float get_sunset() const; - void SunPositioner::release() override; + void release() override; private: struct Impl; From b22ee1a5116c6d9e3801b21a503fbf6ebe8600f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Mororo=20Costa?= <43460229+mororo250@users.noreply.github.com> Date: Wed, 1 Jul 2020 22:19:18 -0300 Subject: [PATCH 4/4] Fix travis build 2 --- src/appleseed.python/bindsunpositioner.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/appleseed.python/bindsunpositioner.cpp b/src/appleseed.python/bindsunpositioner.cpp index 59518a02df..2179a9b10b 100644 --- a/src/appleseed.python/bindsunpositioner.cpp +++ b/src/appleseed.python/bindsunpositioner.cpp @@ -26,8 +26,6 @@ // THE SOFTWARE. // -#pragma once - // appleseed.python headers. #include "bindentitycontainers.h" #include "dict2dict.h"