Public Member Functions

ISubMap Class Reference

Search for all occurrences

Detailed Description

See also:
Class MtlBase, Class Texmap, Class ParamDlg, Class ReferenceTarget.

Description:
This class is available in release 4.0 and later only.

The methods of this class provide access to the sub-textures of a MtlBase. These properties include the number of sub-maps, the slot type, on / off state, etc.

The MtlBase class sub-classes from this class. If a developer is creating a plug-in derived from MtlBase (for instance a Material or Texture) then implementations of these methods are required. Developers may call these methods on an existing MtlBase sub-class.

#include <imtl.h>

Inheritance diagram for ISubMap:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual  ~ISubMap ()
virtual int  NumSubTexmaps ()
virtual Texmap GetSubTexmap (int i)
virtual int  MapSlotType (int i)=0
virtual void  SetSubTexmap (int i, Texmap *m)
virtual int  SubTexmapOn (int i)
virtual CoreExport MSTR  GetSubTexmapSlotName (int i)
CoreExport MSTR  GetSubTexmapTVName (int i)
virtual BOOL  SetDlgThing (ParamDlg *dlg)
CoreExport void  CopySubTexmap (HWND hwnd, int ifrom, int ito)
virtual ReferenceTarget GetRefTarget ()=0

Constructor & Destructor Documentation

virtual ~ISubMap ( ) [inline, virtual]
Remarks:
Destructor.
{;}

Member Function Documentation

virtual int NumSubTexmaps ( ) [inline, virtual]
Remarks:
Returns the number of sub-textures managed by this material or texture.
Default Implementation:
{ return 0; }

Reimplemented in MSCustAttrib, MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.

{ return 0; }
virtual Texmap* GetSubTexmap ( int  i ) [inline, virtual]
Remarks:
Returns a pointer to the 'i-th' sub-texmap managed by the material or texture.

Note: For the 3ds Max Standard material, the sub-texmap indexes used with this method are listed in Texture Map Indices.
Parameters:
int i

Specifies the texmap to return.
Default Implementation:
{ return NULL; }

Reimplemented in MSCustAttrib, MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.

{ return NULL; }
virtual int MapSlotType ( int  i ) [pure virtual]
Remarks:
In the Coordinates rollup in the user interface for a texture map are two options. These options are Texture or Environment. The slot type is one of these two options, texture coordinates or environment coordinates. There are a variety of texture coordinate types. There are the type assigned to the object and the environment type (Spherical, Cylindrical, Shrink-wrap, Screen). This method is used to determine the type required by the particular sub-texture. This is either texture coordinates (MAPSLOT_TEXTURE) or environment coordinates (MAPSLOT_ENVIRON).
Parameters:
int i

The index of the sub-texture whose slot type to return.
Returns:
See Map Slot Types.
Default Implementation:
{ return MAPSLOT_TEXTURE; }

Implemented in MtlBase, Texmap, and MSCustAttrib.

virtual void SetSubTexmap ( int  i,
Texmap m 
) [inline, virtual]
Remarks:
Stores the 'i-th' sub-texmap managed by the material or texture.

Note: For the 3ds Max Standard material, the sub-texmap indexes used with this method are listed in Texture Map Indices.
Parameters:
int i

The index of the storage for the texmap.

Texmap *m

The texmap to store.
Default Implementation:
{}

Reimplemented in MSCustAttrib, MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.

{ }
virtual int SubTexmapOn ( int  i ) [inline, virtual]
Remarks:
Returns nonzero if the specified sub-texmap is on; otherwise zero. Some materials may have user interface controls to toggle the sub-maps on and off. The Standard material has such controls for example.
Parameters:
int i

The index of the sub-texmap to check.
Default Implementation:
{ return 1; }
{ return 1; } 
virtual CoreExport MSTR GetSubTexmapSlotName ( int  i ) [virtual]
Remarks:
This method returns the slot name of the 'i-th' sub-texmap. This name appears in the materials editor dialog. For instance, if you are in a material and then you go down into a map, this is the name that appears just below the 'Get Material' icon. For example, in the Standard material when you choose one of the maps, the map name appears to let you know which slot you are working on. For the Standard material, this may be "Ambient", "Diffuse", "Specular", etc.
Parameters:
int i

Specifies the slot whose name is returned.
Default Implementation:
The default implementation returns an empty ("") string.

Reimplemented in MSCustAttrib, MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.

CoreExport MSTR GetSubTexmapTVName ( int  i )
Remarks:
Returns the name to appear in Track View of the 'i-th' sub-texmap.
Parameters:
int i

Specifies the sub-texmap whose name is returned.

Reimplemented in MSCustAttrib, MSPluginTexmap, and MSPluginMtl.

virtual BOOL SetDlgThing ( ParamDlg dlg ) [inline, virtual]
Remarks:
This method is called by the ParamMap2 AUTO_UI system if the material/texmap is letting the system build an AutoMParamDlg for it. This method is called on a material/texmap coming into an existing set of ParamDlgs, once for each secondary ParamDlg and it should set the appropriate 'thing' into the given dlg (the 'thing' being, for example, a Texout* or UVGen*). Return FALSE if dlg is unrecognized.

Note: See the discussion above in CreateParamDlg() for additional details on this method.
Parameters:
ParamDlg* dlg

Points to the ParamDlg to check. See Class ParamDlg.
Returns:
TRUE if the dlg passed is recognized; FALSE if unrecognized.
Default Implementation:
{ return FALSE; }
Sample Code:
    BOOL Gradient::SetDlgThing(ParamDlg* dlg)
    {
    if (dlg == uvGenDlg)
    uvGenDlg->SetThing(uvGen);
    else if (dlg == texoutDlg)
    texoutDlg->SetThing(texout);
    else
    return FALSE;
    return TRUE;
    }
{ return FALSE; }
CoreExport void CopySubTexmap ( HWND  hwnd,
int  ifrom,
int  ito 
)
Remarks:
Implemented by the System.

This method is used to handle the drag-and-drop of texmaps. A developer implements the logic to handle the drag and drop. Once they have the information about what slot was dropped on what other slot, this method may be called to handle the copying. This is used by the 3ds Max Standard material.
Parameters:
HWND hwnd

The rollup page window handle.

int ifrom

The source texmap.

int ito

The destination texmap.
virtual ReferenceTarget* GetRefTarget ( ) [pure virtual]
Remarks:
Implemented by the System.

The implementation of this method is provided by MtlBase. It returns its this pointer.

Implemented in MtlBase, MSCustAttrib, MSPluginTexmap, MSTexmapXtnd, MSPluginMtl, and MSMtlXtnd.


ISubMap ISubMap ISubMap ISubMap ISubMap ISubMap ISubMap ISubMap ISubMap ISubMap
ISubMap ISubMap ISubMap ISubMap ISubMap ISubMap ISubMap ISubMap ISubMap ISubMap