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

This is the base class used for all ANARI mappers. More...

#include <ANARIMapper.h>

Inheritance diagram for vtkm::interop::anari::ANARIMapper:
vtkm::interop::anari::ANARIMapperGlyphs vtkm::interop::anari::ANARIMapperPoints vtkm::interop::anari::ANARIMapperTriangles vtkm::interop::anari::ANARIMapperVolume

Classes

struct  ANARIHandles
 

Public Member Functions

 ANARIMapper (anari_cpp::Device device, const ANARIActor &actor={}, const std::string &name="<noname>", const vtkm::cont::ColorTable &colorTable=vtkm::cont::ColorTable::Preset::Default)
 
virtual ~ANARIMapper ()=default
 
anari_cpp::Device GetDevice () const
 
const ANARIActorGetActor () const
 
const char * GetName () const
 
const vtkm::cont::ColorTableGetColorTable () const
 
void SetName (const char *name)
 
void SetColorTable (const vtkm::cont::ColorTable &colorTable)
 
virtual void SetActor (const ANARIActor &actor)
 Set the current actor on this mapper. More...
 
virtual void SetMapFieldAsAttribute (bool enabled)
 Set whether fields from ANARIActor should end up as geometry attributes. More...
 
bool GetMapFieldAsAttribute () const
 
virtual void SetANARIColorMap (anari_cpp::Array1D color, anari_cpp::Array1D opacity, bool releaseArrays=true)
 Set color map arrays using raw ANARI array handles. More...
 
virtual void SetANARIColorMapValueRange (const vtkm::Vec2f_32 &valueRange)
 Set the value range (domain) for the color map. More...
 
virtual void SetANARIColorMapOpacityScale (vtkm::Float32 opacityScale)
 Set a scale factor for opacity (typically used for volumes). More...
 
virtual anari_cpp::Geometry GetANARIGeometry ()
 Get the corresponding ANARIGeometry handle from this mapper. More...
 
virtual anari_cpp::SpatialField GetANARISpatialField ()
 Get the corresponding ANARISpatialField handle from this mapper. More...
 
virtual anari_cpp::Surface GetANARISurface ()
 Get the corresponding ANARISurface handle from this mapper. More...
 
virtual anari_cpp::Volume GetANARIVolume ()
 Get the corresponding ANARIVolume handle from this mapper. More...
 
anari_cpp::Group GetANARIGroup ()
 
anari_cpp::Instance GetANARIInstance ()
 
bool GroupIsEmpty () const
 

Protected Member Functions

std::string MakeObjectName (const char *suffix) const
 
void RefreshGroup ()
 
vtkm::cont::ColorTableGetColorTable ()
 

Protected Attributes

bool Valid { false }
 
bool Current { false }
 

Private Attributes

std::shared_ptr< ANARIHandlesHandles
 
ANARIActor Actor
 
vtkm::cont::ColorTable ColorTable
 
std::string Name
 
bool MapFieldAsAttribute { true }
 

Detailed Description

This is the base class used for all ANARI mappers.

This class implements shared functionality of all ANARI mappers. All ANARI object handle lifetimes are tied to the lifetime of the mapper, including the device. Applications are not intended to ever release handles received from the mapper, unless they manually retain the handle. Additionally, ANARIMappers will update surface or volume objects if changes occur, such as changes to the color map or ANARIActor.

Constructor & Destructor Documentation

◆ ANARIMapper()

vtkm::interop::anari::ANARIMapper::ANARIMapper ( anari_cpp::Device  device,
const ANARIActor actor = {},
const std::string &  name = "<noname>",
const vtkm::cont::ColorTable colorTable = vtkm::cont::ColorTable::Preset::Default 
)

◆ ~ANARIMapper()

virtual vtkm::interop::anari::ANARIMapper::~ANARIMapper ( )
virtualdefault

Member Function Documentation

◆ GetActor()

const ANARIActor& vtkm::interop::anari::ANARIMapper::GetActor ( ) const

◆ GetANARIGeometry()

virtual anari_cpp::Geometry vtkm::interop::anari::ANARIMapper::GetANARIGeometry ( )
virtual

Get the corresponding ANARIGeometry handle from this mapper.

NOTE: This handle is not retained, so applications should not release it.

Reimplemented in vtkm::interop::anari::ANARIMapperTriangles, vtkm::interop::anari::ANARIMapperPoints, and vtkm::interop::anari::ANARIMapperGlyphs.

◆ GetANARIGroup()

anari_cpp::Group vtkm::interop::anari::ANARIMapper::GetANARIGroup ( )

◆ GetANARIInstance()

anari_cpp::Instance vtkm::interop::anari::ANARIMapper::GetANARIInstance ( )

◆ GetANARISpatialField()

virtual anari_cpp::SpatialField vtkm::interop::anari::ANARIMapper::GetANARISpatialField ( )
virtual

Get the corresponding ANARISpatialField handle from this mapper.

NOTE: This handle is not retained, so applications should not release it.

Reimplemented in vtkm::interop::anari::ANARIMapperVolume.

◆ GetANARISurface()

virtual anari_cpp::Surface vtkm::interop::anari::ANARIMapper::GetANARISurface ( )
virtual

Get the corresponding ANARISurface handle from this mapper.

NOTE: This handle is not retained, so applications should not release it.

Reimplemented in vtkm::interop::anari::ANARIMapperTriangles, vtkm::interop::anari::ANARIMapperPoints, and vtkm::interop::anari::ANARIMapperGlyphs.

◆ GetANARIVolume()

virtual anari_cpp::Volume vtkm::interop::anari::ANARIMapper::GetANARIVolume ( )
virtual

Get the corresponding ANARIVolume handle from this mapper.

NOTE: This handle is not retained, so applications should not release it.

Reimplemented in vtkm::interop::anari::ANARIMapperVolume.

◆ GetColorTable() [1/2]

vtkm::cont::ColorTable& vtkm::interop::anari::ANARIMapper::GetColorTable ( )
protected

◆ GetColorTable() [2/2]

const vtkm::cont::ColorTable& vtkm::interop::anari::ANARIMapper::GetColorTable ( ) const

◆ GetDevice()

anari_cpp::Device vtkm::interop::anari::ANARIMapper::GetDevice ( ) const

◆ GetMapFieldAsAttribute()

bool vtkm::interop::anari::ANARIMapper::GetMapFieldAsAttribute ( ) const

◆ GetName()

const char* vtkm::interop::anari::ANARIMapper::GetName ( ) const

◆ GroupIsEmpty()

bool vtkm::interop::anari::ANARIMapper::GroupIsEmpty ( ) const

◆ MakeObjectName()

std::string vtkm::interop::anari::ANARIMapper::MakeObjectName ( const char *  suffix) const
protected

◆ RefreshGroup()

void vtkm::interop::anari::ANARIMapper::RefreshGroup ( )
protected

◆ SetActor()

virtual void vtkm::interop::anari::ANARIMapper::SetActor ( const ANARIActor actor)
virtual

Set the current actor on this mapper.

This sets the actor used to create the geometry. When the actor is changed the mapper will update all the corresponding ANARI objects accordingly. This will not cause new ANARI geometry handles to be made, rather the existing handles will be updated to reflect the new actor's data.

Reimplemented in vtkm::interop::anari::ANARIMapperTriangles, vtkm::interop::anari::ANARIMapperPoints, vtkm::interop::anari::ANARIMapperVolume, and vtkm::interop::anari::ANARIMapperGlyphs.

◆ SetANARIColorMap()

virtual void vtkm::interop::anari::ANARIMapper::SetANARIColorMap ( anari_cpp::Array1D  color,
anari_cpp::Array1D  opacity,
bool  releaseArrays = true 
)
virtual

Set color map arrays using raw ANARI array handles.

Parameters
colorColor array used for color mapping.
opacity(unused/deprecated, will remove on future ANARI version)
releaseArraysIf true this function will release the hanldes passed in.

Reimplemented in vtkm::interop::anari::ANARIMapperTriangles, vtkm::interop::anari::ANARIMapperPoints, and vtkm::interop::anari::ANARIMapperVolume.

◆ SetANARIColorMapOpacityScale()

virtual void vtkm::interop::anari::ANARIMapper::SetANARIColorMapOpacityScale ( vtkm::Float32  opacityScale)
virtual

Set a scale factor for opacity (typically used for volumes).

Reimplemented in vtkm::interop::anari::ANARIMapperVolume.

◆ SetANARIColorMapValueRange()

virtual void vtkm::interop::anari::ANARIMapper::SetANARIColorMapValueRange ( const vtkm::Vec2f_32 valueRange)
virtual

◆ SetColorTable()

void vtkm::interop::anari::ANARIMapper::SetColorTable ( const vtkm::cont::ColorTable colorTable)

◆ SetMapFieldAsAttribute()

virtual void vtkm::interop::anari::ANARIMapper::SetMapFieldAsAttribute ( bool  enabled)
virtual

Set whether fields from ANARIActor should end up as geometry attributes.

When this is disabled, the mapper will skip creating the data arrays associated with fields for when applications only want the raw geometry. This defaults to being enabled.

Reimplemented in vtkm::interop::anari::ANARIMapperTriangles, and vtkm::interop::anari::ANARIMapperPoints.

◆ SetName()

void vtkm::interop::anari::ANARIMapper::SetName ( const char *  name)

Member Data Documentation

◆ Actor

ANARIActor vtkm::interop::anari::ANARIMapper::Actor
private

◆ ColorTable

vtkm::cont::ColorTable vtkm::interop::anari::ANARIMapper::ColorTable
private

◆ Current

bool vtkm::interop::anari::ANARIMapper::Current { false }
protected

◆ Handles

std::shared_ptr<ANARIHandles> vtkm::interop::anari::ANARIMapper::Handles
private

◆ MapFieldAsAttribute

bool vtkm::interop::anari::ANARIMapper::MapFieldAsAttribute { true }
private

◆ Name

std::string vtkm::interop::anari::ANARIMapper::Name
private

◆ Valid

bool vtkm::interop::anari::ANARIMapper::Valid { false }
protected

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