Go to the documentation of this file.
19 #ifndef viskores_interop_anari_ANARIScene_h
20 #define viskores_interop_anari_ANARIScene_h
25 #include <type_traits>
71 template <
typename ANARIMapperType>
72 ANARIMapperType& AddMapper(
const ANARIMapperType& mapper,
bool visible =
true);
80 template <
typename ANARIMapperType>
89 bool HasMapperWithName(
const char* name)
const;
114 void RemoveMapper(
const char* name);
117 void RemoveAllMappers();
122 anari_cpp::Device GetDevice()
const;
127 anari_cpp::World GetANARIWorld();
132 anari_cpp::Device Device{
nullptr };
133 anari_cpp::World World{
nullptr };
146 template <
typename ANARIMapperType>
149 static_assert(std::is_base_of<ANARIMapper, ANARIMapperType>::value,
150 "Only ANARIMapper types can be added to ANARIScene");
152 auto* name = mapper.GetName();
161 this->
Mappers.push_back({ std::make_unique<ANARIMapperType>(mapper), visible });
167 template <
typename ANARIMapperType>
172 static_assert(std::is_base_of<ANARIMapper, ANARIMapperType>::value,
173 "Only ANARIMapper types can be added to ANARIScene");
175 Mappers[id] = { std::make_unique<ANARIMapperType>(newMapper), visible };
176 if (wasVisible || visible)
Definition: ViskoresANARITypes.h:38
Definition: ANARIScene.h:135
Object which manages a collection of mappers representing a single scene.
Definition: ANARIScene.h:52
ANARIMapperType & AddMapper(const ANARIMapperType &mapper, bool visible=true)
Add a mapper to the scene.
Definition: ANARIScene.h:147
std::unique_ptr< ANARIMapper > Mapper
Definition: ANARIScene.h:137
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
bool HasMapperWithName(const char *name) const
Ask whether a mapper has the passed in name or not.
viskores::IdComponent GetNumberOfMappers() const
Get number of mappers in this scene.
bool GetMapperVisible(viskores::IdComponent id) const
Get the associated mapper by name.
void ReplaceMapper(const ANARIMapperType &newMapper, viskores::IdComponent id, bool visible)
Add a mapper to the scene.
Definition: ANARIScene.h:168
Groups connected points that have the same field value.
Definition: Atomic.h:27
std::vector< SceneMapper > Mappers
Definition: ANARIScene.h:141
ANARIMapper & GetMapper(viskores::IdComponent id)
Get the associated mapper by index.
This is the base class used for all ANARI mappers.
Definition: ANARIMapper.h:45
viskores::IdComponent GetMapperIndexByName(const char *name)
Get the index to the mapper with the given name.