Viskores  1.0
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
viskores::interop::anari::ANARIMapper Struct Reference

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

#include <ANARIMapper.h>

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

Classes

struct  ANARIHandles
 

Public Member Functions

 ANARIMapper (anari_cpp::Device device, const ANARIActor &actor={}, const std::string &name="<noname>", const viskores::cont::ColorTable &colorTable=viskores::cont::ColorTable::Preset::Default)
 
virtual ~ANARIMapper ()=default
 
anari_cpp::Device GetDevice () const
 
const ANARIActorGetActor () const
 
const char * GetName () const
 
const viskores::cont::ColorTableGetColorTable () const
 
void SetName (const char *name)
 
void SetColorTable (const viskores::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 viskores::Vec2f_32 &valueRange)
 Set the value range (domain) for the color map. More...
 
virtual void SetANARIColorMapOpacityScale (viskores::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 ()
 
viskores::cont::ColorTableGetColorTable ()
 

Protected Attributes

bool Valid { false }
 
bool Current { false }
 

Private Attributes

std::shared_ptr< ANARIHandlesHandles
 
ANARIActor Actor
 
viskores::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()

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

◆ ~ANARIMapper()

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

Member Function Documentation

◆ GetActor()

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

◆ GetANARIGeometry()

virtual anari_cpp::Geometry viskores::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 viskores::interop::anari::ANARIMapperTriangles, viskores::interop::anari::ANARIMapperPoints, and viskores::interop::anari::ANARIMapperGlyphs.

◆ GetANARIGroup()

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

◆ GetANARIInstance()

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

◆ GetANARISpatialField()

virtual anari_cpp::SpatialField viskores::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 viskores::interop::anari::ANARIMapperVolume.

◆ GetANARISurface()

virtual anari_cpp::Surface viskores::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 viskores::interop::anari::ANARIMapperTriangles, viskores::interop::anari::ANARIMapperPoints, and viskores::interop::anari::ANARIMapperGlyphs.

◆ GetANARIVolume()

virtual anari_cpp::Volume viskores::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 viskores::interop::anari::ANARIMapperVolume.

◆ GetColorTable() [1/2]

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

◆ GetColorTable() [2/2]

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

◆ GetDevice()

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

◆ GetMapFieldAsAttribute()

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

◆ GetName()

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

◆ GroupIsEmpty()

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

◆ MakeObjectName()

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

◆ RefreshGroup()

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

◆ SetActor()

virtual void viskores::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 viskores::interop::anari::ANARIMapperTriangles, viskores::interop::anari::ANARIMapperPoints, viskores::interop::anari::ANARIMapperVolume, and viskores::interop::anari::ANARIMapperGlyphs.

◆ SetANARIColorMap()

virtual void viskores::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 viskores::interop::anari::ANARIMapperTriangles, viskores::interop::anari::ANARIMapperPoints, and viskores::interop::anari::ANARIMapperVolume.

◆ SetANARIColorMapOpacityScale()

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

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

Reimplemented in viskores::interop::anari::ANARIMapperVolume.

◆ SetANARIColorMapValueRange()

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

◆ SetColorTable()

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

◆ SetMapFieldAsAttribute()

virtual void viskores::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 viskores::interop::anari::ANARIMapperTriangles, and viskores::interop::anari::ANARIMapperPoints.

◆ SetName()

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

Member Data Documentation

◆ Actor

ANARIActor viskores::interop::anari::ANARIMapper::Actor
private

◆ ColorTable

viskores::cont::ColorTable viskores::interop::anari::ANARIMapper::ColorTable
private

◆ Current

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

◆ Handles

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

◆ MapFieldAsAttribute

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

◆ Name

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

◆ Valid

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

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