'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SoXtMaterialEditor(3IV) .SH NAME SoXtMaterialEditor \(em Component which lets you edit a material interactively .SH INHERITS FROM SoXtComponent > SoXtMaterialEditor .SH SYNOPSIS .ps -1 \*(Cr#include .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crtypedef void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoXtMaterialEditorCB\*(Cr(void *userData, const SoMaterial *mtl) .sp .in 0.5i \*(Crenum \*(CbUpdateFrequency\*(Cr { .in 1i .ta 20m .in 1.5i+20n .ti 1i .ta 20m .ds Pt \*(CbSoXtMaterialEditor::CONTINUOUS\f1 .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 1i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} send updates with every mouse motion .br .in 1.5i+20n .ti 1i .ta 20m .ds Pt \*(CbSoXtMaterialEditor::AFTER_ACCEPT\f1 .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 1i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} only send updates after user hits accept button .br .in 0.5i \*(Cr} .sp .in 1i \f1Methods from class SoXtMaterialEditor: .in 0.5i .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoXtMaterialEditor\*(Cr(Widget parent = NULL, const char *name = NULL, SbBool buildInsideParent = TRUE) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cb~SoXtMaterialEditor\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbattach\*(Cr(SoMaterial *material, int index = 0) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbdetach\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisAttached\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddMaterialChangedCallback\*(Cr(SoXtMaterialEditorCB *f, void *userData = NULL) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbremoveMaterialChangedCallback\*(Cr(SoXtMaterialEditorCB *f, void *userData = NULL) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetUpdateFrequency\*(Cr(SoXtMaterialEditor::UpdateFrequency freq) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSoXtMaterialEditor::UpdateFrequency .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetUpdateFrequency\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetMaterial\*(Cr(const SoMaterial &mtl) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crconst SoMaterial & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetMaterial\*(Cr() const .sp .in 1i \f1Methods from class SoXtComponent: .in 0.5i .sp .ta 24m .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbshow\*(Cr() .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbhide\*(Cr() .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisVisible\*(Cr() .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrWidget .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetWidget\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisTopLevelShell\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrWidget .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetShellWidget\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrWidget .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetParentWidget\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetSize\*(Cr(const SbVec2s &size) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrSbVec2s .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetSize\*(Cr() .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(CrDisplay * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDisplay\*(Cr() .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetTitle\*(Cr(const char *newTitle) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetTitle\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetIconTitle\*(Cr(const char *newIconTitle) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetIconTitle\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetWindowCloseCallback\*(Cr(SoXtComponentCB *func, void *data = NULL) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crstatic SoXtComponent * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetComponent\*(Cr(Widget w) .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetWidgetName\*(Cr() const .br .in 1i+24n .ti 0.5i .ta 24m .ds Pt \*(Crconst char * .ie \w'\*(Pt'>=24n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetClassName\*(Cr() const .sp .SH DESCRIPTION This class is used to edit the material properties of an \*(CbSoMaterial\f1 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. .sp 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. .SH METHODS .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoXtMaterialEditor\*(Cr(Widget parent = NULL, const char *name = NULL, SbBool buildInsideParent = TRUE) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cb~SoXtMaterialEditor\*(Cr() .br .in 1i \f1Constructor and destructor. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbattach\*(Cr(SoMaterial *material, int index = 0) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbdetach\*(Cr() .br .in 1i \f1Attach/detach the editor to a material node and edit the material of the given index. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisAttached\*(Cr() .br .in 1i \f1Returns TRUE if the editor is attached. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddMaterialChangedCallback\*(Cr(SoXtMaterialEditorCB *f, void *userData = NULL) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbremoveMaterialChangedCallback\*(Cr(SoXtMaterialEditorCB *f, void *userData = NULL) .br .in 1i \f1Additional way of using the material editor, by registering a callback which will be called whenever the material changes (check the \*(CbUpdateFrequency\f1 to find when the callbacks will be called). .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetUpdateFrequency\*(Cr(SoXtMaterialEditor::UpdateFrequency freq) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSoXtMaterialEditor::UpdateFrequency .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetUpdateFrequency\*(Cr() .br .in 1i \f1Sets/gets the update frequency. See the \*(CbUpdateFrequency\f1 enum declaration. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetMaterial\*(Cr(const SoMaterial &mtl) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crconst SoMaterial & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetMaterial\*(Cr() const .br .in 1i \f1Set a new material value, and get the current material value. .sp .in 0.5i .SH RESOURCES .nf .in 1i *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) .fi .in 0.5i .SH SEE ALSO \*(CbSoXtComponent, SoXtMaterialList, SoXtDirLightEditor, SoMaterial