00001 /* 00002 toxic - A Global Illumination Renderer 00003 Copyright (C) 2003-2004 Francois Beaune 00004 Contact: http://toxicengine.sourceforge.net/ 00005 00006 This file is part of toxic. 00007 00008 toxic is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 toxic is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with toxic; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 */ 00022 00023 #include "settings.h" // include first 00024 00025 using namespace sheep; 00026 using namespace toxic; 00027 00028 bool Settings::SamplingSettings::RandomSampling::IsConsistent() const { 00029 return m_samples > 0; 00030 } 00031 00032 bool Settings::SamplingSettings::RegularSampling::IsConsistent() const { 00033 return m_width > 0 && m_height > 0; 00034 } 00035 00036 bool Settings::SamplingSettings::StratifiedSampling::IsConsistent() const { 00037 return m_width > 0 && m_height > 0; 00038 } 00039 00040 bool Settings::SamplingSettings::IsConsistent() const { 00041 switch(m_algorithm) { 00042 case RANDOM_SAMPLING: 00043 return m_random_sampling.IsConsistent(); 00044 case REGULAR_SAMPLING: 00045 return m_regular_sampling.IsConsistent(); 00046 case STRATIFIED_SAMPLING: 00047 return m_stratified_sampling.IsConsistent(); 00048 default: 00049 return false; // keep the compiler happy 00050 } 00051 } 00052 00053 bool Settings::RadianceEstimateSettings::IsConsistent() const { 00054 return m_max_photons > 0 && m_max_distance > 0.0; 00055 } 00056 00057 bool Settings::Rendering::PixelSampling::WhittedAdaptiveSampling::IsConsistent() const { 00058 return m_contrast_threshold > 0.0 && m_max_depth >= 0; 00059 } 00060 00061 bool Settings::Rendering::PixelSampling::IsConsistent() const { 00062 switch(m_algorithm) { 00063 case SUPERSAMPLING: 00064 return m_supersampling.IsConsistent(); 00065 case WHITTED_ADAPTIVE_SAMPLING: 00066 return m_whitted_adaptive_sampling.IsConsistent(); 00067 default: 00068 return false; // keep the compiler happy 00069 } 00070 } 00071 00072 bool Settings::Rendering::Components::DirectLighting::IsConsistent() const { 00073 if(m_enabled) 00074 return m_arealight_sampling.IsConsistent(); 00075 else return true; 00076 } 00077 00078 bool Settings::Rendering::Components::IndirectLighting::PhotonTracing::IsConsistent() const { 00079 return m_photons > 0; 00080 } 00081 00082 bool Settings::Rendering::Components::IndirectLighting::RadiancePrecomp::IsConsistent() const { 00083 if(m_enabled) 00084 return m_spacing > 0 && m_max_search_dist > 0.0; 00085 else return true; 00086 } 00087 00088 bool Settings::Rendering::Components::IndirectLighting::PrimaryFinalGathering::IsConsistent() const { 00089 if(m_enabled) 00090 return SamplingSettings::IsConsistent(); 00091 else return true; 00092 } 00093 00094 bool Settings::Rendering::Components::IndirectLighting::SecondaryFinalGathering::IsConsistent() const { 00095 if(m_enabled) { 00096 return 00097 SamplingSettings::IsConsistent() && 00098 m_distance_threshold > 0.0; 00099 } else return true; 00100 } 00101 00102 bool Settings::Rendering::Components::IndirectLighting::IsConsistent() const { 00103 if(m_enabled) { 00104 return 00105 m_photon_tracing.IsConsistent() && 00106 m_radiance_precomp.IsConsistent() && 00107 m_radiance_est.IsConsistent() && 00108 m_primary_fg.IsConsistent() && 00109 m_secondary_fg.IsConsistent(); 00110 } else return true; 00111 } 00112 00113 bool Settings::Rendering::Components::SpecularReflections::IsConsistent() const { 00114 if(m_enabled) 00115 return m_max_depth >= 0; 00116 else return true; 00117 } 00118 00119 bool Settings::Rendering::Components::Caustics::PhotonTracing::IsConsistent() const { 00120 return m_photons > 0; 00121 } 00122 00123 bool Settings::Rendering::Components::Caustics::IsConsistent() const { 00124 if(m_enabled) { 00125 return 00126 m_photon_tracing.IsConsistent() && 00127 m_radiance_est.IsConsistent(); 00128 } else return true; 00129 } 00130 00131 bool Settings::Rendering::Components::IsConsistent() const { 00132 return 00133 m_direct_lighting.IsConsistent() && 00134 m_indirect_lighting.IsConsistent() && 00135 m_specular_reflections.IsConsistent() && 00136 m_caustics.IsConsistent(); 00137 } 00138 00139 bool Settings::Rendering::IsConsistent() const { 00140 return 00141 m_pixel_sampling.IsConsistent() && 00142 m_components.IsConsistent(); 00143 } 00144 00145 bool Settings::Output::RenderArea::IsConsistent() const { 00146 if(m_enabled) { 00147 return 00148 m_x0 >= 0 && m_y0 >= 0 && 00149 m_x1 >= 0 && m_y1 >= 0 && 00150 m_x1 >= m_x0 && m_y1 >= m_y0; 00151 } else return true; 00152 } 00153 00154 bool Settings::Output::GammaCorrection::IsConsistent() const { 00155 if(m_enabled) 00156 return m_target_gamma > 0.0; 00157 else return true; 00158 } 00159 00160 bool Settings::Output::IsConsistent() const { 00161 return 00162 m_render_area.IsConsistent() && 00163 m_gamma_correction.IsConsistent(); 00164 } 00165 00166 bool Settings::IsConsistent() const { 00167 return 00168 m_rendering.IsConsistent() && 00169 m_output.IsConsistent(); 00170 }
1.3.6