Scene loaded from a pbrt-v4 file or string, owning all its memory (move only, freed in the destructor).
More...
#include <tinypbrt/detail/cpp/scene.hpp>
Scene loaded from a pbrt-v4 file or string, owning all its memory (move only, freed in the destructor).
All accessors from tpbrt::scene_view return views into the scene memory: they stay valid while the scene lives, also after the scene object is moved (the C scene lives on the heap and does not move).
- Examples
- examples/cpp/quickstart/main.cpp.
◆ scene() [1/2]
| tpbrt::scene::scene |
( |
scene && |
other | ) |
|
|
defaultnoexcept |
Moves scene (views created from other stay valid, they point to the same heap memory).
◆ scene() [2/2]
| tpbrt::scene::scene |
( |
const scene & |
| ) |
|
|
delete |
Scene owns C memory, so it cannot be copied.
◆ ~scene()
◆ operator=() [1/2]
Moves scene (the scene held before is freed).
◆ operator=() [2/2]
Scene owns C memory, so it cannot be copied.
◆ load_from_file()
| static result< scene > tpbrt::scene::load_from_file |
( |
const std::string & |
filepath | ) |
|
|
inlinestatic |
Loads scene from given file.
- Parameters
-
| filepath | Path to scene file. |
- Returns
- Result with error code or with scene.
◆ load_from_memory() [1/2]
| static result< scene > tpbrt::scene::load_from_memory |
( |
const std::string & |
data, |
|
|
const std::string & |
working_directory = "." |
|
) |
| |
|
inlinestatic |
Loads scene from memory (provided string).
- Parameters
-
| data | Scene text (std::string is always null-terminated, so it is passed without a copy). |
| working_directory | Directory used to resolve Include / Import and other relative paths. |
- Returns
- Result with error code or with scene.
◆ load_from_memory() [2/2]
| static result< scene > tpbrt::scene::load_from_memory |
( |
const char_t *const |
data, |
|
|
const std::string & |
working_directory = "." |
|
) |
| |
|
inlinestatic |
Loads scene from memory (provided null-terminated string).
- Parameters
-
| data | Scene text (must end with '\0'). |
| working_directory | Directory used to resolve Include / Import and other relative paths. |
- Returns
- Result with error code or with scene.
The documentation for this class was generated from the following file: