24#ifndef _SO_WIN_MATERIAL_EDITOR_ 
   25#define _SO_WIN_MATERIAL_EDITOR_ 
   27#include <Inventor/Win/SoWinBeginStrict.h> 
   28#include <Inventor/sys/port.h> 
   29#include <Inventor/SbBasic.h> 
   30#include <Inventor/misc/SoCallbackList.h> 
   31#include <Inventor/Win/SoWinComponent.h> 
   41class SoWinMaterialList;
 
   46class SoWinColorSlider;
 
   51class SoWinMaterialPalette;
 
  120                      SoWidget parent = NULL,
 
  121                      const char *name = NULL, 
 
  122                      SbBool buildInsideParent = TRUE);
 
  151                                                 void *userData = NULL);
 
  158                                                    void *userData = NULL);
 
  168    { 
return updateFreq; }
 
 
  200  virtual SbString    getDefaultWidgetName() 
const;
 
  201  virtual SbString    getDefaultTitle() 
const;
 
  202  virtual SbString    getDefaultIconTitle() 
const;
 
  205  unsigned long nCurrEditId ;
 
  206  unsigned long diamondButtonId[4] ;
 
  207  unsigned long radioButtonId[4] ;
 
  210  void layoutAccept() ;
 
  212  static WBOOL CALLBACK mgrDlgProc( Hwnd hdlg, UINT message,
 
  213                                    WPARAM wParam, LPARAM lParam );
 
  214  static void onCommand(
 
  233  void initPlacement() ;
 
  243  SoWidget              acceptButton, diamondButtons[4], radioButtons[4];
 
  249  SoWinColorSlider    *sliders[6];
 
  252  SoWinMaterialList   *materialList;
 
  274  void                updateLocalComponents();
 
  277  void                updateColorEditor(
SbBool updateTitle = FALSE);
 
  281  void                updateColorSlider(SoWinColorSlider *, 
const float rgb[3]);
 
  284  void                updateMaterialColor(
 
  289  void                updateMaterialColor(
 
  298  void                copyMaterial(
SoNode *mat1, 
int index1, 
 
  299                                   const SoNode *mat2, 
int index2);
 
  303  void                undoIgnoresIfChanged();
 
  306  static void         pasteDone(
void *userData, 
SoPathList *pathList);
 
  309  static void         materialListCB(
void *, 
const SoMaterial *);
 
  310  static void         colorEditorCB(
void *, 
const SbColor *);
 
  311  static void         ambientSliderCB(
void *, 
float);
 
  312  static void         diffuseSliderCB(
void *, 
float);
 
  313  static void         specularSliderCB(
void *, 
float);
 
  314  static void         emissiveSliderCB(
void *, 
float);
 
  315  static void         shininessSliderCB(
void *, 
float);
 
  316  static void         transparencySliderCB(
void *, 
float);
 
  319  void                menuPick(SoWidget, 
int, XmAnyCallbackStruct *);
 
  321  void                radioButtonPick(SoWidget, 
int, 
XtPointer);
 
  322  void                diamondButtonPick(SoWidget, 
int, 
XtPointer);
 
  327  static void         sensorCB(
void *, 
SoSensor *);
 
  330  SoWidget              buildWidget(SoWidget parent);
 
  331  SoWidget              buildPulldownMenu(SoWidget parent);
 
  332  SoWidget              buildControls(SoWidget parent);
 
  333  SoWidget              buildSlidersForm(SoWidget parent);
 
  335  static void visibilityChangeCB(
void *pt, 
SbBool visible);
 
  340  void constructorCommon(
SbBool buildNow);
 
 
  348                                                SoWinMaterialEditorCB *f, 
 
  350{ callbackList->
addCallback((SoCallbackListCB *) f, userData); }
 
 
  354                                                   SoWinMaterialEditorCB *f, 
 
  356{ callbackList->
removeCallback((SoCallbackListCB *) f, userData); }
 
 
  358#include <Inventor/Win/SoWinEndStrict.h> 
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.
 
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a>  Supports copy/pa...
 
<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 ...
 
virtual void show()
This shows the component.
 
void setMaterial(const SoMaterial &mtl)
Sets a new material value.
 
SoWinMaterialEditor(SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE)
Constructor.
 
void addMaterialChangedCallback(SoWinMaterialEditorCB *f, void *userData=NULL)
Additional way of using the material editor, by registering a callback which will be called whenever ...
 
SoWinMaterialEditor::UpdateFrequency getUpdateFrequency()
Gets the update frequency.
 
void attach(SoMaterial *material, int index=0)
Attaches the editor to a material node and edits the material of the given index.
 
const SoMaterial & getMaterial() const
Gets the current material value.
 
void SoWinMaterialEditorCB(void *userData, const SoMaterial *mtl)
 
void removeMaterialChangedCallback(SoWinMaterialEditorCB *f, void *userData=NULL)
Removes the material changed callback.
 
UpdateFrequency
UpdateFrequency is how often new values should be sent to the node or the callback routine.
 
@ AFTER_ACCEPT
Only send updates after user hits accept button.
 
@ CONTINUOUS
Send updates with every mouse motion.
 
SbBool isAttached()
Returns TRUE if the editor is attached.
 
void setUpdateFrequency(SoWinMaterialEditor::UpdateFrequency freq)
Sets the update frequency.
 
SoWinMaterialPalette * m_pMaterialPalette
 
virtual ~SoWinMaterialEditor()
Destructor.
 
void detach()
Detaches the editor from the material node.
 
virtual void hide()
This hides the component.
 
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a>  Component for re...