MCPcopy Create free account
hub / github.com/RenderKit/embree / SceneLoadingTutorialApplication

Method SceneLoadingTutorialApplication

tutorials/common/tutorial/tutorial.cpp:293–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291 }
292
293 SceneLoadingTutorialApplication::SceneLoadingTutorialApplication (const std::string& tutorialName, int features)
294
295 : TutorialApplication(tutorialName, features),
296 scene(new SceneGraph::GroupNode),
297 convert_tris_to_quads_prop(inf),
298 grid_resX(2),
299 grid_resY(2),
300 remove_mblur(false),
301 remove_non_mblur(false),
302 sceneFilename(),
303 instancing_mode(SceneGraph::INSTANCING_NONE),
304 print_scene_cameras(false)
305 {
306 registerOption("i", [this] (Ref<ParseStream> cin, const FileName& path) {
307 sceneFilename.push_back(path + cin->getFileName());
308 }, "-i <filename>: parses scene from <filename>");
309
310 registerOption("animlist", [this] (Ref<ParseStream> cin, const FileName& path) {
311 FileName listFilename = path + cin->getFileName();
312
313 std::ifstream listFile;
314 listFile.open(listFilename.c_str());
315 if (!listFile.is_open()) {
316 THROW_RUNTIME_ERROR("cannot open " + listFilename.str());
317 }
318 else
319 {
320 while (!listFile.eof())
321 {
322 std::string line;
323 listFile >> line;
324 if (line != "")
325 keyFramesFilenames.push_back(listFilename.path() + line);
326 }
327 }
328 }, "-animlist <filename>: parses a sequence of .obj/.xml files listed in <filename> and adds them to the scene");
329
330 registerOption("convert-triangles-to-quads", [this] (Ref<ParseStream> cin, const FileName& path) {
331 sgop.push_back(CONVERT_TRIANGLES_TO_QUADS);
332 convert_tris_to_quads_prop = inf;
333 }, "--convert-triangles-to-quads: converts all triangles to quads when loading");
334
335 registerOption("convert-triangles-to-triangles-and-quads", [this] (Ref<ParseStream> cin, const FileName& path) {
336 sgop.push_back(CONVERT_TRIANGLES_TO_QUADS);
337 convert_tris_to_quads_prop = 0.5f;
338 }, "--convert-triangles-to-triangles-and-quads: converts to mixed triangle/quad scene");
339
340 registerOption("convert-bezier-to-lines", [this] (Ref<ParseStream> cin, const FileName& path) {
341 sgop.push_back(CONVERT_BEZIER_TO_LINES);
342 }, "--convert-bezier-to-lines: converts all bezier curves to line segments when loading");
343
344 registerOption("convert-flat-to-round-curves", [this] (Ref<ParseStream> cin, const FileName& path) {
345 sgop.push_back(CONVERT_FLAT_TO_ROUND_CURVES);
346 }, "--convert-flat-to-round-curves: converts all flat curves to round curves");
347 registerOptionAlias("convert-flat-to-round-curves","convert-hair-to-curves"); // for compatibility reasons
348
349 registerOption("convert-round-to-flat-curves", [this] (Ref<ParseStream> cin, const FileName& path) {
350 sgop.push_back(CONVERT_ROUND_TO_FLAT_CURVES);

Callers

nothing calls this directly

Calls 15

DistantLightClass · 0.85
getFileNameMethod · 0.80
pathMethod · 0.80
minFunction · 0.50
maxFunction · 0.50
AmbientLightClass · 0.50
PointLightClass · 0.50
DirectionalLightClass · 0.50
createSphereFunction · 0.50
push_backMethod · 0.45
openMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected