26#ifndef _SO_QT_MATERIAL_EDITOR_
27#define _SO_QT_MATERIAL_EDITOR_
29#include <Inventor/Qt/OivQtCompat.h>
30#include <Inventor/SbBasic.h>
31#include <Inventor/misc/SoCallbackList.h>
32#include <Inventor/Qt/SoQtComponent.h>
122 const char *name = NULL,
123 SbBool buildInsideParent = TRUE );
152 void *userData = NULL);
158 void *userData = NULL);
169 {
return updateFreq; }
210 virtual SbString getDefaultWidgetName()
const;
211 virtual SbString getDefaultTitle()
const;
212 virtual SbString getDefaultIconTitle()
const;
214 virtual bool eventFilter(QObject *
object,QEvent *event);
217 unsigned long nCurrEditId ;
230 QPointer<QRadioButton> diamondButtons[4], radioButtons[4];
231 QPointer<SoQtButton> acceptButton;
235 QPointer<QWidget> mgrWidget;
237 SoQtColorSlider *sliders[6];
240 SoQtMaterialList *materialList;
259 void updateLocalComponents();
262 void updateColorEditor(
SbBool updateTitle = FALSE);
266 void updateColorSlider(SoQtColorSlider *,
const float rgb[3]);
269 void updateMaterialColor(
274 void updateMaterialColor(
283 void copyMaterial(
SoNode *mat1,
int index1,
284 const SoNode *mat2,
int index2);
288 void undoIgnoresIfChanged();
294 static void materialListCB(
void *,
const SoMaterial *);
295 static void colorEditorCB(
void *,
const SbColor *);
296 static void ambientSliderCB(
void *,
float);
297 static void diffuseSliderCB(
void *,
float);
298 static void specularSliderCB(
void *,
float);
299 static void emissiveSliderCB(
void *,
float);
300 static void shininessSliderCB(
void *,
float);
301 static void transparencySliderCB(
void *,
float);
303 static void colorEditorCloseCB(
void* userData,
SoQtComponent*);
307 void menuPick(
int id);
309 void radioButtonPick(QWidget*,
int,
XtPointer);
310 void diamondButtonPick(QWidget*,
int,
XtPointer);
313 static void sensorCB(
void *,
SoSensor *);
316 QWidget* buildWidget(QWidget* parent);
317 QMenuBar* buildPulldownMenu(QWidget* parent);
318 QWidget* buildControls(QWidget* parent);
319 QWidget* buildSlidersForm(QWidget* parent);
325 void constructorCommon(
SbBool buildNow);
327 QPointer<QMenu> edit;
328 QAction* acCon, *acMan;
332 void visibilityChangeCB(
SbBool visible);
335 void slot_continuous();
338 void slot_radioButton0();
339 void slot_radioButton1();
340 void slot_radioButton2();
341 void slot_radioButton3();
343 void slot_diamondButton0();
344 void slot_diamondButton1();
345 void slot_diamondButton2();
346 void slot_diamondButton3();
348 void acceptButtonCB();
357 SoQtMaterialEditorCB *f,
359{ callbackList->
addCallback((SoCallbackListCB *) f, userData); }
363 SoQtMaterialEditorCB *f,
365{ 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.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Component that l...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Component which ...
const SoMaterial & getMaterial() const
Gets the current material value.
void removeMaterialChangedCallback(SoQtMaterialEditorCB *f, void *userData=NULL)
Removes the material changed callback.
void setUpdateFrequency(SoQtMaterialEditor::UpdateFrequency freq)
Sets the update frequency.
SoQtMaterialEditor(QWidget *parent=qApp->activeWindow(), const char *name=NULL, SbBool buildInsideParent=TRUE)
Constructor.
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.
virtual void show()
This shows the component.
SoQtMaterialPalette * m_pMaterialPalette
Pointer to a material palette editor.
void detach()
Detaches the editor from the material node.
SbBool alwaysOnTop
Boolean indicating if the editor should be always on top of the other windows.
void setMaterial(const SoMaterial &mtl)
Sets a new material value.
~SoQtMaterialEditor()
Destructor.
SoQtMaterialEditor::UpdateFrequency getUpdateFrequency()
Gets the update frequency.
UpdateFrequency
Update frequency.
@ CONTINUOUS
Send updates with every mouse motion.
@ AFTER_ACCEPT
Only send updates after user hits accept button.
SbBool isAttached()
Returns TRUE if the editor is attached.
void SoQtMaterialEditorCB(void *userData, const SoMaterial *mtl)
void addMaterialChangedCallback(SoQtMaterialEditorCB *f, void *userData=NULL)
Additional way of using the material editor, by registering a callback which will be called whenever ...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Component for re...
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.