SoWinMaterialEditor Class Reference

VSG extension Component which lets you edit a material interactively. More...

#include <Inventor/Win/SoWinMaterialEditor.h>

Inheritance diagram for SoWinMaterialEditor:

List of all members.

Public Types

enum  UpdateFrequency {

Public Member Functions

 SoWinMaterialEditor (SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE)
virtual ~SoWinMaterialEditor ()
void attach (SoMaterial *material, int index=0)
void detach ()
SbBool isAttached ()
void addMaterialChangedCallback (SoWinMaterialEditorCB *f, void *userData=NULL)
void removeMaterialChangedCallback (SoWinMaterialEditorCB *f, void *userData=NULL)
void setUpdateFrequency (SoWinMaterialEditor::UpdateFrequency freq)
SoWinMaterialEditor::UpdateFrequency getUpdateFrequency ()
virtual void show ()
virtual void hide ()
void setMaterial (const SoMaterial &mtl)
const SoMaterialgetMaterial () const

Public Attributes

SbBool alwaysOnTop
SoWinMaterialPalette * m_pMaterialPalette

Detailed Description

VSG extension Component which lets you edit a material interactively.

This class is used to edit the material properties of an SoMaterial node. The editor can also directly be used using callbacks instead of attaching it to a node. The component consists of a render area displaying a test sphere, some sliders, a set of radio buttons, and a menu. The sphere displays the current material being edited. There is one slider for each material coefficient. Those fields are ambient, diffuse, specular, emissive (all of which are colors); and transparency and shininess (which are scalar values). A color editor can be opened to edit the color slider base color. A material list displays palettes of predefined materials from which to choose.

The editor can currently be attached to only one material at a time. Attaching two different materials will automatically detach the first one before attaching the second.


SoWinComponent, SoWinDirectionalLightEditor, SoMaterial

Member Enumeration Documentation

UpdateFrequency is how often new values should be sent to the node or the callback routine.


Send updates with every mouse motion.


Only send updates after user hits accept button.

Constructor & Destructor Documentation

SoWinMaterialEditor::SoWinMaterialEditor ( SoWidget  parent = NULL,
const char *  name = NULL,
SbBool  buildInsideParent = TRUE 


virtual SoWinMaterialEditor::~SoWinMaterialEditor (  )  [virtual]


Member Function Documentation

void SoWinMaterialEditor::addMaterialChangedCallback ( SoWinMaterialEditorCB f,
void *  userData = NULL 
) [inline]

Additional way of using the material editor, by registering a callback which will be called whenever the material changes (check the UpdateFrequency to find when the callbacks will be called).

void SoWinMaterialEditor::attach ( SoMaterial material,
int  index = 0 

Attaches the editor to a material node and edits the material of the given index.

void SoWinMaterialEditor::detach (  ) 

Detaches the editor from the material node.

const SoMaterial& SoWinMaterialEditor::getMaterial (  )  const [inline]

Gets the current material value.

SoWinMaterialEditor::UpdateFrequency SoWinMaterialEditor::getUpdateFrequency (  )  [inline]

Gets the update frequency.

See the UpdateFrequency enum declaration.

virtual void SoWinMaterialEditor::hide (  )  [virtual]

This hides the component.

It calls the appropriate unrealize or unmanage routines.

Reimplemented from SoWinComponent.

SbBool SoWinMaterialEditor::isAttached (  )  [inline]

Returns TRUE if the editor is attached.

void SoWinMaterialEditor::removeMaterialChangedCallback ( SoWinMaterialEditorCB f,
void *  userData = NULL 
) [inline]

Removes the material changed callback.

void SoWinMaterialEditor::setMaterial ( const SoMaterial mtl  ) 

Sets a new material value.

void SoWinMaterialEditor::setUpdateFrequency ( SoWinMaterialEditor::UpdateFrequency  freq  ) 

Sets the update frequency.

See the UpdateFrequency enum declaration.

virtual void SoWinMaterialEditor::show (  )  [virtual]

This shows the component.

If this is a topLevelShell component, then show() will Realize and Map the window, else it will simply Manage the widget. In addition, show() will also pop the component window to the top and de-iconify if necessary, to make sure the component is visible by the user.

Reimplemented from SoWinComponent.

Member Data Documentation

The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 12 Sep 2022
Copyright © Thermo Fisher Scientific All rights reserved.