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 typedef.

Definition at line 70 of file ctkMaterialPropertyWidget.h.

Constructor & Destructor Documentation

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

Constructor.

virtual ctkMaterialPropertyWidget::~ctkMaterialPropertyWidget ( )
virtual

Destructor.

Member Function Documentation

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.

double ctkMaterialPropertyWidget::ambient ( ) const
void ctkMaterialPropertyWidget::ambientChanged ( double  newAmbient)
signal
bool ctkMaterialPropertyWidget::backfaceCulling ( ) const
void ctkMaterialPropertyWidget::backfaceCullingChanged ( bool  newBackfaceCulling)
signal
QColor ctkMaterialPropertyWidget::color ( ) const
void ctkMaterialPropertyWidget::colorChanged ( QColor  newColor)
signal
double ctkMaterialPropertyWidget::diffuse ( ) const
void ctkMaterialPropertyWidget::diffuseChanged ( double  newDiffuse)
signal
bool ctkMaterialPropertyWidget::isBackfaceCullingVisible ( ) const
bool ctkMaterialPropertyWidget::isColorVisible ( ) const
bool ctkMaterialPropertyWidget::isOpacityVisible ( ) const
virtual void ctkMaterialPropertyWidget::onAmbientChanged ( double  newAmbient)
protectedvirtualslot
virtual void ctkMaterialPropertyWidget::onBackfaceCullingChanged ( bool  newBackFaceCulling)
protectedvirtualslot
virtual void ctkMaterialPropertyWidget::onColorChanged ( const QColor &  newColor)
protectedvirtualslot
virtual void ctkMaterialPropertyWidget::onDiffuseChanged ( double  newDiffuse)
protectedvirtualslot
virtual void ctkMaterialPropertyWidget::onOpacityChanged ( double  newOpacity)
protectedvirtualslot
virtual void ctkMaterialPropertyWidget::onSpecularChanged ( double  newSpecular)
protectedvirtualslot
virtual void ctkMaterialPropertyWidget::onSpecularPowerChanged ( double  newSpecularPower)
protectedvirtualslot
double ctkMaterialPropertyWidget::opacity ( ) const
void ctkMaterialPropertyWidget::opacityChanged ( double  newOpacity)
signal
virtual void ctkMaterialPropertyWidget::resizeEvent ( QResizeEvent *  resize)
protectedvirtual
void ctkMaterialPropertyWidget::selectPreset ( QListWidgetItem *  )
protectedslot
void ctkMaterialPropertyWidget::setAmbient ( double  newAmbient)
slot
void ctkMaterialPropertyWidget::setBackfaceCulling ( bool  enable)
slot
void ctkMaterialPropertyWidget::setBackfaceCullingVisible ( bool  show)
void ctkMaterialPropertyWidget::setColor ( const QColor &  newColor)
slot
void ctkMaterialPropertyWidget::setColorVisible ( bool  show)
void ctkMaterialPropertyWidget::setDiffuse ( double  newDiffuse)
slot
void ctkMaterialPropertyWidget::setOpacity ( double  newOpacity)
slot
void ctkMaterialPropertyWidget::setOpacityVisible ( bool  show)
void ctkMaterialPropertyWidget::setSpecular ( double  newSpecular)
slot
void ctkMaterialPropertyWidget::setSpecularPower ( double  newSpecularPower)
slot
double ctkMaterialPropertyWidget::specular ( ) const
void ctkMaterialPropertyWidget::specularChanged ( double  newSpecular)
signal
double ctkMaterialPropertyWidget::specularPower ( ) const
void ctkMaterialPropertyWidget::specularPowerChanged ( double  newSpecularPower)
signal

Member Data Documentation

QScopedPointer<ctkMaterialPropertyWidgetPrivate> ctkMaterialPropertyWidget::d_ptr
protected

Definition at line 145 of file ctkMaterialPropertyWidget.h.

Property Documentation

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 45 of file ctkMaterialPropertyWidget.h.

bool ctkMaterialPropertyWidget::backfaceCulling
readwrite

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

Definition at line 62 of file ctkMaterialPropertyWidget.h.

bool ctkMaterialPropertyWidget::backfaceCullingVisible
readwrite

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

Definition at line 68 of file ctkMaterialPropertyWidget.h.

QColor ctkMaterialPropertyWidget::color
readwrite

This property holds the color of the material.

Definition at line 43 of file ctkMaterialPropertyWidget.h.

bool ctkMaterialPropertyWidget::colorVisible
readwrite

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

Definition at line 64 of file ctkMaterialPropertyWidget.h.

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 51 of file ctkMaterialPropertyWidget.h.

double ctkMaterialPropertyWidget::opacity
readwrite

Opacity component of the material property.

Definition at line 43 of file ctkMaterialPropertyWidget.h.

bool ctkMaterialPropertyWidget::opacityVisible
readwrite

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

Definition at line 66 of file ctkMaterialPropertyWidget.h.

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 55 of file ctkMaterialPropertyWidget.h.

double ctkMaterialPropertyWidget::specularPower
readwrite

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

Definition at line 59 of file ctkMaterialPropertyWidget.h.


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