|
Photon Engine 2.0.0-beta
A physically based renderer.
|
#include <RawResourceCollection.h>
Public Member Functions | |
| std::shared_ptr< ISdlResource > | get (std::string_view resourceName) const override |
| Get a resource reference. | |
| bool | has (std::string_view resourceName) const override |
| Check the existence of a resource reference. | |
| void | add (std::shared_ptr< ISdlResource > resource, std::string_view resourceName) |
| Add a resource. | |
| std::shared_ptr< ISdlResource > | remove (std::string_view resourceName) |
| Remove a resource. | |
| std::string | rename (std::string_view resourceName, std::string_view newResourceName) |
Rename a resource. The new name must be unique within this collection. If newResourceName is not a unique name, a unique name is automatically determined (typically via makeResourceName()). | |
| std::string | makeResourceName (std::string_view intendedName) |
| Create a resource name that is unique within this collection. | |
| template<typename T > | |
| std::vector< std::shared_ptr< T > > | getAllOfType (std::vector< std::string > *out_resourceNames=nullptr) const |
Get all resources of type T. Different to its list<XXX>() variants, this method returns actual resources and allow modifications on them. The rest are similar to list<XXX>(). | |
| std::vector< std::shared_ptr< ISdlResource > > | getAll (std::vector< std::string > *out_resourceNames=nullptr) const |
Get a list of all resources in the scene. See getAllOfType() for details on the method. | |
| template<typename T > | |
| std::vector< const T * > | listAllOfType (std::vector< std::string > *out_resourceNames=nullptr) const |
Get a list of all resources of type T. Does not involve any change in ownership. Useful for operations that simply want to iterate over all resources of type T. | |
| std::vector< const ISdlResource * > | listAll (std::vector< std::string > *out_resourceNames=nullptr) const |
Get a list of all resources in the scene. See listAllOfType() for details on the method. | |
Public Member Functions inherited from ph::ISdlReferenceGroup | |
| PH_DEFINE_INLINE_RULE_OF_5_MEMBERS_NO_DTOR (ISdlReferenceGroup) | |
| virtual | ~ISdlReferenceGroup ()=default |
| template<typename T > | |
| std::shared_ptr< T > | getTyped (std::string_view resourceName) const |
Get a resource reference of type T with name resourceName. | |
| template<typename T > | |
| bool | hasTyped (std::string_view resourceName) const |
Check the existence of resource of type T. | |
| void ph::RawResourceCollection::add | ( | std::shared_ptr< ISdlResource > | resource, |
| std::string_view | resourceName ) |
Add a resource.
| resource | The resource to be added. |
| resourceName | The name given to the resource. |
| SdlLoadError | If input data is incomplete, e.g., being empty/null. |
|
inlineoverridevirtual |
Get a resource reference.
| resourceName | The name of the resource. |
nullptr if not found. Implements ph::ISdlReferenceGroup.
| std::vector< std::shared_ptr< ISdlResource > > ph::RawResourceCollection::getAll | ( | std::vector< std::string > * | out_resourceNames = nullptr | ) | const |
Get a list of all resources in the scene. See getAllOfType() for details on the method.
|
inline |
Get all resources of type T. Different to its list<XXX>() variants, this method returns actual resources and allow modifications on them. The rest are similar to list<XXX>().
| out_resourceNames | Storage for resource names (1-to-1 mapping to the returned resources). Left unspecified (nullptr) if resource names are not required. |
T.
|
inlineoverridevirtual |
Check the existence of a resource reference.
| resourceName | The name of the resource. |
Implements ph::ISdlReferenceGroup.
| std::vector< const ISdlResource * > ph::RawResourceCollection::listAll | ( | std::vector< std::string > * | out_resourceNames = nullptr | ) | const |
Get a list of all resources in the scene. See listAllOfType() for details on the method.
|
inline |
Get a list of all resources of type T. Does not involve any change in ownership. Useful for operations that simply want to iterate over all resources of type T.
| out_resourceNames | Storage for resource names (1-to-1 mapping to the returned resources). Left unspecified (nullptr) if resource names are not required. |
T. The pointers are const as the method act like a view to the contained resources. | std::string ph::RawResourceCollection::makeResourceName | ( | std::string_view | intendedName | ) |
Create a resource name that is unique within this collection.
| intendedName | If the name given is already unique, then it will be used; otherwise, the name will be changed such that the resulting name is unique. |
| std::shared_ptr< ISdlResource > ph::RawResourceCollection::remove | ( | std::string_view | resourceName | ) |
Remove a resource.
| resourceName | The name given to the resource. |
resourceName. | std::string ph::RawResourceCollection::rename | ( | std::string_view | resourceName, |
| std::string_view | newResourceName ) |
Rename a resource. The new name must be unique within this collection. If newResourceName is not a unique name, a unique name is automatically determined (typically via makeResourceName()).
| resourceName | Name of the resource to be renamed. |
| newResourceName | The intended new resource name. |
| SdlLoadError | If there is no resource named `resourceName`. |