deargui-vpl/ref/virtools/Samples/Behaviors/SelectionSetManager/Set_Enums.h

128 lines
4.1 KiB
C++

#ifndef _SET_ENUMS_H_
#define _SET_ENUMS_H_
#include "set_utils.h"
/*
#ifdef CK_LIB
#ifdef SELECTIONSETMANAGER_EXPORTS
#define SELECTIONSETMANAGER_CLASS_DECL __declspec(dllexport)
#else
#define SELECTIONSETMANAGER_CLASS_DECL __declspec(dllimport)
#endif
#else
*/
#define SELECTIONSETMANAGER_CLASS_DECL
class SelectionSetManager;
class CKStateChunk;
enum ESetFieldChange
{
eSetField_Toggle = -1, //toggle flag
eSetField_Remove = 0, //remove flag
eSetField_Add = 1, //add flag
};
enum ESetLoadResult //result for LoadSelectionSet function
{
eSetLoad_InvalidParameter = -2,
eSetLoad_Failed = -1,
eSetLoad_Success = 0,
eSetLoad_WebDownload = 1,
};
enum FSetPart
{
fSetPart_Name = 1,
fSetPart_Priority = 1<<1,
fSetPart_Options = 1<<2,
#ifdef SELECTIONSET_USE_DEPENDENCIES
fSetPart_Dependencies = 1<<3,
#else
fSetPart_LoadState = 1<<3,
#endif
fSetPart_Path = 1<<4,
fSetPart_SourceControl = 1<<5,
fSetPart_Content = 1<<6,
fSetPart_RebuildHierarchy = 1<<7,
fSetPart_LoadWithCmo = 1<<8,
fSetPart_SaveWithCmo = 1<<9,
fSetPart_LoadMode = 1<<10,
//other flags used for CUIK_NOTIFICATION_SELECTIONSETS_MODIFIED
fSetPart_LastSaved = 1<<30,
fSetPart_All = 0x0ffffffff - fSetPart_LastSaved,
};
////////////////////////////////////////////////////////////////////////////////
// Data associated with a selection set, saved with cmo & not the nmos generated for external sets
////////////////////////////////////////////////////////////////////////////////
#ifdef LUA_SPECIFIC
enum FSetFlags
{
fSetFlags_UseGlobalOptions = 0,
fSetFlags_IgnoreAndNoShare = 0,
fSetFlags_ForceSaveAsExternal = 1<<0, //override global pref reference/in
fSetFlags_ForceSaveAsInternal = 1<<1,
fSetFlags_RebuildHierarchy = 1<<2, //rebuild hierarchy (reattach to parent) on load, if parent of objects in nmo set are outside the nmo
fSetFlags_LoadWithCmo = 1<<3, //load this set on cmo load
fSetFlags_SaveWithCmo = 1<<4, //save this set on cmo save
fSetFlags_ReplaceAndShare = 1<<5, //default is IgnoreAndNoShare
fSetFlags_Loaded = 1<<6, //loaded or not
fSetFlags_Temp_Recreated = 1<<30, //this set has been resaved without the group thus need a additionnal notif to tell the view to update the group after objects have been added again to it
fSetFlags_Temp_External = 1<<31, //this set is going to be saved as external / has been saved as external
fSetFlags_Temp_NotToSave = fSetFlags_Temp_Recreated + fSetFlags_Loaded,
};
#endif
struct SELECTIONSETMANAGER_CLASS_DECL SelectionSetData
{
//Flags functions...
SET_DECLARE_FLAGS(m_Flags);
XString m_Name;
XString m_Path;
int m_Priority;
#ifdef SELECTIONSET_USE_DEPENDENCIES
CKDependencies m_SaveDependencies;
#endif
SelectionSetData(): m_Flags(fSetFlags_LoadWithCmo|fSetFlags_SaveWithCmo),m_Priority(0) {}
//Selection Set Flags
#ifndef LUA_SPECIFIC
enum FSetFlags
{
fSetFlags_UseGlobalOptions = 0,
fSetFlags_IgnoreAndNoShare = 0,
fSetFlags_ForceSaveAsExternal = 1<<0, //override global pref reference/in
fSetFlags_ForceSaveAsInternal = 1<<1,
fSetFlags_RebuildHierarchy = 1<<2, //rebuild hierarchy (reattach to parent) on load, if parent of objects in nmo set are outside the nmo
fSetFlags_LoadWithCmo = 1<<3, //load this set on cmo load
fSetFlags_SaveWithCmo = 1<<4, //save this set on cmo save
fSetFlags_ReplaceAndShare = 1<<5, //default is IgnoreAndNoShare
fSetFlags_Loaded = 1<<6, //loaded or not
fSetFlags_Temp_Recreated = 1<<30, //this set has been resaved without the group thus need a additionnal notif to tell the view to update the group after objects have been added again to it
fSetFlags_Temp_External = 1<<31, //this set is going to be saved as external / has been saved as external
fSetFlags_Temp_NotToSave = fSetFlags_Temp_Recreated + fSetFlags_Loaded,
};
#endif
//to call before saving set, modify the flags with fSetFlags_Temp_External is external
//(according to preference + current flag)
BOOL CheckSaveExternal(SelectionSetManager* iSetMgr);
//load set data from chunk
BOOL LoadDataFromChunk(CKStateChunk* iChunk,int iVersion);
//save set data in chunk
BOOL SaveDataInChunk(CKStateChunk* iChunk);
};
#endif