VTK-m  2.2
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
vtkm::interop::anari::ANARIScene Struct Reference

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
 
ANARISceneoperator= (const ANARIScene &)=delete
 
ANARISceneoperator= (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...
 
ANARIMapperGetMapper (vtkm::IdComponent id)
 Get the associated mapper by index. More...
 
ANARIMapperGetMapper (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< SceneMapperMappers
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ANARIScene() [1/3]

vtkm::interop::anari::ANARIScene::ANARIScene ( anari_cpp::Device  device)

Constructor.

◆ ~ANARIScene()

vtkm::interop::anari::ANARIScene::~ANARIScene ( )

Destructor.

◆ ANARIScene() [2/3]

vtkm::interop::anari::ANARIScene::ANARIScene ( const ANARIScene )
delete

◆ ANARIScene() [3/3]

vtkm::interop::anari::ANARIScene::ANARIScene ( ANARIScene &&  )
delete

Member Function Documentation

◆ AddMapper()

template<typename ANARIMapperType >
ANARIMapperType & vtkm::interop::anari::ANARIScene::AddMapper ( const ANARIMapperType &  mapper,
bool  visible = true 
)
inline

Add a mapper to the scene.

Template Parameters
ANARIMapperTypeAny subclass of ANARIMapper.

NOTE: This will replace any mapper that has the same name.

◆ GetANARIWorld()

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.

◆ GetDevice()

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.

◆ GetMapper() [1/2]

ANARIMapper& vtkm::interop::anari::ANARIScene::GetMapper ( const char *  name)

Get the associated mapper by name.

◆ GetMapper() [2/2]

ANARIMapper& vtkm::interop::anari::ANARIScene::GetMapper ( vtkm::IdComponent  id)

Get the associated mapper by index.

◆ GetMapperIndexByName()

vtkm::IdComponent vtkm::interop::anari::ANARIScene::GetMapperIndexByName ( const char *  name)

Get the index to the mapper with the given name.

◆ GetMapperVisible()

bool vtkm::interop::anari::ANARIScene::GetMapperVisible ( vtkm::IdComponent  id) const

Get the associated mapper by name.

◆ GetNumberOfMappers()

vtkm::IdComponent vtkm::interop::anari::ANARIScene::GetNumberOfMappers ( ) const

Get number of mappers in this scene.

◆ HasMapperWithName()

bool vtkm::interop::anari::ANARIScene::HasMapperWithName ( const char *  name) const

Ask whether a mapper has the passed in name or not.

◆ operator=() [1/2]

ANARIScene& vtkm::interop::anari::ANARIScene::operator= ( ANARIScene &&  )
delete

◆ operator=() [2/2]

ANARIScene& vtkm::interop::anari::ANARIScene::operator= ( const ANARIScene )
delete

◆ RemoveAllMappers()

void vtkm::interop::anari::ANARIScene::RemoveAllMappers ( )

Clear out this scene of all mappers.

◆ RemoveMapper() [1/2]

void vtkm::interop::anari::ANARIScene::RemoveMapper ( const char *  name)

Remove mapper by name.

◆ RemoveMapper() [2/2]

void vtkm::interop::anari::ANARIScene::RemoveMapper ( vtkm::IdComponent  id)

Remove mapper by index.

◆ ReplaceMapper()

template<typename ANARIMapperType >
void vtkm::interop::anari::ANARIScene::ReplaceMapper ( const ANARIMapperType &  newMapper,
vtkm::IdComponent  id,
bool  visible 
)
inline

Add a mapper to the scene.

Template Parameters
ANARIMapperTypeAny 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.

◆ SetMapperVisible()

void vtkm::interop::anari::ANARIScene::SetMapperVisible ( vtkm::IdComponent  id,
bool  shown 
)

◆ UpdateWorld()

void vtkm::interop::anari::ANARIScene::UpdateWorld ( )
private

Member Data Documentation

◆ Device

anari_cpp::Device vtkm::interop::anari::ANARIScene::Device { nullptr }
private

◆ Mappers

std::vector<SceneMapper> vtkm::interop::anari::ANARIScene::Mappers
private

◆ World

anari_cpp::World vtkm::interop::anari::ANARIScene::World { nullptr }
private

The documentation for this struct was generated from the following file: