iADTCategory.h

Go to the documentation of this file.
00001      /**********************************************************************
00002  
00003     FILE: IADTCategory.h
00004 
00005     DESCRIPTION:  Public intefaces that defines the concept of ADT Styles
00006 
00007     CREATED BY: Attila Szabo, Discreet
00008 
00009     HISTORY: - created Sep 29, 2002
00010 
00011  *> Copyright (c) 1998-2002, All Rights Reserved.
00012  **********************************************************************/
00013 
00014 #pragma once
00015 #include "ref.h"
00016 #include "iFnPub.h"
00017 #include "maxtypes.h"
00018 
00019 
00020 // Forward declarations
00021 class IADTStyle;
00022 
00023 // This interface models an ADT Object category that has styles
00024 // Categories can be created and destroyed via the ADT Object Manager 
00025 // Styles are added and deleted to\from categories by the ADT Object Manager
00026 // methods in order to ensure consistency of the data.
00027 //
00028 // Categories should be created and destroyed through the ADT Object Manager 
00029 // See IADTStyle* GetStyle(const MCHAR* pCategName, const MCHAR* pStyleName);
00030 // An ADT Category is destroyed by the object manager when there are no styles
00031 // that is references. See iADTObjMgr for more details
00032 class IADTCategory : public ReferenceTarget, public FPMixinInterface 
00033 {
00034     public:
00035       using ReferenceTarget::GetInterface;
00036     
00037     // Access to name. The name is not case sensitive.
00038         virtual const MCHAR* GetName() const = 0;
00039         virtual void SetName(const MCHAR* pName) = 0;
00040 
00041     // Returns NULL if the style does not exist
00042         virtual IADTStyle* FindStyle(const MCHAR* pStyleName) const = 0;
00043         
00044     // TODO: styles iteration
00045         virtual unsigned long NumStyles() const = 0;
00046         virtual unsigned long GetStyles(Tab<IADTStyle*>& styles) const = 0;
00047 
00048         // Returns the number of all nodes in the scene that represent instances of
00049     // all the styles that belong to this category. 
00050     virtual unsigned long NumInstances() const = 0;
00051 
00052         // Fills out the provided array with all the nodes in the scene that represent 
00053     // instances of all the styles that belong to this category. Returns their count
00054         virtual unsigned long GetInstances(Tab<INode*>& instances) const = 0;
00055 
00056         // Creates a name that is unique among the style names and it's 
00057         // based on the given name. The unique name is seeded by passing in a seed-name
00058         // through the MSTR&
00059         // - MSTR& - Input\Output parameter. As input parameter, it represents a seed
00060         // for the the unique name. As output parameter, it holds the unique name that 
00061         // was generated
00062         virtual void MakeUniqueStyleName(MSTR& name) const = 0;
00063 }; 
00064 
00065 #define ADT_CATEGORY_INTERFACE Interface_ID(0x41030580, 0x7bce1c46)
00066 inline IADTCategory* GetADTCategoryInterface(BaseInterface* baseIfc)    
00067 { 
00068     DbgAssert( baseIfc != NULL); 
00069     return static_cast<IADTCategory*>(baseIfc->GetInterface(ADT_CATEGORY_INTERFACE)); 
00070 }
00071