Public Types | Public Member Functions | Protected Slots | Protected Member Functions | Friends | List of all members
pqMaterialEditor Class Reference

pqMaterialEditor is a widget that can be used to edit the OSPRay materials. More...

#include <pqMaterialEditor.h>

Inherits QWidget.

Public Types

enum  ExtendedItemDataRole { ExtendedItemDataRole::PropertyValue = Qt::UserRole + 1 }
 Strong type extension of the existing Qt::ItemDataRole. More...
 

Public Member Functions

 pqMaterialEditor (QWidget *parent=nullptr, QDockWidget *dockWidget=nullptr)
 
 ~pqMaterialEditor () override
 
void updateMaterialList ()
 Clear the editor and fill the editor with the current created materials. More...
 
QString currentMaterialName ()
 Return the name of the current selected material. More...
 
std::vector< std::stringavailableParameters ()
 Return the list of the available OSPRay parameters for the current material. More...
 

Protected Slots

void updateCurrentMaterial (const std::string &)
 
void updateCurrentMaterialWithIndex (int index)
 
void loadMaterials ()
 
void addMaterial ()
 
void removeMaterial ()
 
void attachMaterial ()
 
void saveMaterials ()
 
void addProperty ()
 
void propertyChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 

Protected Member Functions

std::string generateValidMaterialName (const std::string &name)
 Return a unique material name given a desired name. More...
 
void showEvent (QShowEvent *event) override
 Overriden to warn user when material editor is not usable. More...
 

Friends

class pqInternals
 

Detailed Description

pqMaterialEditor is a widget that can be used to edit the OSPRay materials.

This widget allows you to create or remove an OSPRay material. Then, you can customize this material by adding or removing properties, such as the color, the roughness, the textures... depending on the available properties that you can see in vtkOSPRayMaterialLibrary. Texture format supported are *.png, *.jpg, *.bmp and *.ppm.

Definition at line 26 of file pqMaterialEditor.h.

Member Enumeration Documentation

◆ ExtendedItemDataRole

Strong type extension of the existing Qt::ItemDataRole.

This is used to store the QVariant value for the properties

Enumerator
PropertyValue 

Definition at line 54 of file pqMaterialEditor.h.

Constructor & Destructor Documentation

◆ pqMaterialEditor()

pqMaterialEditor::pqMaterialEditor ( QWidget *  parent = nullptr,
QDockWidget *  dockWidget = nullptr 
)

◆ ~pqMaterialEditor()

pqMaterialEditor::~pqMaterialEditor ( )
override

Member Function Documentation

◆ updateMaterialList()

void pqMaterialEditor::updateMaterialList ( )

Clear the editor and fill the editor with the current created materials.

◆ currentMaterialName()

QString pqMaterialEditor::currentMaterialName ( )

Return the name of the current selected material.

◆ availableParameters()

std::vector<std::string> pqMaterialEditor::availableParameters ( )

Return the list of the available OSPRay parameters for the current material.

◆ updateCurrentMaterial

void pqMaterialEditor::updateCurrentMaterial ( const std::string )
protectedslot

◆ updateCurrentMaterialWithIndex

void pqMaterialEditor::updateCurrentMaterialWithIndex ( int  index)
protectedslot

◆ loadMaterials

void pqMaterialEditor::loadMaterials ( )
protectedslot

◆ addMaterial

void pqMaterialEditor::addMaterial ( )
protectedslot

◆ removeMaterial

void pqMaterialEditor::removeMaterial ( )
protectedslot

◆ attachMaterial

void pqMaterialEditor::attachMaterial ( )
protectedslot

◆ saveMaterials

void pqMaterialEditor::saveMaterials ( )
protectedslot

◆ addProperty

void pqMaterialEditor::addProperty ( )
protectedslot

◆ propertyChanged

void pqMaterialEditor::propertyChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
)
protectedslot

◆ generateValidMaterialName()

std::string pqMaterialEditor::generateValidMaterialName ( const std::string name)
protected

Return a unique material name given a desired name.

Checks for all the already existing materials and if one has the same name, this function appends the suffix _X where X is the next unique integer identifier.

◆ showEvent()

void pqMaterialEditor::showEvent ( QShowEvent *  event)
overrideprotected

Overriden to warn user when material editor is not usable.

Friends And Related Function Documentation

◆ pqInternals

friend class pqInternals
friend

Definition at line 93 of file pqMaterialEditor.h.


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