/********************************************************************** *< FILE: TreeViewUtil.h DESCRIPTION: Includes for Plugins CREATED BY: HISTORY: *> Copyright (c) 2000, All Rights Reserved. **********************************************************************/ #ifndef __TREEVIEWUTIL__H #define __TREEVIEWUTIL__H #include "Max.h" #include "istdplug.h" #include "iparamb2.h" #include "iparamm2.h" #include "notify.h" #include "modstack.h" #include "macrorec.h" #include "utilapi.h" #include "iFnPub.h" extern TCHAR *GetString(int id); extern HINSTANCE hInstance; #define MAPCHANNELDELETE_CLASS_ID Class_ID(0x31f9c666, 0x3b4a555) #define MAPCHANNELPASTE_CLASS_ID Class_ID(0x31f9c666, 0x3b4a566) #define MAPCHANNELADD_CLASS_ID Class_ID(0x31f9c666, 0x3b4a577) #define SELECTBYCHANNEL_CLASS_ID Class_ID(0x31f9c666, 0x3b4a588) #define TREEVIEWUTIL_CLASS_ID Class_ID(0x4ae35082, 0x282bf350) #define TRIGEOMCHANNEL 1 #define TRIMAPCHANNEL 2 #define TRISELCHANNEL 3 #define POLYGEOMCHANNEL 4 #define POLYMAPCHANNEL 5 #define POLYSELCHANNEL 6 #define PATCHGEOMCHANNEL 7 #define PATCHMAPCHANNEL 8 #define PATCHSELCHANNEL 9 #define CHANNEL_GEOM 10 #define CHANNEL_SEL 11 #define CHANNEL_MAP 12 class UVWData { public: INode *node; int channelType; int channelID; int subID; int numOfDeadVerts; TSTR nodeName; TSTR channelName; int numVerts, numFaces; int numRealFaces; int kbsize; }; #define EMPTY 0 #define TRIMESH_GEOM 1 #define TRIMESH_MAP 2 #define TRIMESH_SEL 3 #define POLYMESH_GEOM 4 #define POLYMESH_MAP 5 #define POLYMESH_SEL 6 #define PATCHMESH_GEOM 7 #define PATCHMESH_MAP 8 #define PATCHMESH_SEL 9 class CopyBuffer { public: ~CopyBuffer() { Clear(); } int copyType; int subID; int numRealFaces; int numFaces; Tab w; Tab verts; Tab mnVerts; Tab uvwFaces; Tab geomFaces; Tab uvwMNFaces; Tab geomMNFaces; Tab uvwPatchFaces; Tab patchDeg; void Clear(); int pasteToChannelType; int pasteToChannel; int pasteToSubID; float mFalloff, mPinch, mBubble; int mEdgeDist, mUseEdgeDists, mAffectBackface, mUseSoftSelections; TSTR name; IOResult Save(ISave *isave); IOResult Load(ILoad *iload); void SetGeomMNFaceCount(int count); void SetMapMNFaceCount(int count); void Copy(CopyBuffer *from); }; class TreeViewUtil : public UtilityObj { public: HWND hPanel; IUtil *iu; Interface *ip; void BeginEditParams(Interface *ip,IUtil *iu); void EndEditParams(Interface *ip,IUtil *iu); void Init(HWND hWnd); void Destroy(HWND hWnd); void DeleteThis() { } //Constructor/Destructor TreeViewUtil(); ~TreeViewUtil(); void CreateNewFloater(); HWND floaterHWND; HWND listViewHWND; HTREEITEM hTRoot; Tab nodeList; void AddSelectedNodesToList(); LRESULT NotifyHandler( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); void InitListView(); void UpdateViewItems(); void AddListViewItems(); void InitWindow(); void DestroyWindow(); static void NotifyPreDeleteNode(void* param, NotifyInfo* arg); static void NotifySelectionChange(void* param, NotifyInfo*); BOOL lockSelection; BOOL collapse; BOOL subComponents; ICustButton* iLockButton; ICustButton* iClearButton; ICustButton* iNameButton; ICustButton* iCopyButton; ICustButton* iPasteButton; ICustButton* iAddButton; ICustButton* iSubCompButton; ICustButton* iCollapseButton; void DeleteChannel(INode *node, int mapID); void ShowRMenu(HWND hwnd, int x, int y) ; void UpdateUI(); void NameChannel(); void NameChannel(int whichChannel); void NameChannel(INode *node, int channelType, int channel, int subChannel, TCHAR *name); void AddNames(); TSTR channelName; CopyBuffer buffer; int GetSel(); void CopyToBuffer(int whichChannel); void CopyToBuffer(INode *node, int channelType, int channel, int subChannel); void PasteToNode(INode *node, int channelType, int channel, int subChannel); void PasteToNode(int whichChannel); void AddChannel(INode *node); void AddChannel(int whichChannel); void Collapse(); void Collapse(INode *node); int GetDeadGeomVerts(Mesh *msh); int GetDeadMapVerts(Mesh *msh, int mp); int GetDeadGeomVerts(MNMesh *msh); int GetDeadMapVerts(MNMesh *msh, int mp); int GetDeadGeomVerts(PatchMesh *msh); int GetDeadMapVerts(PatchMesh *msh, int mp); void AddMesh(Mesh *mesh, INode *node); void AddPoly(MNMesh *mesh, INode *node); void AddPatch(PatchMesh *mesh, INode *node); }; #endif // __TREEVIEWUTIL__H