GSModeler Engine Version: 9.0

MaterialPanelInterfaceImp class



Description Ancestor class of material dialog interface implementer. Details...
Module Rendering API
Base classes -
Derived classes -
Header MaterialPanelInterfaceImp.hpp


Public methods

    Constructors

Interface functions

    GetName
    GetIcon
    CreateTabPage
    DestroyTabPage
    MaterialChanged
    SetParametersToShow
    ChooseTexture

Detailed description

This class is the ancestor of the add-on created material dialog panels. The add-on can customize the material settings dialog creating one or more new panel into the dialog using this interface.
Here is a typical implementation of the MaterialPanelInterface class:


class MaterialPanelInterface : MaterialPanelInterfaceImp {
private:
    MaterialPanel*         panel;     // The new panel.
    MaterialPanelObserver* observer;  // The observer of the new panel.

public:
             MaterialPanelInterface ();
    explicit MaterialPanelInterface (GSModeler::MaterialDialogInterfaceImp* dialogInterface);

    virtual void      GetName (char* name);
    virtual DG::Icon  GetIcon (void);
    virtual bool      CreateTabPage (const DG::TabControl& tabControl);
    virtual void      DestroyTabPage (void);
    virtual void      MaterialChanged (GSModeler::Material* material);
    virtual bool      SetParametersToShow (MPI::NameList* parList, bool viewOnly);
};

The MaterialPanel class:


class MaterialPanel: public DG::TabPage  // The class of the new material tabpage.
{
friend class MaterialPanelObserver;

private:
    enum {                                    // Identifyers of controls.
        EditControlId = 1
    };

    DG::PosIntEdit editControl;               // Controls.

    GSModeler::Material* material;  // The material.

public:
    MaterialPanel (const DG::TabControl& tabControl, short resourceId);

    void MaterialChanged ( GSModeler::Material* material);
};

The MaterialPanelObserver class:


class MaterialPanelObserver: private DG::PanelObserver,        // The observer of the new panel.
                             public  DG::PosIntEditObserver,
                             private DG::CompoundItemObserver
{
private:
    MaterialPanel* panel;                                     // Pointer to the panel.

public:
     MaterialPanelObserver (MaterialPanel* panel);
    ~MaterialPanelObserver ();

    virtual void PosIntEditChanged (const DG::PosIntEditChangeEvent& ev);
    bool	 EnableControls (MPI::NameList* parList, bool viewOnly); // example function to be called 
	                                                                 // from SetParametersToShow
};




See Also

MaterialDialogInterfaceImp

Copyright © 2004 - Graphisoft R&D Software Development Rt. All rights reserved worldwide.