Open Search
    MaterialPreviewData Class Reference

    #include <customgui_matpreview.h>

    Inheritance diagram for MaterialPreviewData:

    Public Member Functions

    void AnimatePreview (Bool bAnimate)
     
    Bool PreviewIsAnimated ()
     
    void SetPreviewType (MatPreviewType t)
     
    MatPreviewType GetPreviewType ()
     
    void SetUserPreviewSceneName (const String &strName)
     
    String GetUserPreviewSceneName ()
     
    void SetPreviewSize (MatPreviewSize s)
     
    MatPreviewSize GetPreviewSize ()
     
    void SetObjectMatrix (const Matrix &m)
     
    Bool GetObjectMatrix (Matrix &m)
     
    void ClearObjectMatrix ()
     
    Float GetWorldSize ()
     
    void SetWorldSize (Float r)
     
    Float GetPreviewStartTime ()
     
    void SetPreviewStartTime (Float r)
     
    void GetEnvironment (Vector &col, Float &strength)
     
    void SetEnvironment (const Vector &col, const Float &strength)
     
    Int32 GetDirtyCount ()
     
    Bool GetRegion (Float &l, Float &t, Float &r, Float &b)
     
    void SetRegion (Bool bActive, Float l, Float t, Float r, Float b)
     
    Int32 GetPreviewChannel ()
     
    void SetPreviewChannel (Int32 lChannel)
     
    Int32 GetReflectionLayer ()
     
    void SetReflectionLayer (Int32 lLayer)
     

    Private Member Functions

     MaterialPreviewData ()
     
     ~MaterialPreviewData ()
     

    Init

    Bool Init (BaseChannel *pChannel, Int32 lCount)
     
    Bool Init (BaseShader *pShader, Int32 lCount)
     
    Bool Init (BaseMaterial *pMaterial, Int32 lCount)
     
    Bool Init (BaseBitmap *pImage, Int32 lCount)
     

    Detailed Description

    Material preview data type (CUSTOMDATATYPE_MATPREVIEW) for MaterialPreviewCustomGui.

    Constructor & Destructor Documentation

    ◆ MaterialPreviewData()

    MaterialPreviewData ( )
    private

    ◆ ~MaterialPreviewData()

    ~MaterialPreviewData ( )
    private

    Member Function Documentation

    ◆ Init() [1/4]

    Bool Init ( BaseChannel pChannel,
    Int32  lCount 
    )

    Initializes the material preview with pChannel.

    Parameters
    [in]pChannelThe initial preview source. The caller owns the pointed channel.
    [in]lCountThe dirty count. Used to detect changes.
    Returns
    true if successful, otherwise false.

    ◆ Init() [2/4]

    Bool Init ( BaseShader pShader,
    Int32  lCount 
    )

    Initializes the material preview with pShader.

    Parameters
    [in]pShaderThe initial preview source. The caller owns the pointed shader.
    [in]lCountThe dirty count. Used to detect changes.
    Returns
    true if successful, otherwise false.

    ◆ Init() [3/4]

    Bool Init ( BaseMaterial pMaterial,
    Int32  lCount 
    )

    Initializes the material preview with pMaterial.

    Parameters
    [in]pMaterialThe initial preview source. The caller owns the pointed material.
    [in]lCountThe dirty count. Used to detect changes.
    Returns
    true if successful, otherwise false.

    ◆ Init() [4/4]

    Bool Init ( BaseBitmap pImage,
    Int32  lCount 
    )

    Initializes the material preview with pImage.

    Parameters
    [in]pImageThe initial preview source. The caller owns the pointed bitmap.
    [in]lCountThe dirty count. Used to detect changes.
    Returns
    true if successful, otherwise false.

    ◆ AnimatePreview()

    void AnimatePreview ( Bool  bAnimate)

    Sets the preview animation state.

    Parameters
    [in]bAnimateThe new animation state.

    ◆ PreviewIsAnimated()

    Bool PreviewIsAnimated ( )

    Checks the preview animation state.

    Returns
    The preview animation state.

    ◆ SetPreviewType()

    void SetPreviewType ( MatPreviewType  t)

    Sets the preview type.

    Parameters
    [in]tThe new preview type: MatPreviewType

    ◆ GetPreviewType()

    MatPreviewType GetPreviewType ( )

    Checks the preview type.

    Returns
    The preview type: MatPreviewType

    ◆ SetUserPreviewSceneName()

    void SetUserPreviewSceneName ( const String strName)

    Sets the user preview scene name.

    Parameters
    [in]strNameThe new user preview scene name.

    ◆ GetUserPreviewSceneName()

    String GetUserPreviewSceneName ( )

    Retrieves the user preview scene name.

    Returns
    The user preview scene name.

    ◆ SetPreviewSize()

    void SetPreviewSize ( MatPreviewSize  s)

    Sets the preview size.

    Parameters
    [in]sThe new preview size: MatPreviewSize

    ◆ GetPreviewSize()

    MatPreviewSize GetPreviewSize ( )

    Retrieves the preview size.

    Returns
    The preview size.

    ◆ SetObjectMatrix()

    void SetObjectMatrix ( const Matrix m)

    Sets the object matrix.

    Parameters
    [in]mThe new object matrix.

    ◆ GetObjectMatrix()

    Bool GetObjectMatrix ( Matrix m)

    Retrieves the object matrix.

    Parameters
    [out]mAssigned the object matrix, if not cleared.
    Returns
    true if successful, false if the object matrix is not initialized.

    ◆ ClearObjectMatrix()

    void ClearObjectMatrix ( )

    Clears the object matrix, i.e to an uninitialized state.

    ◆ GetWorldSize()

    Float GetWorldSize ( )

    Retrieves the world size.

    Returns
    The world size.

    ◆ SetWorldSize()

    void SetWorldSize ( Float  r)

    Sets the world size.

    Parameters
    [in]rThe new world size.

    ◆ GetPreviewStartTime()

    Float GetPreviewStartTime ( )

    Retrieves the preview start time.

    Returns
    The preview start time.

    ◆ SetPreviewStartTime()

    void SetPreviewStartTime ( Float  r)

    Sets the preview start time.

    Parameters
    [in]rThe new start time.

    ◆ GetEnvironment()

    void GetEnvironment ( Vector col,
    Float strength 
    )

    Gets the environment data.

    Parameters
    [out]colAssigned the environment color.
    [out]strengthAssigned the environment strength.

    ◆ SetEnvironment()

    void SetEnvironment ( const Vector col,
    const Float strength 
    )

    Sets the environment data.

    Parameters
    [in]colThe new environment color.
    [in]strengthThe new environment strength.

    ◆ GetDirtyCount()

    Int32 GetDirtyCount ( )

    Retrieves the dirty count for the preview.

    Returns
    The dirty count.

    ◆ GetRegion()

    Bool GetRegion ( Float l,
    Float t,
    Float r,
    Float b 
    )

    Retrieves the current selection region.

    Parameters
    [out]lAssigned the left boundary, between 0 and 1.
    [out]tAssigned the top boundary, between 0 and 1.
    [out]rAssigned the right boundary, between 0 and 1.
    [out]bAssigned the bottom boundary, between 0 and 1.
    Returns
    true if the region could be retrieved, otherwise false.

    ◆ SetRegion()

    void SetRegion ( Bool  bActive,
    Float  l,
    Float  t,
    Float  r,
    Float  b 
    )

    Sets a selection region in the preview.

    Parameters
    [in]bActiveDetermines if the rectangle is active or not.
    [in]lThe new left boundary, between 0 and 1.
    [in]tThe new top boundary, between 0 and 1.
    [in]rThe new right boundary, between 0 and 1.
    [in]bThe new bottom boundary, between 0 and 1.

    ◆ GetPreviewChannel()

    Int32 GetPreviewChannel ( )

    Retrieves the channel used for preview.

    Returns
    The channel: CHANNEL

    ◆ SetPreviewChannel()

    void SetPreviewChannel ( Int32  lChannel)

    Sets the channel used for preview.

    Parameters
    [in]lChannelThe new channel: CHANNEL

    ◆ GetReflectionLayer()

    Int32 GetReflectionLayer ( )

    Retrieves the reflection layer used for preview.

    Returns
    The reflection layer ID.

    ◆ SetReflectionLayer()

    void SetReflectionLayer ( Int32  lLayer)

    Sets the reflection layer used for preview.

    Parameters
    [in]lLayerThe new reflection layer ID.