51# include <Inventor/Qt/SoQtMaterialEditor.h>
53# include <Inventor/Win/SoWinMaterialEditor.h>
56#ifndef _SO_XT_MATERIAL_EDITOR_
57#define _SO_XT_MATERIAL_EDITOR_
60#include <Inventor/SbBasic.h>
61#include <Inventor/misc/SoCallbackList.h>
62#include <Inventor/Xt/SoXtComponent.h>
178 SoWidget parent = NULL,
179 const char *name = NULL,
180 SbBool buildInsideParent = TRUE);
206 inline void addMaterialChangedCallback(
207 SoXtMaterialEditorCB *f,
208 void *userData = NULL);
212 inline void removeMaterialChangedCallback(
213 SoXtMaterialEditorCB *f,
214 void *userData = NULL);
224 {
return updateFreq; }
253 SoWidget buildWidget(SoWidget parent);
256 virtual SbString getDefaultWidgetName()
const;
257 virtual SbString getDefaultTitle()
const;
258 virtual SbString getDefaultIconTitle()
const;
267 SoWidget acceptButton, diamondButtons[4], radioButtons[4];
268 SoXtMaterialEditor::UpdateFrequency updateFreq;
273 SoXtColorSlider *sliders[6];
293 SoWidget *menuItemsList;
298 void updateLocalComponents();
301 void updateColorEditor(
SbBool updateTitle = FALSE);
305 void updateColorSlider(SoXtColorSlider *,
const float rgb[3]);
308 void updateMaterialColor(
313 void updateMaterialColor(
320 void copyMaterial(
SoMaterial *mat1,
int index1,
325 void undoIgnoresIfChanged();
328 static void pasteDone(
void *userData,
SoPathList *pathList);
331 static void materialListCB(
void *,
const SoMaterial *);
332 static void colorEditorCB(
void *,
const SbColor *);
333 static void ambientSliderCB(
void *,
float);
334 static void diffuseSliderCB(
void *,
float);
335 static void specularSliderCB(
void *,
float);
336 static void emissiveSliderCB(
void *,
float);
337 static void shininessSliderCB(
void *,
float);
338 static void transparencySliderCB(
void *,
float);
341 static void menuPick(SoWidget,
int, XmAnyCallbackStruct *);
343 static void radioButtonPick(SoWidget,
int,
XtPointer);
344 static void diamondButtonPick(SoWidget,
int,
XtPointer);
348 static void sensorCB(
void *,
SoSensor *);
351 SoWidget buildPulldownMenu(SoWidget parent);
352 SoWidget buildControls(SoWidget parent);
353 SoWidget buildSlidersForm(SoWidget parent);
355 static void visibilityChangeCB(
void *pt,
SbBool visible);
360 void constructorCommon(
SbBool buildNow);
368 SoXtMaterialEditorCB *f,
370{ callbackList->
addCallback((SoCallbackListCB *) f, userData); }
374 SoXtMaterialEditorCB *f,
376{ callbackList->
removeCallback((SoCallbackListCB *) f, userData); }
Class for smart character strings.
Node that defines an object's base color.
Base class for all nodes, paths, and engines.
Manages a list of callbacks and associated data.
void addCallback(SoCallbackListCB *f, void *userData=NULL)
Adds a function to the list of callback functions.
void removeCallback(SoCallbackListCB *f, void *userData=NULL)
Removes a function from the list of callback functions.
Node representing a directional light source.
Multiple-value field containing any number of RGB colors stored as three floats.
Surface material definition node.
Abstract base class for all database nodes.
Sensor class that can be attached to Open Inventor nodes.
Maintains a list of pointers to paths.
Field containing an RGB color.
Manages a list of selected objects.
Abstract base class for Open Inventor sensors.
Group node that saves and restores traversal state.
Supports copy/paste for Open Inventor using the Xt clipboard.
Component that lets you edit a color interactively.
Abstract base class for all Open Inventor components.
Component which lets you edit a material interactively.
void attach(SoMaterial *material, int index=0)
Attaches the editor to a material node and edits the material of the given index.
virtual void hide()
This hides the component.
~SoXtMaterialEditor()
Destructor.
UpdateFrequency
UpdateFrequency is how often new values should be sent to the node or the callback routine.
@ CONTINUOUS
Send updates with every mouse motion.
@ AFTER_ACCEPT
Only send updates after user hits accept button.
const SoMaterial & getMaterial() const
Gets the current material value.
virtual void show()
This shows the component.
SbBool isAttached()
Returns TRUE if the editor is attached.
void addMaterialChangedCallback(SoXtMaterialEditorCB *f, void *userData=NULL)
Additional way of using the material editor, by registering a callback which will be called whenever ...
SoXtMaterialEditor(SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE)
Constructor.
void SoXtMaterialEditorCB(void *userData, const SoMaterial *mtl)
void detach()
Detaches the editor from the material node.
SoXtMaterialEditor::UpdateFrequency getUpdateFrequency()
Gets the update frequency.
void removeMaterialChangedCallback(SoXtMaterialEditorCB *f, void *userData=NULL)
Removes the material changed callback.
void setMaterial(const SoMaterial &mtl)
Sets a new material value.
void setUpdateFrequency(SoXtMaterialEditor::UpdateFrequency freq)
Sets the update frequency.
Component which lets you edit a material interactively.
Component for rendering Open Inventor scene graphs.