Blue Brain BioExplorer
core::engine::ospray::OSPRayMaterial Class Reference

#include <OSPRayMaterial.h>

Inheritance diagram for core::engine::ospray::OSPRayMaterial:
Collaboration diagram for core::engine::ospray::OSPRayMaterial:

Public Member Functions

 OSPRayMaterial (const PropertyMap &properties={}, const bool backgroundMaterial=false)
 
 ~OSPRayMaterial ()
 
void commit () final
 
void commit (const std::string &renderer)
 
OSPMaterial getOSPMaterial ()
 
- Public Member Functions inherited from core::Material
PLATFORM_API Material (const PropertyMap &properties={})
 Constructs a Material object. More...
 
PLATFORM_API const std::string & getName () const
 Returns the name of the material. More...
 
PLATFORM_API void setName (const std::string &value)
 Sets the name of the material. More...
 
PLATFORM_API void setDiffuseColor (const Vector3d &value)
 Sets the color of the diffuse component of the material. More...
 
PLATFORM_API const Vector3dgetDiffuseColor () const
 Returns the color of the diffuse component of the material. More...
 
PLATFORM_API void setSpecularColor (const Vector3d &value)
 Sets the color of the specular component of the material. More...
 
PLATFORM_API const Vector3dgetSpecularColor () const
 Returns the color of the specular component of the material. More...
 
PLATFORM_API void setSpecularExponent (const double value)
 Sets the specular exponent of the material. More...
 
PLATFORM_API double getSpecularExponent () const
 Returns the specular exponent of the material. More...
 
PLATFORM_API void setReflectionIndex (const double value)
 Sets the reflection index of the material. More...
 
PLATFORM_API double getReflectionIndex () const
 Returns the reflection index of the material. More...
 
PLATFORM_API void setOpacity (const double value)
 Sets the opacity of the material. More...
 
PLATFORM_API double getOpacity () const
 Returns the opacity of the material. More...
 
PLATFORM_API void setRefractionIndex (const double value)
 Sets the refraction index of the material. More...
 
PLATFORM_API double getRefractionIndex () const
 Returns the refraction index of the material. More...
 
PLATFORM_API void setEmission (double value)
 Sets the emission of the material. More...
 
PLATFORM_API double getEmission () const
 Returns the emission of the material. More...
 
PLATFORM_API void setGlossiness (const double value)
 Sets the glossiness of the material. More...
 
PLATFORM_API double getGlossiness () const
 Returns the glossiness of the material. More...
 
PLATFORM_API void setShadingMode (const MaterialShadingMode value)
 Sets the shading mode of the material. More...
 
PLATFORM_API MaterialShadingMode getShadingMode () const
 Returns the shading mode of the material. More...
 
PLATFORM_API void setUserParameter (const double value)
 Sets the user parameter of the material. More...
 
PLATFORM_API double getUserParameter () const
 Returns the user parameter of the material. More...
 
PLATFORM_API void setCastUserData (const bool value)
 Sets the cast user data of the material. More...
 
PLATFORM_API double getCastUserData () const
 Returns the cast user data of the material. More...
 
PLATFORM_API void setClippingMode (const MaterialClippingMode value)
 Sets the clipping mode of the material. More...
 
PLATFORM_API MaterialClippingMode getClippingMode () const
 Returns the clipping mode of the material. More...
 
PLATFORM_API void setChameleonMode (const MaterialChameleonMode value)
 Sets the chameleon mode of the material. More...
 
PLATFORM_API MaterialChameleonMode getChameleonMode () const
 Returns the chameleon mode of the material. More...
 
PLATFORM_API void setNodeId (const int32_t value)
 Sets the cast user data of the material. More...
 
PLATFORM_API int32_t getNodeId () const
 Returns the cast user data of the material. More...
 
PLATFORM_API const TextureDescriptorsgetTextureDescriptors () const
 Returns the texture descriptors of the material. More...
 
PLATFORM_API void setTexture (const std::string &fileName, const TextureType type)
 Sets the texture of the material for the specified texture type. More...
 
PLATFORM_API void removeTexture (const TextureType type)
 Removes the texture of the material for the specified texture type. More...
 
PLATFORM_API Texture2DPtr getTexture (const TextureType type) const
 Returns the texture of the material for the specified texture type. More...
 
PLATFORM_API bool hasTexture (const TextureType type) const
 Checks if the material has a texture for the specified texture type. More...
 
PLATFORM_API void clearTextures ()
 Clears all textures from the material object. More...
 
- Public Member Functions inherited from core::PropertyObject
void setCurrentType (const std::string &type)
 
const std::string & getCurrentType () const
 
template<typename T >
void updateProperty (const std::string &name, const T &value, const bool triggerCallback=true)
 
bool hasProperty (const std::string &name) const
 
template<typename T >
getProperty (const std::string &name) const
 
template<typename T >
getPropertyOrValue (const std::string &name, T val) const
 
void setProperties (const PropertyMap &properties)
 
void setProperties (const std::string &type, const PropertyMap &properties)
 
void updateProperties (const PropertyMap &properties)
 
const auto & getPropertyMap () const
 
const auto & getPropertyMap (const std::string &type) const
 
strings getTypes () const
 
void clonePropertiesFrom (const PropertyObject &obj)
 
- Public Member Functions inherited from core::BaseObject
 BaseObject ()=default
 
virtual ~BaseObject ()=default
 
 BaseObject (const BaseObject &)
 
BaseObjectoperator= (const BaseObject &rhs)
 
bool isModified () const
 
void resetModified ()
 
void markModified (const bool triggerCallback=true)
 
void onModified (const ModifiedCallback &callback)
 
void clearModifiedCallback ()
 

Additional Inherited Members

- Public Types inherited from core::BaseObject
using ModifiedCallback = std::function< void(const BaseObject &)>
 
- Protected Member Functions inherited from core::Material
bool _loadTexture (const std::string &fileName, const TextureType type)
 Loads the texture for the specified texture type. More...
 
- Protected Member Functions inherited from core::BaseObject
template<typename T >
void _updateValue (T &member, const T &newValue, const bool triggerCallback=true)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if< std::is_floating_point< T >::value >::type *=0)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if<!std::is_floating_point< T >::value >::type *=0)
 
- Protected Attributes inherited from core::Material
std::string _name {"undefined"}
 
Vector3d _diffuseColor {1., 1., 1.}
 
Vector3d _specularColor {1., 1., 1.}
 
double _specularExponent {10.}
 
double _reflectionIndex {0.}
 
double _opacity {1.}
 
double _refractionIndex {1.}
 
double _emission {0.}
 
double _glossiness {1.}
 
TexturesMap _textures
 
TextureDescriptors _textureDescriptors
 
double _userParameter {1.}
 
MaterialShadingMode _shadingMode {MaterialShadingMode::undefined_shading_mode}
 
bool _castUserData {false}
 
MaterialClippingMode _clippingMode {MaterialClippingMode::no_clipping}
 
int32_t _nodeId
 
MaterialChameleonMode _chameleonMode {MaterialChameleonMode::undefined_chameleon_mode}
 
- Protected Attributes inherited from core::PropertyObject
std::string _currentType
 
std::map< std::string, PropertyMap_properties
 

Detailed Description

Definition at line 34 of file OSPRayMaterial.h.

Constructor & Destructor Documentation

◆ OSPRayMaterial()

core::engine::ospray::OSPRayMaterial::OSPRayMaterial ( const PropertyMap properties = {},
const bool  backgroundMaterial = false 
)
inline

Definition at line 37 of file OSPRayMaterial.h.

◆ ~OSPRayMaterial()

core::engine::ospray::OSPRayMaterial::~OSPRayMaterial ( )

Definition at line 56 of file OSPRayMaterial.cpp.

Member Function Documentation

◆ commit() [1/2]

void core::engine::ospray::OSPRayMaterial::commit ( )
finalvirtual

Noop until commit(renderer) is called.

Implements core::Material.

Definition at line 61 of file OSPRayMaterial.cpp.

◆ commit() [2/2]

void core::engine::ospray::OSPRayMaterial::commit ( const std::string &  renderer)

Instance the actual renderer specific object for this material. This operation always creates a new ISPC side material.

Definition at line 111 of file OSPRayMaterial.cpp.

◆ getOSPMaterial()

OSPMaterial core::engine::ospray::OSPRayMaterial::getOSPMaterial ( )
inline

Definition at line 52 of file OSPRayMaterial.h.


The documentation for this class was generated from the following files: