VTK-m
2.2
|
Object which manages a collection of mappers representing a single scene. More...
#include <ANARIScene.h>
Classes | |
struct | SceneMapper |
Public Member Functions | |
ANARIScene (anari_cpp::Device device) | |
Constructor. More... | |
~ANARIScene () | |
Destructor. More... | |
ANARIScene (const ANARIScene &)=delete | |
ANARIScene (ANARIScene &&)=delete | |
ANARIScene & | operator= (const ANARIScene &)=delete |
ANARIScene & | operator= (ANARIScene &&)=delete |
template<typename ANARIMapperType > | |
ANARIMapperType & | AddMapper (const ANARIMapperType &mapper, bool visible=true) |
Add a mapper to the scene. More... | |
template<typename ANARIMapperType > | |
void | ReplaceMapper (const ANARIMapperType &newMapper, vtkm::IdComponent id, bool visible) |
Add a mapper to the scene. More... | |
vtkm::IdComponent | GetNumberOfMappers () const |
Get number of mappers in this scene. More... | |
bool | HasMapperWithName (const char *name) const |
Ask whether a mapper has the passed in name or not. More... | |
vtkm::IdComponent | GetMapperIndexByName (const char *name) |
Get the index to the mapper with the given name. More... | |
ANARIMapper & | GetMapper (vtkm::IdComponent id) |
Get the associated mapper by index. More... | |
ANARIMapper & | GetMapper (const char *name) |
Get the associated mapper by name. More... | |
bool | GetMapperVisible (vtkm::IdComponent id) const |
Get the associated mapper by name. More... | |
void | SetMapperVisible (vtkm::IdComponent id, bool shown) |
void | RemoveMapper (vtkm::IdComponent id) |
Remove mapper by index. More... | |
void | RemoveMapper (const char *name) |
Remove mapper by name. More... | |
void | RemoveAllMappers () |
Clear out this scene of all mappers. More... | |
anari_cpp::Device | GetDevice () const |
Get the ANARIDevice handle this scene is talking to. More... | |
anari_cpp::World | GetANARIWorld () |
Get the ANARIWorld handle this scene is working on. More... | |
Private Member Functions | |
void | UpdateWorld () |
Private Attributes | |
anari_cpp::Device | Device { nullptr } |
anari_cpp::World | World { nullptr } |
std::vector< SceneMapper > | Mappers |
Object which manages a collection of mappers representing a single scene.
This object is a container of named mappers which will automatically keep an ANARIWorld
up to date which contains any ANARISurface
or ANARIVolume
objects coming from the contained mappers. While applications are free to do this work themselves, it is very convenient and useful to let ANARIScene
do the work of keeping an ANARIWorld
up to date for you.
Mappers in ANARIScene
can also be selectively hidden for quick scene updates. A hidden mapper's geometry/volume are just skipped when updating the list of object handles in the world.
NOTE: This object will not create any lights in the scene, so the ANARIWorld
used by the application is expected to have application-managed ANARILight
objects added to it when desired.
NOTE: Unlike ANARIMapper
and ANARIActor
, ANARIScene
is not C++ copyable or movable.
vtkm::interop::anari::ANARIScene::ANARIScene | ( | anari_cpp::Device | device | ) |
Constructor.
vtkm::interop::anari::ANARIScene::~ANARIScene | ( | ) |
Destructor.
|
delete |
|
delete |
|
inline |
Add a mapper to the scene.
ANARIMapperType | Any subclass of ANARIMapper . |
NOTE: This will replace any mapper that has the same name.
anari_cpp::World vtkm::interop::anari::ANARIScene::GetANARIWorld | ( | ) |
Get the ANARIWorld
handle this scene is working on.
NOTE: This handle is not retained, so applications should not release it.
anari_cpp::Device vtkm::interop::anari::ANARIScene::GetDevice | ( | ) | const |
Get the ANARIDevice
handle this scene is talking to.
NOTE: This handle is not retained, so applications should not release it.
ANARIMapper& vtkm::interop::anari::ANARIScene::GetMapper | ( | const char * | name | ) |
Get the associated mapper by name.
ANARIMapper& vtkm::interop::anari::ANARIScene::GetMapper | ( | vtkm::IdComponent | id | ) |
Get the associated mapper by index.
vtkm::IdComponent vtkm::interop::anari::ANARIScene::GetMapperIndexByName | ( | const char * | name | ) |
Get the index to the mapper with the given name.
bool vtkm::interop::anari::ANARIScene::GetMapperVisible | ( | vtkm::IdComponent | id | ) | const |
Get the associated mapper by name.
vtkm::IdComponent vtkm::interop::anari::ANARIScene::GetNumberOfMappers | ( | ) | const |
Get number of mappers in this scene.
bool vtkm::interop::anari::ANARIScene::HasMapperWithName | ( | const char * | name | ) | const |
Ask whether a mapper has the passed in name or not.
|
delete |
|
delete |
void vtkm::interop::anari::ANARIScene::RemoveAllMappers | ( | ) |
Clear out this scene of all mappers.
void vtkm::interop::anari::ANARIScene::RemoveMapper | ( | const char * | name | ) |
Remove mapper by name.
void vtkm::interop::anari::ANARIScene::RemoveMapper | ( | vtkm::IdComponent | id | ) |
Remove mapper by index.
|
inline |
Add a mapper to the scene.
ANARIMapperType | Any subclass of ANARIMapper . |
NOTE: Replace the i'th mapper with a new instance. NOTE: It is undefined behavior to use this to put 2 or more mappers in the scene with the same name.
void vtkm::interop::anari::ANARIScene::SetMapperVisible | ( | vtkm::IdComponent | id, |
bool | shown | ||
) |
|
private |
|
private |
|
private |
|
private |