SpiecsEngine
 
Loading...
Searching...
No Matches

◆ operator<<() [2/6]

YAML::Emitter & Spices::operator<< ( YAML::Emitter & out,
const ConstantParam & p )

Definition at line 209 of file YamlUtils.h.

210 {
211 out << YAML::Flow;
212 out << YAML::BeginSeq << p.paramType;
213
214 if(p.paramType == "float4")
215 {
216 out << std::any_cast<glm::vec4>(p.paramValue);
217 }
218 else if(p.paramType == "float3")
219 {
220 out << std::any_cast<glm::vec3>(p.paramValue);
221 }
222 else if(p.paramType == "float2")
223 {
224 out << std::any_cast<glm::vec2>(p.paramValue);
225 }
226 else if(p.paramType == "float")
227 {
228 out << std::any_cast<float>(p.paramValue);
229 }
230 else if(p.paramType == "int")
231 {
232 out << std::any_cast<int>(p.paramValue);
233 }
234 else if (p.paramType == "bool")
235 {
236 out << std::any_cast<bool>(p.paramValue);
237 }
238 else
239 {
240 std::stringstream ss;
241 ss << "YAML::operator<<: not supported paramType: " << p.paramType;
242
243 SPICES_CORE_WARN(ss.str())
244
245 out << YAML::EndSeq;
246 }
247
248 out << YAML::EndSeq;
249 return out;
250 }
std::string paramType
Definition Material.h:38

References Spices::ConstantParam::paramType.