9 #include "imstkColor.h" 10 #include "imstkEventObject.h" 11 #include "imstkTexture.h" 79 const std::string&
getName()
const {
return m_name; }
80 void setName(std::string name) { m_name = name; }
94 void setLineWidth(
const double width);
101 void setPointSize(
const double size);
108 void setBackFaceCulling(
const bool culling);
109 void backfaceCullingOn();
110 void backfaceCullingOff();
118 void setDiffuseColor(
const Color& color);
120 void setColor(
const Color& color);
127 void setSpecularColor(
const Color& color);
134 void setSpecular(
const double specular) { m_specular = specular; }
141 void setAmbientColor(
const Color& color);
148 void setMetalness(
const double metalness);
155 void setAmbient(
const double ambient) { m_ambient = ambient; }
162 void setDiffuse(
const double diffuse) {
m_diffuse = diffuse; }
169 void setSpecularPower(
const double p) { m_specularPower = p; }
176 void setRoughness(
const double roughness);
183 void setEmissivity(
const double emissivity);
187 void setAnisotropy(
const double anisotropy);
189 double getAnisotropyRotation()
const {
return m_anisotropyRotation; }
190 void setAnisotropyRotation(
const double anisotropyRotation);
192 double getBaseIOR()
const {
return m_baseIOR; }
193 void setBaseIOR(
const double baseIOR);
195 const Color& getCoatColor()
const {
return m_coatColor; }
196 void setCoatColor(
const Color& coatColor);
198 double getCoatIOR()
const {
return m_coatIOR; }
199 void setCoatIOR(
const double coatIOR);
201 double getCoatNormalScale()
const {
return m_coatNormalScale; }
202 void setCoatNormalScale(
const double coatNormalScale);
204 double getCoatRoughness()
const {
return m_coatRoughness; }
205 void setCoatRoughness(
const double coatRoughness);
207 double getCoatStrength()
const {
return m_coatStrength; }
208 void setCoatStrength(
const double coatStrength);
210 const Color& getEdgeTint()
const {
return m_edgeTint; }
211 void setEdgeTint(
const Color& edgeTint);
216 void addTexture(std::shared_ptr<Texture> texture);
217 void removeTexture(std::shared_ptr<Texture> texture);
238 DisplayMode getRenderMode()
const {
return m_displayMode; }
239 ShadingModel getShadingModel()
const {
return m_shadingModel; }
242 double getOcclusionStrength()
const {
return m_occlusionStrength; }
243 void setOcclusionStrength(
const double o);
245 double getNormalStrength()
const {
return m_normalStrength; }
246 void setNormalStrength(
const double n);
248 const Color& getEdgeColor()
const {
return m_edgeColor; }
249 void setEdgeColor(
const Color& color);
251 const Color& getVertexColor()
const {
return m_vertexColor; }
252 void setVertexColor(
const Color& color);
254 double getOpacity()
const {
return m_opacity; }
255 void setOpacity(
const double opacity);
258 void setBackfaceCulling(
const bool c);
260 std::shared_ptr<ColorFunction> getColorLookupTable()
const {
return m_lookupTable; }
261 void setColorLookupTable(std::shared_ptr<ColorFunction> lut);
263 bool getScalarVisibility()
const {
return m_scalarVisibility; }
264 void setScalarVisibility(
const bool scalarVisibility);
267 void setRecomputeVertexNormals(
const bool recomputeVertexNormals) {
m_recomputeVertexNormals = recomputeVertexNormals; }
269 bool getRenderPointsAsSpheres()
const {
return m_renderPointsAsSpheres; }
270 void setRenderPointsAsSpheres(
const bool renderPointsAsSpheres) { m_renderPointsAsSpheres = renderPointsAsSpheres; }
273 void setIsDynamicMesh(
const bool isDynamicMesh) {
m_isDynamicMesh = isDynamicMesh; }
275 void postModified() { this->
postEvent(
Event(RenderMaterial::modified())); }
278 std::string m_name =
"";
288 Color m_diffuseColor = Color::LightGray;
290 double m_specularPower = 100.0;
291 double m_specular = 0.0;
292 Color m_specularColor = Color::Red;
294 double m_ambient = 0.1;
297 double m_opacity = 1.0;
301 double m_pointSize = 2.0;
302 Color m_edgeColor = Color::Marigold;
303 Color m_vertexColor = Color::Teal;
313 double m_occlusionStrength = 1.0;
314 double m_normalStrength = 1.0;
318 double m_anisotropyRotation = 0.0;
319 double m_baseIOR = 1.5;
321 double m_coatIOR = 2.0;
322 double m_coatNormalScale = 1.0;
323 double m_coatRoughness = 0.0;
324 double m_coatStrength = 0.0;
335 std::shared_ptr<ColorFunction> m_lookupTable;
336 bool m_scalarVisibility =
false;
338 bool m_renderPointsAsSpheres =
false;
double getSpecularPower() const
Get/Set ambient light coefficient.
bool m_isDynamicMesh
Dynamic mesh is one whose buffers are re-evaluated on update.
void addTexture(std::shared_ptr< Texture > texture)
Add/Remove/Get texture.
double getEmissivity() const
Get/Set emissivity.
double m_diffuse
----------------—Common properties------------------—
Phong shading model (default)
Base class for events which contain a type, priority, and data priority defaults to 0 and uses a grea...
Type
Texture type - determines filtering.
SIGNAL(RenderMaterial, modified)
Posted when material parameters are modified.
double getRoughness() const
Get/Set the roughness.
Renders a set of points using a screen-space fluid renderer.
ShadingModel
surface shading model. Defaults to Phong
double m_emissivity
-------------—PBR specific properties----------------—
void setEdgeVisibility(const bool visibility)
Get/Set edge visibility.
DisplayMode
Display mode for the scene objects.
bool m_recomputeVertexNormals
Update vertex normals when vertex or index data is changed.
BlendMode
Volume rendering blend mode.
const Color & getDiffuseColor() const
Get/Set the color. This affects the diffuse color directly, but it affects the specular color in the ...
const std::string & getName() const
Get/Set the material name.
double m_roughness
Value for roughness with range: [0.0, 1.0].
const Color & getAmbientColor() const
Get/Set the ambient color.
double getDiffuse() const
Get/Set diffuse light coefficient.
double getPointSize() const
Get/Set point radius.
DisplayMode getDisplayMode() const
Get/Set display mode.
BlendMode m_blendMode
-----------—Volume rendering properties-------------—
double getSpecular() const
Get/Set the specular amount.
double getMetalness() const
Get/Set the metalness.
virtual void setBlendMode(const BlendMode blendMode)
Get/Set blend mode This function only works for volumes, particles and decals currently and the MAXIM...
EventObject is the base class for all objects in iMSTK that can receive and emit events. It supports direct and queued observer functions. Direct observers receive events immediately on the same thread This can either be posted on an object or be a function pointer Queued observers receive events within their queue which they can process whenever they like. These can be connected with the connect/queuedConnect/disconnect functions Lambda recievers cannot be disconnected unless all receivers to a signal are removed.
static Color White
Various commonly used colors.
const Color & getSpecularColor() const
Get/Set the specular color.
double m_anisotropy
-------------—PBR Clearcoat properties----------------—
bool getBackFaceCulling() const
Backface culling on/off.
Serves no function, just a database for render properties, emits events for others to observe its cha...
double getAmbient() const
Get/Set ambient light coefficient.
void postEvent(const T &e)
Emits the event Direct observers will be immediately called, in sync Queued observers will receive th...
double m_metalness
Value for metalness with range: [0.0, 1.0].
double getLineWidth() const
Get/Set line width or the wireframe.
bool m_backfaceCulling
For performance, uncommon for this to be false.
std::vector< std::shared_ptr< Texture > > m_textures
Ordered by Texture::Type.
double m_lineWidth
----------—Wireframe specific properties-------------—