CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Properties | List of all members
ctkMaterialPropertyWidget Class Reference

#include <Libs/Widgets/ctkMaterialPropertyWidget.h>

Inheritance diagram for ctkMaterialPropertyWidget:
Inheritance graph
[legend]
Collaboration diagram for ctkMaterialPropertyWidget:
Collaboration graph
[legend]

Public Types

typedef QWidget Superclass
 Superclass typedef. More...
 

Public Slots

void setAmbient (double newAmbient)
 
void setBackfaceCulling (bool enable)
 
void setColor (const QColor &newColor)
 
void setDiffuse (double newDiffuse)
 
void setOpacity (double newOpacity)
 
void setSpecular (double newSpecular)
 
void setSpecularPower (double newSpecularPower)
 

Signals

void ambientChanged (double newAmbient)
 
void backfaceCullingChanged (bool newBackfaceCulling)
 
void colorChanged (QColor newColor)
 
void diffuseChanged (double newDiffuse)
 
void opacityChanged (double newOpacity)
 
void specularChanged (double newSpecular)
 
void specularPowerChanged (double newSpecularPower)
 

Public Member Functions

void addPreset (const QColor &color, double opacity, double ambient, double diffuse, double specular, double power, const QString &label)
 
double ambient () const
 
bool backfaceCulling () const
 
QColor color () const
 
 ctkMaterialPropertyWidget (QWidget *parent=0)
 Constructor. More...
 
double diffuse () const
 
bool isBackfaceCullingVisible () const
 
bool isColorVisible () const
 
bool isOpacityVisible () const
 
double opacity () const
 
void setBackfaceCullingVisible (bool show)
 
void setColorVisible (bool show)
 
void setOpacityVisible (bool show)
 
double specular () const
 
double specularPower () const
 
virtual ~ctkMaterialPropertyWidget ()
 Destructor. More...
 

Protected Slots

virtual void onAmbientChanged (double newAmbient)
 
virtual void onBackfaceCullingChanged (bool newBackFaceCulling)
 
virtual void onColorChanged (const QColor &newColor)
 
virtual void onDiffuseChanged (double newDiffuse)
 
virtual void onOpacityChanged (double newOpacity)
 
virtual void onSpecularChanged (double newSpecular)
 
virtual void onSpecularPowerChanged (double newSpecularPower)
 
void selectPreset (QListWidgetItem *)
 

Protected Member Functions

virtual void resizeEvent (QResizeEvent *resize)
 

Protected Attributes

QScopedPointer< ctkMaterialPropertyWidgetPrivate > d_ptr
 

Properties

double ambient
 
bool backfaceCulling
 This property controls weither backface culling should be enabled or not. More...
 
bool backfaceCullingVisible
 Control weither the backface culling is shown to the user. Visible by default. More...
 
QColor color
 This property holds the color of the material. More...
 
bool colorVisible
 Control weither the color is shown to the user. Visible by default. More...
 
double diffuse
 
double opacity
 Opacity component of the material property. More...
 
bool opacityVisible
 Control weither the opacity is shown to the user. Visible by default. More...
 
double specular
 
double specularPower
 

Detailed Description

ctkMaterialPropertyWidget is a panel to control material properties such as color and lighting coefficients. It contains a preview icon and a list of presets. Anytime a property is modified, the preview icon is updated with the new lighting coefficient.

Definition at line 39 of file ctkMaterialPropertyWidget.h.

Member Typedef Documentation

◆ Superclass

Superclass typedef.

Definition at line 74 of file ctkMaterialPropertyWidget.h.

Constructor & Destructor Documentation

◆ ctkMaterialPropertyWidget()

ctkMaterialPropertyWidget::ctkMaterialPropertyWidget ( QWidget *  parent = 0)
explicit

Constructor.

◆ ~ctkMaterialPropertyWidget()

virtual ctkMaterialPropertyWidget::~ctkMaterialPropertyWidget ( )
virtual

Destructor.

Member Function Documentation

◆ addPreset()

void ctkMaterialPropertyWidget::addPreset ( const QColor &  color,
double  opacity,
double  ambient,
double  diffuse,
double  specular,
double  power,
const QString &  label 
)

Add a preset to the preset list. A preview icon will be generated and be added on the bottom right corner list. If space is needed, a scrollbar will appear. When the user clicks on the icon representing the preset, all the preset properties will be applied. If color is invalid, the preset color is synchronized with the current color property.

◆ ambient()

double ctkMaterialPropertyWidget::ambient ( ) const

◆ ambientChanged

void ctkMaterialPropertyWidget::ambientChanged ( double  newAmbient)
signal

◆ backfaceCulling()

bool ctkMaterialPropertyWidget::backfaceCulling ( ) const

◆ backfaceCullingChanged

void ctkMaterialPropertyWidget::backfaceCullingChanged ( bool  newBackfaceCulling)
signal

◆ color()

QColor ctkMaterialPropertyWidget::color ( ) const

◆ colorChanged

void ctkMaterialPropertyWidget::colorChanged ( QColor  newColor)
signal

◆ diffuse()

double ctkMaterialPropertyWidget::diffuse ( ) const

◆ diffuseChanged

void ctkMaterialPropertyWidget::diffuseChanged ( double  newDiffuse)
signal

◆ isBackfaceCullingVisible()

bool ctkMaterialPropertyWidget::isBackfaceCullingVisible ( ) const

◆ isColorVisible()

bool ctkMaterialPropertyWidget::isColorVisible ( ) const

◆ isOpacityVisible()

bool ctkMaterialPropertyWidget::isOpacityVisible ( ) const

◆ onAmbientChanged

virtual void ctkMaterialPropertyWidget::onAmbientChanged ( double  newAmbient)
protectedvirtualslot

◆ onBackfaceCullingChanged

virtual void ctkMaterialPropertyWidget::onBackfaceCullingChanged ( bool  newBackFaceCulling)
protectedvirtualslot

◆ onColorChanged

virtual void ctkMaterialPropertyWidget::onColorChanged ( const QColor &  newColor)
protectedvirtualslot

◆ onDiffuseChanged

virtual void ctkMaterialPropertyWidget::onDiffuseChanged ( double  newDiffuse)
protectedvirtualslot

◆ onOpacityChanged

virtual void ctkMaterialPropertyWidget::onOpacityChanged ( double  newOpacity)
protectedvirtualslot

◆ onSpecularChanged

virtual void ctkMaterialPropertyWidget::onSpecularChanged ( double  newSpecular)
protectedvirtualslot

◆ onSpecularPowerChanged

virtual void ctkMaterialPropertyWidget::onSpecularPowerChanged ( double  newSpecularPower)
protectedvirtualslot

◆ opacity()

double ctkMaterialPropertyWidget::opacity ( ) const

◆ opacityChanged

void ctkMaterialPropertyWidget::opacityChanged ( double  newOpacity)
signal

◆ resizeEvent()

virtual void ctkMaterialPropertyWidget::resizeEvent ( QResizeEvent *  resize)
protectedvirtual

◆ selectPreset

void ctkMaterialPropertyWidget::selectPreset ( QListWidgetItem *  )
protectedslot

◆ setAmbient

void ctkMaterialPropertyWidget::setAmbient ( double  newAmbient)
slot

◆ setBackfaceCulling

void ctkMaterialPropertyWidget::setBackfaceCulling ( bool  enable)
slot

◆ setBackfaceCullingVisible()

void ctkMaterialPropertyWidget::setBackfaceCullingVisible ( bool  show)

◆ setColor

void ctkMaterialPropertyWidget::setColor ( const QColor &  newColor)
slot

◆ setColorVisible()

void ctkMaterialPropertyWidget::setColorVisible ( bool  show)

◆ setDiffuse

void ctkMaterialPropertyWidget::setDiffuse ( double  newDiffuse)
slot

◆ setOpacity

void ctkMaterialPropertyWidget::setOpacity ( double  newOpacity)
slot

◆ setOpacityVisible()

void ctkMaterialPropertyWidget::setOpacityVisible ( bool  show)

◆ setSpecular

void ctkMaterialPropertyWidget::setSpecular ( double  newSpecular)
slot

◆ setSpecularPower

void ctkMaterialPropertyWidget::setSpecularPower ( double  newSpecularPower)
slot

◆ specular()

double ctkMaterialPropertyWidget::specular ( ) const

◆ specularChanged

void ctkMaterialPropertyWidget::specularChanged ( double  newSpecular)
signal

◆ specularPower()

double ctkMaterialPropertyWidget::specularPower ( ) const

◆ specularPowerChanged

void ctkMaterialPropertyWidget::specularPowerChanged ( double  newSpecularPower)
signal

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkMaterialPropertyWidgetPrivate> ctkMaterialPropertyWidget::d_ptr
protected

Definition at line 145 of file ctkMaterialPropertyWidget.h.

Property Documentation

◆ ambient

double ctkMaterialPropertyWidget::ambient
readwrite

This property holds the ambient lighting coefficient, it is a nondirectional property. Its range is [0,1], where 0 means no ambient light, and 1 means full ambient light Hint: A range of [0.1,0.5] is more realistic.

Definition at line 1 of file ctkMaterialPropertyWidget.h.

◆ backfaceCulling

bool ctkMaterialPropertyWidget::backfaceCulling
readwrite

This property controls weither backface culling should be enabled or not.

Definition at line 1 of file ctkMaterialPropertyWidget.h.

◆ backfaceCullingVisible

bool ctkMaterialPropertyWidget::backfaceCullingVisible
readwrite

Control weither the backface culling is shown to the user. Visible by default.

Definition at line 1 of file ctkMaterialPropertyWidget.h.

◆ color

QColor ctkMaterialPropertyWidget::color
readwrite

This property holds the color of the material.

Definition at line 1 of file ctkMaterialPropertyWidget.h.

◆ colorVisible

bool ctkMaterialPropertyWidget::colorVisible
readwrite

Control weither the color is shown to the user. Visible by default.

Definition at line 1 of file ctkMaterialPropertyWidget.h.

◆ diffuse

double ctkMaterialPropertyWidget::diffuse
readwrite

This property holds the diffuse lighting coefficient. Its range is [0,1], where 0 means no diffuse light, and 1 means full diffuse light

Definition at line 1 of file ctkMaterialPropertyWidget.h.

◆ opacity

double ctkMaterialPropertyWidget::opacity
readwrite

Opacity component of the material property.

Definition at line 1 of file ctkMaterialPropertyWidget.h.

◆ opacityVisible

bool ctkMaterialPropertyWidget::opacityVisible
readwrite

Control weither the opacity is shown to the user. Visible by default.

Definition at line 1 of file ctkMaterialPropertyWidget.h.

◆ specular

double ctkMaterialPropertyWidget::specular
readwrite

This property holds the specular lighting coefficient. Its range is [0,1], where 0 means no specular light, and 1 means full specular light

Definition at line 1 of file ctkMaterialPropertyWidget.h.

◆ specularPower

double ctkMaterialPropertyWidget::specularPower
readwrite

This property holds the power of specular lighting coefficient. Its range is [1,50].

Definition at line 1 of file ctkMaterialPropertyWidget.h.


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