3ds Max C++ API Reference
Loading...
Searching...
No Matches
ICatRegistry Class Referenceabstract

This class makes it possible to get and set the category field (order number) for rollups in the RollupOrder.cfg file. More...

#include <C:/adskgit/3dsmax/3dsmax/3dswin/src/maxsdk/include/irollupsettings.h>

Inheritance diagram for ICatRegistry:

Public Member Functions

virtual ~ICatRegistry ()
 Destructor.
virtual int GetCat (SClass_ID sid, Class_ID cid, const MCHAR *title, int category, bool *open=nullptr, const MCHAR *context=nullptr) const =0
 This method gets the category (order field) for the given SuperClass ID, ClassID and Rollup Title (and optional Context).
virtual void UpdateCat (SClass_ID sid, Class_ID cid, const MCHAR *title, int category, const bool *open=nullptr, const MCHAR *context=nullptr)=0
 This method updates (sets) the category (order field) for the given SuperClass ID, ClassID and Rollup Title (and optional Context).
virtual void Save ()=0
 This method Saves the category settings in File "UI\RollupOrder.cfg".
virtual void Load ()=0
 This method Loads the category settings from File "UI\RollupOrder.cfg".
virtual void EmptyRegistry ()=0
 This method Erases all category settings (in memory only)
virtual void DeleteList (SClass_ID sid, Class_ID cid, const MCHAR *context=nullptr, bool deleteContexts=false)=0
 This method deletes a category list for a given superclass ID, class ID and context.

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.

Detailed 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 like this:

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:75
virtual void UpdateCat(SClass_ID sid, Class_ID cid, const MCHAR *title, int category, const bool *open=nullptr, const MCHAR *context=nullptr)=0
This method updates (sets) the category (order field) for the given SuperClass ID,...
class IRollupPanel : public InterfaceServer
Definition custcont.h:1763
virtual int GetCategory()=0
virtual HWND GetTitleWnd()=0
virtual ICatRegistry * GetCatReg()=0
This method returns a pointer to the category registry.
IRollupSettings * GetIRollupSettings()
Definition irollupsettings.h:148
ulong SClass_ID
Definition maxtypes.h:124
#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 SClassID and ClassID. The structure of the RollupOrder.cfg file (and thus CatRegistry) can be seen as a list of items that represent the rollup order for each particular group. A group is identified by a SClassID and a ClassID.

In 3dsMax 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 SClassID 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
No ClassDesc has to exist for a dummy ClassID. The RollupOrder.cfg file will indicate "No ClassName" in case a dummy class id is used.
See also
IRollupSettings, IRollupWindow, IRollupCallback

Constructor & Destructor Documentation

◆ ~ICatRegistry()

virtual ~ICatRegistry ( )
inlinevirtual

Destructor.

95{;}

Member Function Documentation

◆ GetCat()

virtual int GetCat ( SClass_ID sid,
Class_ID cid,
const MCHAR * title,
int category,
bool * open = nullptr,
const MCHAR * context = nullptr ) const
pure virtual

This method gets the category (order field) for the given SuperClass ID, ClassID and Rollup Title (and optional Context).

Parameters
sidThe superclass ID.
cidThe class ID.
titleThe rollup title.
categoryThis is used for error checking; it becomes the default value returned 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.
openOptional pointer to a boolean receiving the open/close state of the rollup. If the open/close value was not stored, it does not modify the boolean.
contextAn optional context, can be used to specify a special rollup ordering based on e.g. specific sub-object selection.
Returns
The category (order field) for the given SuperClass ID, ClassID and context, or the default value if there is no stored value for the given combination.
See also
UpdateCat

◆ UpdateCat()

virtual void UpdateCat ( SClass_ID sid,
Class_ID cid,
const MCHAR * title,
int category,
const bool * open = nullptr,
const MCHAR * context = nullptr )
pure virtual

This method updates (sets) the category (order field) for the given SuperClass ID, ClassID and Rollup Title (and optional Context).

Parameters
sidThe superclass ID.
cidThe class ID.
titleThe rollup title.
categoryThe category.
openOptional pointer to the open/close state of the rollup.
contextOptional context, can be used to specify a special order based on e.g. specific sub-object selection.
See also
GetCat

◆ Save()

virtual void Save ( )
pure virtual

This method Saves the category settings in File "UI\RollupOrder.cfg".

See also
Load

◆ Load()

virtual void Load ( )
pure virtual

This method Loads the category settings from File "UI\RollupOrder.cfg".

See also
Save

◆ EmptyRegistry()

virtual void EmptyRegistry ( )
pure virtual

This method Erases all category settings (in memory only)

◆ DeleteList()

virtual void DeleteList ( SClass_ID sid,
Class_ID cid,
const MCHAR * context = nullptr,
bool deleteContexts = false )
pure virtual

This method deletes a category list for a given superclass ID, class ID and context.

Parameters
sidThe superclass ID.
cidThe class ID.
contextOptional context.
deleteContextsIf true, all contexts for the given superclass ID and class ID are deleted. Only used if context is a nullptr.