1SoXtMaterialEditor(3IV)() SoXtMaterialEditor(3IV)()
2
3
4
6 SoXtMaterialEditor — Component which lets you edit a material interac‐
7 tively
8
10 SoXtComponent > SoXtMaterialEditor
11
13 #include <Inventor/Xt/SoXtMaterialEditor.h>
14
15 typedef void SoXtMaterialEditorCB(void *userData, const SoMaterial
16 *mtl)
17
18 enum UpdateFrequency {
19 SoXtMaterialEditor::CONTINUOUS
20 send updates with every mouse motion
21 SoXtMaterialEditor::AFTER_ACCEPT
22 only send updates after user hits accept button
23 }
24
25 Methods from class SoXtMaterialEditor:
26
27 SoXtMaterialEditor(Widget parent = NULL, const char
28 *name = NULL, SbBool buildInsideParent = TRUE)
29 ~SoXtMaterialEditor()
30 void attach(SoMaterial *material, int index = 0)
31 void detach()
32 SbBool isAttached()
33 void addMaterialChangedCallback(SoXtMaterialEditorCB *f,
34 void *userData = NULL)
35 void removeMaterialChangedCallback(SoXtMaterialEditorCB
36 *f, void *userData = NULL)
37 void setUpdateFrequency(SoXtMaterialEditor::UpdateFre‐
38 quency freq)
39 SoXtMaterialEditor::UpdateFrequency
40 getUpdateFrequency()
41 void setMaterial(const SoMaterial &mtl)
42 const SoMaterial & getMaterial() const
43
44 Methods from class SoXtComponent:
45
46 virtual void show()
47 virtual void hide()
48 SbBool isVisible()
49 Widget getWidget() const
50 SbBool isTopLevelShell() const
51 Widget getShellWidget() const
52 Widget getParentWidget() const
53 void setSize(const SbVec2s &size)
54 SbVec2s getSize()
55 Display * getDisplay()
56 void setTitle(const char *newTitle)
57 const char * getTitle() const
58 void setIconTitle(const char *newIconTitle)
59 const char * getIconTitle() const
60 void setWindowCloseCallback(SoXtComponentCB *func,
61 void *data = NULL)
62 static SoXtComponent * getComponent(Widget w)
63 const char * getWidgetName() const
64 const char * getClassName() const
65
66
68 This class is used to edit the material properties of an SoMaterial
69 node. The editor can also directly be used using callbacks instead of
70 attaching it to a node. The component consists of a render area dis‐
71 playing a test sphere, some sliders, a set of radio buttons, and a
72 menu. The sphere displays the current material being edited. There is
73 one slider for each material coefficient. Those fields are ambient,
74 diffuse, specular, emissive (all of which are colors); and transparency
75 and shininess (which are scalar values). A color editor can be opened
76 to edit the color slider base color. A material list displays palettes
77 of predefined materials from which to choose.
78
79 The editor can currently be attached to only one material at a time.
80 Attaching two different materials will automatically detach the first
81 one before attaching the second.
82
84 SoXtMaterialEditor(Widget parent = NULL, const char
85 *name = NULL, SbBool buildInsideParent = TRUE)
86 ~SoXtMaterialEditor()
87 Constructor and destructor.
88
89 void attach(SoMaterial *material, int index = 0)
90 void detach()
91 Attach/detach the editor to a material node and edit the material of
92 the given index.
93
94 SbBool isAttached()
95 Returns TRUE if the editor is attached.
96
97 void addMaterialChangedCallback(SoXtMaterialEditorCB *f,
98 void *userData = NULL)
99 void removeMaterialChangedCallback(SoXtMaterialEditorCB
100 *f, void *userData = NULL)
101 Additional way of using the material editor, by registering a call‐
102 back which will be called whenever the material changes (check the
103 UpdateFrequency to find when the callbacks will be called).
104
105 void setUpdateFrequency(SoXtMaterialEditor::UpdateFre‐
106 quency freq)
107 SoXtMaterialEditor::UpdateFrequency
108 getUpdateFrequency()
109 Sets/gets the update frequency. See the UpdateFrequency enum decla‐
110 ration.
111
112 void setMaterial(const SoMaterial &mtl)
113 const SoMaterial & getMaterial() const
114 Set a new material value, and get the current material value.
115
116
118 *SoXtMaterialEditor.tile1Color: #4c4c4c (color name or hex value)
119 *SoXtMaterialEditor.tile2Color: #999999 (color name or hex value)
120 *SoXtMaterialEditor.light1Color: white (color name or hex value)
121 *SoXtMaterialEditor.light2Color: white (color name or hex value)
122 *SoXtMaterialEditor.updateFrequency: continuous (continuous | manual)
123
124
126 SoXtComponent, SoXtMaterialList, SoXtDirLightEditor, SoMaterial
127
128
129
130
131 SoXtMaterialEditor(3IV)()