iMSTK
Interactive Medical Simulation Toolkit
Public Types | Public Member Functions | Protected Attributes | List of all members
imstk::RenderMaterial Class Reference

Serves no function, just a database for render properties, emits events for others to observe its changes. More...

#include <imstkRenderMaterial.h>

Inheritance diagram for imstk::RenderMaterial:
Inheritance graph
[legend]
Collaboration diagram for imstk::RenderMaterial:
Collaboration graph
[legend]

Public Types

enum  DisplayMode {
  Surface, Wireframe, Points, WireframeSurface,
  VolumeRendering, DisplayMode::Fluid, Image, SurfaceNormals
}
 Display mode for the scene objects. More...
 
enum  ShadingModel {
  ShadingModel::None, ShadingModel::Phong, ShadingModel::Gouraud, ShadingModel::Flat,
  ShadingModel::PBR
}
 surface shading model. Defaults to Phong More...
 
enum  BlendMode { Alpha, Additive, MaximumIntensity, MinimumIntensity }
 Volume rendering blend mode.
 
- Public Types inherited from imstk::EventObject
using Observer = std::tuple< bool, std::weak_ptr< EventObject >, std::function< void(Event *)> >
 

Public Member Functions

 SIGNAL (RenderMaterial, modified)
 Posted when material parameters are modified.
 
 SIGNAL (RenderMaterial, texturesModified)
 Posted when textures are modified.
 
double getAnisotropy () const
 
void setAnisotropy (const double anisotropy)
 
double getAnisotropyRotation () const
 
void setAnisotropyRotation (const double anisotropyRotation)
 
double getBaseIOR () const
 
void setBaseIOR (const double baseIOR)
 
const ColorgetCoatColor () const
 
void setCoatColor (const Color &coatColor)
 
double getCoatIOR () const
 
void setCoatIOR (const double coatIOR)
 
double getCoatNormalScale () const
 
void setCoatNormalScale (const double coatNormalScale)
 
double getCoatRoughness () const
 
void setCoatRoughness (const double coatRoughness)
 
double getCoatStrength () const
 
void setCoatStrength (const double coatStrength)
 
const ColorgetEdgeTint () const
 
void setEdgeTint (const Color &edgeTint)
 
DisplayMode getRenderMode () const
 
ShadingModel getShadingModel () const
 
void setShadingModel (const ShadingModel &model)
 
double getOcclusionStrength () const
 
void setOcclusionStrength (const double o)
 
double getNormalStrength () const
 
void setNormalStrength (const double n)
 
const ColorgetEdgeColor () const
 
void setEdgeColor (const Color &color)
 
const ColorgetVertexColor () const
 
void setVertexColor (const Color &color)
 
double getOpacity () const
 
void setOpacity (const double opacity)
 
bool getBackfaceCulling () const
 
void setBackfaceCulling (const bool c)
 
std::shared_ptr< ColorFunctiongetColorLookupTable () const
 
void setColorLookupTable (std::shared_ptr< ColorFunction > lut)
 
bool getScalarVisibility () const
 
void setScalarVisibility (const bool scalarVisibility)
 
bool getRecomputeVertexNormals () const
 
void setRecomputeVertexNormals (const bool recomputeVertexNormals)
 
bool getRenderPointsAsSpheres () const
 
void setRenderPointsAsSpheres (const bool renderPointsAsSpheres)
 
bool getIsDynamicMesh () const
 
void setIsDynamicMesh (const bool isDynamicMesh)
 
void postModified ()
 
const std::string & getName () const
 Get/Set the material name.
 
void setName (std::string name)
 
DisplayMode getDisplayMode () const
 Get/Set display mode.
 
void setDisplayMode (const DisplayMode displayMode)
 
double getLineWidth () const
 Get/Set line width or the wireframe.
 
void setLineWidth (const double width)
 
double getPointSize () const
 Get/Set point radius.
 
void setPointSize (const double size)
 
bool getBackFaceCulling () const
 Backface culling on/off.
 
void setBackFaceCulling (const bool culling)
 
void backfaceCullingOn ()
 
void backfaceCullingOff ()
 
const ColorgetDiffuseColor () const
 Get/Set the color. This affects the diffuse color directly, but it affects the specular color in the case of metals.
 
void setDiffuseColor (const Color &color)
 
const ColorgetColor () const
 
void setColor (const Color &color)
 
const ColorgetSpecularColor () const
 Get/Set the specular color.
 
void setSpecularColor (const Color &color)
 
double getSpecular () const
 Get/Set the specular amount.
 
void setSpecular (const double specular)
 
const ColorgetAmbientColor () const
 Get/Set the ambient color.
 
void setAmbientColor (const Color &color)
 
double getMetalness () const
 Get/Set the metalness.
 
void setMetalness (const double metalness)
 
double getAmbient () const
 Get/Set ambient light coefficient.
 
void setAmbient (const double ambient)
 
double getDiffuse () const
 Get/Set diffuse light coefficient.
 
void setDiffuse (const double diffuse)
 
double getSpecularPower () const
 Get/Set ambient light coefficient.
 
void setSpecularPower (const double p)
 
double getRoughness () const
 Get/Set the roughness.
 
void setRoughness (const double roughness)
 
double getEmissivity () const
 Get/Set emissivity.
 
void setEmissivity (const double emissivity)
 
void addTexture (std::shared_ptr< Texture > texture)
 Add/Remove/Get texture.
 
void removeTexture (std::shared_ptr< Texture > texture)
 
void removeTexture (Texture::Type type)
 
std::shared_ptr< TexturegetTexture (Texture::Type type)
 
void setEdgeVisibility (const bool visibility)
 Get/Set edge visibility.
 
bool getEdgeVisibility () const
 
virtual void setBlendMode (const BlendMode blendMode)
 Get/Set blend mode This function only works for volumes, particles and decals currently and the MAXIMUM_INTENSITY and MINIMUM_INTENSITY blend modes are only available for volumes.
 
BlendMode getBlendMode () const
 
- Public Member Functions inherited from imstk::EventObject
template<typename T >
void postEvent (const T &e)
 Emits the event Direct observers will be immediately called, in sync Queued observers will receive the Command in their queue for later execution, reciever must implement doEvent.
 
template<typename T >
void queueEvent (const T &e)
 Queues event directly to this.
 
void doEvent ()
 Do an event, if none exists return.
 
void doAllEvents ()
 Do all the events in the event queue.
 
void foreachEvent (std::function< void(Command cmd)> func)
 Thread safe loop over all event commands, one can implement a custom handler.
 
void rforeachEvent (std::function< void(Command cmd)> func)
 thread safe reverse loop over all event commands, one can implement a custom handler
 
void clearEvents ()
 Removes all events from queue cleans up copies of the event.
 

Protected Attributes

std::string m_name = ""
 
std::vector< std::shared_ptr< Texture > > m_textures
 Ordered by Texture::Type.
 
BlendMode m_blendMode = BlendMode::Alpha
 -----------—Volume rendering properties-------------—
 
double m_diffuse = 1.0
 ----------------—Common properties------------------—
 
Color m_diffuseColor = Color::LightGray
 
double m_specularPower = 100.0
 
double m_specular = 0.0
 
Color m_specularColor = Color::Red
 
double m_ambient = 0.1
 
Color m_ambientColor = Color::White
 
double m_opacity = 1.0
 
double m_lineWidth = 1.0
 ----------—Wireframe specific properties-------------—
 
double m_pointSize = 2.0
 
Color m_edgeColor = Color::Marigold
 
Color m_vertexColor = Color::Teal
 
bool m_edgeVisibility = true
 
bool m_vertexVisibility = true
 
double m_emissivity = 0.0
 -------------—PBR specific properties----------------—
 
Color m_emmisiveColor = Color::White
 
double m_metalness = 1.0
 Value for metalness with range: [0.0, 1.0].
 
double m_roughness = 1.0
 Value for roughness with range: [0.0, 1.0].
 
double m_occlusionStrength = 1.0
 
double m_normalStrength = 1.0
 
double m_anisotropy = 0.0
 -------------—PBR Clearcoat properties----------------—
 
double m_anisotropyRotation = 0.0
 
double m_baseIOR = 1.5
 
Color m_coatColor = Color::White
 
double m_coatIOR = 2.0
 
double m_coatNormalScale = 1.0
 
double m_coatRoughness = 0.0
 
double m_coatStrength = 0.0
 
Color m_edgeTint = Color::White
 
bool m_backfaceCulling = true
 For performance, uncommon for this to be false.
 
bool m_isDynamicMesh = true
 Dynamic mesh is one whose buffers are re-evaluated on update.
 
DisplayMode m_displayMode = DisplayMode::Surface
 
ShadingModel m_shadingModel = ShadingModel::Phong
 
bool m_recomputeVertexNormals = true
 Update vertex normals when vertex or index data is changed.
 
std::shared_ptr< ColorFunctionm_lookupTable
 
bool m_scalarVisibility = false
 
bool m_renderPointsAsSpheres = false
 
- Protected Attributes inherited from imstk::EventObject
ParallelUtils::SpinLock eventQueueLock
 
std::deque< CommandeventQueue
 
std::vector< std::pair< std::string, std::vector< Observer > > > queuedObservers
 
std::vector< std::pair< std::string, std::vector< Observer > > > directObservers
 

Detailed Description

Serves no function, just a database for render properties, emits events for others to observe its changes.

Definition at line 26 of file imstkRenderMaterial.h.

Member Enumeration Documentation

◆ DisplayMode

Display mode for the scene objects.

Enumerator
Fluid 

Renders a set of points using a screen-space fluid renderer.

Definition at line 30 of file imstkRenderMaterial.h.

◆ ShadingModel

surface shading model. Defaults to Phong

Enumerator
None 

Renders without shading, no lighting.

Phong 

Phong shading model (default)

Gouraud 

Gouraud shading model (default)

Flat 

Flat shading model with no interpolation.

PBR 

Physically based rendering.

Definition at line 43 of file imstkRenderMaterial.h.

Member Data Documentation

◆ m_edgeVisibility

bool imstk::RenderMaterial::m_edgeVisibility = true
protected
Note
not used (vtk backend)

Definition at line 304 of file imstkRenderMaterial.h.

◆ m_vertexVisibility

bool imstk::RenderMaterial::m_vertexVisibility = true
protected
Note
not used (vtk backend)

Definition at line 305 of file imstkRenderMaterial.h.


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