00001 #ifndef COIN_SOQTMATERIALEDITOR_H
00002 #define COIN_SOQTMATERIALEDITOR_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <Inventor/Qt/nodes/SoGuiMaterialEditor.h>
00028 #include <Inventor/Qt/SoQtRenderArea.h>
00029
00030 class SoMaterial;
00031 class SoVRMLMaterial;
00032
00033
00034
00035 typedef void SoQtMaterialEditorCB(void * userdata, const SoMaterial * material);
00036
00037 class SOQT_DLL_API SoQtMaterialEditor : public SoQtRenderArea {
00038 SOQT_OBJECT_HEADER(SoQtMaterialEditor, SoQtRenderArea);
00039
00040 public:
00041 SoQtMaterialEditor(QWidget * parent = NULL, const char * name = NULL, SbBool embed = TRUE);
00042 ~SoQtMaterialEditor(void);
00043
00044 enum UpdateFrequency {
00045 CONTINUOUS = SoGuiMaterialEditor::CONTINUOUS,
00046 AFTER_ACCEPT = SoGuiMaterialEditor::AFTER_ACCEPT
00047 };
00048
00049 void attach(SoMaterial * material, int index = 0);
00050 void attach(SoVRMLMaterial * material);
00051 void detach(void);
00052 SbBool isAttached(void);
00053
00054 void addMaterialChangedCallback(
00055 SoQtMaterialEditorCB * callback, void * closure = NULL);
00056 void removeMaterialChangedCallback(
00057 SoQtMaterialEditorCB * callback, void * closure = NULL);
00058
00059 void setUpdateFrequency(SoQtMaterialEditor::UpdateFrequency frequency);
00060 SoQtMaterialEditor::UpdateFrequency getUpdateFrequency(void) const;
00061
00062 void setMaterial(const SoMaterial & material);
00063 void setMaterial(const SoVRMLMaterial & material);
00064 const SoMaterial & getMaterial(void) const;
00065 SbBool isAttachedVRML(void);
00066
00067 SoGuiMaterialEditor * getEditor(void) const;
00068
00069 protected:
00070 SoQtMaterialEditor(QWidget * parent, const char * const name, SbBool embed, SbBool build);
00071
00072 virtual const char * getDefaultWidgetName(void) const;
00073 virtual const char * getDefaultTitle(void) const;
00074 virtual const char * getDefaultIconTitle(void) const;
00075
00076 private:
00077 void * internals;
00078
00079 };
00080
00081
00082
00083 #endif // !COIN_SOQTMATERIALEDITOR_H