3ds Max C++ API Reference
ICatRegistry Class Referenceabstract

#include <irollupsettings.h>

+ Inheritance diagram for ICatRegistry:

Public Member Functions

virtual ~ICatRegistry ()
 
virtual int GetCat (SClass_ID sid, Class_ID cid, const MCHAR *title, int category)=0
 
virtual void UpdateCat (SClass_ID sid, Class_ID cid, const MCHAR *title, int category)=0
 
virtual void Save ()=0
 
virtual void Load ()=0
 
virtual void EmptyRegistry ()=0
 
virtual void DeleteList (SClass_ID sid, Class_ID cid)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

See also
Class IRollupSettings, Class IRollupWindow, Class IRollupCallback

Description:
This class makes it possible to get and set the category field (order number) for rollups in the RollupOrder.cfg file. Normally a developer would use this class in order to store the order of rollout panels as a result of a custom handled Drag and Drop operation (see IRollupWindow::HandleRollupCallback() and IRollupCallback::HandleDrop()). First it is necessary to loop through all rollup panels and update the category field in the ICatRegistry

void TaskRollupManager::UpdateCats()
{
for(int i = 0 ; i < GetNumPanels() ; i++) {
IRollupPanel *panel = GetPanel(GetPanelDlg(i));
Class_ID cid;
SClass_ID sid;
if(GetEditObjClassID(sid,cid)) {
MCHAR title[256];
GetWindowText(panel->GetTitleWnd(), title, 255);
GetIRollupSettings()->GetCatReg()->UpdateCat(sid,cid, title, panel->GetCategory());
}
}
}
Definition: maxtypes.h:67
virtual void UpdateCat(SClass_ID sid, Class_ID cid, const MCHAR *title, int category)=0
class IRollupPanel : public InterfaceServer
Definition: custcont.h:1742
virtual int GetCategory()=0
virtual HWND GetTitleWnd()=0
virtual ICatRegistry * GetCatReg()=0
IRollupSettings * GetIRollupSettings()
Definition: irollupsettings.h:142
ulong SClass_ID
Definition: maxtypes.h:116
#define MCHAR
MBCS/Unicode helper defines std::wofstream doesn't mix well with Unicode.
Definition: strbasic.h:42
UtilExport MSTR GetWindowText(HWND hDlg, int nIDDlgItem)
Returns an window's text as a MSTR.
After that the ICatRegistry has to be saved with

GetIRollupSettings()->GetCatReg()->Save();

In order to reset the rollup order, one has to call ICatRegistry::DeleteList() for a given superclassid and classid. The structure of the RollupOrder.cfg file (and thus CatRegistry) can be seen as list of items that represent the rollup order for each particular group. A group is identified by a super classid and a classid.

In 3ds Max we can have different possibilities to store the order of rollups. In the Create and Modify Panel we want to store the order of rollups for the currently edited object, which can be an object, or a modifier. Thus the classid and superclassid of the group is the one of the currently edited object. For the Display panel however, we want the rollups to be the same no matter which object is currently selected. To do this, we create a dummy classid which represents the display panel and store the rollup orders under this dummy classid. This classid is identified by the method IRollupCallback::GetEditObjClassID(). Note, that no classddesc has to exist for a dummy classid. The RollupOrder.cfg file will indicate "No ClassName" in case a dummy class id is used.

Constructor & Destructor Documentation

◆ ~ICatRegistry()

virtual ~ICatRegistry ( )
inlinevirtual
Remarks
Destructor.
90 {;}

Member Function Documentation

◆ GetCat()

virtual int GetCat ( SClass_ID  sid,
Class_ID  cid,
const MCHAR title,
int  category 
)
pure virtual
Remarks
This method gets the category (order field) for the given SuperClass ID, ClassID and Rollup Title.
Parameters:
SClass_ID sid

The superclass ID.

Class_ID cid

The class ID.

MCHAR *title

The rollup title.

int category

`This is used for error checking; it becomes the default value retured by the function if the call fails. So if you pass -1000 and get a return value of -1000, that means the entry was not found.

◆ UpdateCat()

virtual void UpdateCat ( SClass_ID  sid,
Class_ID  cid,
const MCHAR title,
int  category 
)
pure virtual
Remarks
This method updates (sets) the category (order field) for the given SuperClass ID, ClassID and Rollup Title
Parameters:
SClass_ID sid

The superclass ID.

Class_ID cid

The class ID.

MCHAR *title

The rollup title.

int category

The category.

◆ Save()

virtual void Save ( )
pure virtual
Remarks
This method Saves the category settings in File UI/RollupOrder.cfg

◆ Load()

virtual void Load ( )
pure virtual
Remarks
This method Loads the category settings from File UI/RollupOrder.cfg

◆ EmptyRegistry()

virtual void EmptyRegistry ( )
pure virtual
Remarks
This method Erases all category settings (in memory only)

◆ DeleteList()

virtual void DeleteList ( SClass_ID  sid,
Class_ID  cid 
)
pure virtual
Remarks
This method deletes a category list for a given superclass ID and class ID.
Parameters:
SClass_ID sid

The superclass ID.

Class_ID cid

The class ID.