man SoXtMaterialEditor () - Component which lets you edit a material interactively

NAME

SoXtMaterialEditor - Component which lets you edit a material interactively

INHERITS FROM

SoXtComponent > SoXtMaterialEditor

SYNOPSIS

#include <Inventor/Xt/SoXtMaterialEditor.h> c } c } SoXtMaterialEditorCB(void *userData, const SoMaterial *mtl) enum UpdateFrequency { c } c } send updates with every mouse motion

c } c } only send updates after user hits accept button

} Methods from class SoXtMaterialEditor: c } c } SoXtMaterialEditor(Widget parent = NULL, const char *name = NULL, SbBool buildInsideParent = TRUE)

c } c } ~SoXtMaterialEditor()

c } c } attach(SoMaterial *material, int index = 0)

c } c } detach()

c } c } isAttached()

c } c } addMaterialChangedCallback(SoXtMaterialEditorCB *f, void *userData = NULL)

c } c } removeMaterialChangedCallback(SoXtMaterialEditorCB *f, void *userData = NULL)

c } c } setUpdateFrequency(SoXtMaterialEditor::UpdateFrequency freq)

c } c } getUpdateFrequency()

c } c } setMaterial(const SoMaterial &mtl)

c } c } getMaterial() const Methods from class SoXtComponent: c } c } show()

c } c } hide()

c } c } isVisible()

c } c } getWidget() const

c } c } isTopLevelShell() const

c } c } getShellWidget() const

c } c } getParentWidget() const

c } c } setSize(const SbVec2s &size)

c } c } getSize()

c } c } getDisplay()

c } c } setTitle(const char *newTitle)

c } c } getTitle() const

c } c } setIconTitle(const char *newIconTitle)

c } c } getIconTitle() const

c } c } setWindowCloseCallback(SoXtComponentCB *func, void *data = NULL)

c } c } getComponent(Widget w)

c } c } getWidgetName() const

c } c } getClassName() const

DESCRIPTION

This class is used to edit the material properties of an SoMaterial node. The editor can also directly be used using callbacks instead of attaching it to a node. The component consists of a render area displaying a test sphere, some sliders, a set of radio buttons, and a menu. The sphere displays the current material being edited. There is one slider for each material coefficient. Those fields are ambient, diffuse, specular, emissive (all of which are colors); and transparency and shininess (which are scalar values). A color editor can be opened to edit the color slider base color. A material list displays palettes of predefined materials from which to choose. The editor can currently be attached to only one material at a time. Attaching two different materials will automatically detach the first one before attaching the second.

METHODS

c } c } SoXtMaterialEditor(Widget parent = NULL, const char *name = NULL, SbBool buildInsideParent = TRUE)

c } c } ~SoXtMaterialEditor()

Constructor and destructor. c } c } attach(SoMaterial *material, int index = 0)

c } c } detach()

Attach/detach the editor to a material node and edit the material of the given index. c } c } isAttached()

Returns TRUE if the editor is attached. c } c } addMaterialChangedCallback(SoXtMaterialEditorCB *f, void *userData = NULL)

c } c } removeMaterialChangedCallback(SoXtMaterialEditorCB *f, void *userData = NULL)

Additional way of using the material editor, by registering a callback which will be called whenever the material changes (check the UpdateFrequency to find when the callbacks will be called). c } c } setUpdateFrequency(SoXtMaterialEditor::UpdateFrequency freq)

c } c } getUpdateFrequency()

Sets/gets the update frequency. See the UpdateFrequency enum declaration. c } c } setMaterial(const SoMaterial &mtl)

c } c } getMaterial() const

Set a new material value, and get the current material value.

RESOURCES

*SoXtMaterialEditor.tile1Color: #4c4c4c (color name or hex value) *SoXtMaterialEditor.tile2Color: #999999 (color name or hex value) *SoXtMaterialEditor.light1Color: white (color name or hex value) *SoXtMaterialEditor.light2Color: white (color name or hex value) *SoXtMaterialEditor.updateFrequency: continuous (continuous | manual)

SEE ALSO

SoXtComponent, SoXtMaterialList, SoXtDirLightEditor, SoMaterial