Public Member Functions | Static Public Attributes

Interface11 Class Reference

Search for all occurrences

Detailed Description

Extends Interface10 Client code should retrieve this interface using GetCOREInterface11.

#include <maxapi.h>

Inheritance diagram for Interface11:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual HRESULT  OpenMAXStorageFile (const WCHAR *filename, IStorage **pIStorage)=0
  Attempt to open an existing max file as a structured storage file.
virtual BOOL  GetRendUseActiveView ()=0
  Returns TRUE if the rendering uses the active viewport, FALSE if locked on a viewport.
virtual void  SetRendUseActiveView (BOOL useActiveView)=0
  Sets whether the rendering uses the active viewport, or is locked on a viewport.
virtual int  GetRendViewIndex ()=0
  Returns the viewport index used, when the rendering is locked on a viewport.
virtual void  SetRendViewIndex (int i)=0
  Sets the viewport index used, when the rendering is locked on a viewport.
virtual int  GetRenderPresetMRUListCount ()=0
  Returns the number of render presets in the render dialog's most-recently-used render preset list.
virtual const MCHAR *  GetRenderPresetMRUListDisplayName (int i)=0
  Returns the display name of an entry in the render dialog's mostly-recently-used render preset list.
virtual const MCHAR *  GetRenderPresetMRUListFileName (int i)=0
  Returns the filename associated with an entry in the render dialog's mostly-recently-used render preset list.
virtual Matrix3  GetTransformGizmoTM () const =0
  Returns the world transform location of the current transform gizmo.
virtual void  DisplayViewportConfigDialogPage (int i)=0
  Popup the viewport configuration dialog with specified tab page.

Static Public Attributes

static CoreExport const
Interface_ID 
kInterface11InterfaceID
  The ID for this interface. Pass this ID to Interface::GetInterface to get an Interface11 pointer.

Member Function Documentation

virtual HRESULT OpenMAXStorageFile ( const WCHAR *  filename,
IStorage **  pIStorage 
) [pure virtual]

Attempt to open an existing max file as a structured storage file.

A max file is stored as a structured storage file. While the streams contain binary data not usable by developers, property values can be accessed through the standard structured storage property interfaces. These properties include those seen in the File/File Properties dialog.

Parameters:
[in] filename A pointer to the path of the null-terminated Unicode string file that contains the storage object. This string size cannot exceed MAX_PATH characters.
[out] pIStorage The address of an IStorage pointer variable that receives a pointer for an IStorage interface on the storage object opened; contains NULL if operation failed
Returns:
S_OK - Indicates that the storage object was opened successfully.

STG_E_INVALIDPOINTER - Indicates an invalid pointer in the pIStorage parameter.

E_NOINTERFACE - Indicates that the IStorage interface is not supported.

STG_E_INVALIDNAME - Indicates an invalid name in the filename parameter.

STG_E_LOCKVIOLATION - Indicates that access was denied because another caller has the file open and locked.

STG_E_SHAREVIOLATION - Indicates that access was denied because another caller has the file open and locked.

STG_E_ACCESSDENIED - Indicates that the file cannot be opened because the underlying storage device does not allow such access to the current user.

This function can also return any file system errors or Win32 errors wrapped in an HRESULT.
Sample Code:
The following is an example of accesing several properties through the standard structured storage property interfaces.

    IStorage*               pIStorage = NULL;
    IPropertySetStorage*    pPropertySetStorage = NULL;
    HRESULT res = GetCOREInterface11()->OpenMAXStorageFile(wfilename, &pIStorage);
    if (res!=S_OK)
        return;

    // Get the Storage interface
    if (S_OK != pStorage->QueryInterface(IID_IPropertySetStorage, (void**)&pPropertySetStorage)) {
        pStorage->Release();
        return;
        }

    // Get the SummaryInfo property set interface
    if (S_OK == pPropertySetStorage->Open(FMTID_SummaryInformation, STGM_READ|STGM_SHARE_EXCLUSIVE, &pSummaryInfoStorage)) {

        PROPSPEC    PropSpec[3];
        PROPVARIANT PropVar[3];

        PropSpec[0].ulKind = PRSPEC_PROPID;
        PropSpec[0].propid = PID_TITLE;

        PropSpec[1].ulKind = PRSPEC_PROPID;
        PropSpec[1].propid = PID_SUBJECT;

        PropSpec[2].ulKind = PRSPEC_PROPID;
        PropSpec[2].propid = PID_AUTHOR;

        HRESULT hr = pSummaryInfoStorage->ReadMultiple(3, PropSpec, PropVar);
        if (S_OK == hr) {
            if (PropVar[0].vt == VT_LPSTR)
                SendMessage(GetDlgItem(hPropDialog, IDC_TITLE), WM_SETTEXT, 0, (LPARAM)PropVar[0].pszVal);
            if (PropVar[1].vt == VT_LPSTR)
                SendMessage(GetDlgItem(hPropDialog, IDC_SUBJECT), WM_SETTEXT, 0, (LPARAM)PropVar[1].pszVal);
            if (PropVar[2].vt == VT_LPSTR)
                SendMessage(GetDlgItem(hPropDialog, IDC_AUTHOR), WM_SETTEXT, 0, (LPARAM)PropVar[2].pszVal);
            }

        FreePropVariantArray(3, PropVar);
        pSummaryInfoStorage->Release();
        }
    pStorage->Release();
    return;
virtual BOOL GetRendUseActiveView ( ) [pure virtual]

Returns TRUE if the rendering uses the active viewport, FALSE if locked on a viewport.

This corresponds to the lock button for the viewport dropdown in the render dialog.

virtual void SetRendUseActiveView ( BOOL  useActiveView ) [pure virtual]

Sets whether the rendering uses the active viewport, or is locked on a viewport.

This corresponds to the lock button for the viewport dropdown in the render dialog.

Parameters:
[in] useActiveView Pass TRUE to use the active viewport, FALSE to lock to a viewport
virtual int GetRendViewIndex ( ) [pure virtual]

Returns the viewport index used, when the rendering is locked on a viewport.

virtual void SetRendViewIndex ( int  i ) [pure virtual]

Sets the viewport index used, when the rendering is locked on a viewport.

If an invalid index is set, attempts to launch a render will fail and an error dialog will be displayed.

Parameters:
[in] i The viewport index
See also:
Interface7::getViewport
virtual int GetRenderPresetMRUListCount ( ) [pure virtual]

Returns the number of render presets in the render dialog's most-recently-used render preset list.

virtual const MCHAR* GetRenderPresetMRUListDisplayName ( int  i ) [pure virtual]

Returns the display name of an entry in the render dialog's mostly-recently-used render preset list.

If an invalid index is passed, it will wrap around to a valid index, since the MRU list contains a fixed number of items.

Parameters:
[in] i The index within the most-recently-used render preset list
virtual const MCHAR* GetRenderPresetMRUListFileName ( int  i ) [pure virtual]

Returns the filename associated with an entry in the render dialog's mostly-recently-used render preset list.

If an invalid index is passed, it will wrap around to a valid index, since the MRU list contains a fixed number of items.

Parameters:
[in] i The index within the most-recently-used render preset list
virtual Matrix3 GetTransformGizmoTM ( ) const [pure virtual]

Returns the world transform location of the current transform gizmo.

Returns the world transform of the current transform gizmo in the active viewport.

Returns:
The world transform of the transform gizmo in the active viewport.
virtual void DisplayViewportConfigDialogPage ( int  i ) [pure virtual]

Popup the viewport configuration dialog with specified tab page.

If an invalid index is passed, the dialog will show the first tab page when it starts up.

Parameters:
[in] i The index of the tab page that to be showed on the dialog starts up

Member Data Documentation

CoreExport const Interface_ID kInterface11InterfaceID [static]

The ID for this interface. Pass this ID to Interface::GetInterface to get an Interface11 pointer.


Interface11 Interface11 Interface11 Interface11 Interface11 Interface11 Interface11 Interface11 Interface11 Interface11
Interface11 Interface11 Interface11 Interface11 Interface11 Interface11 Interface11 Interface11 Interface11 Interface11