frontend.h

Go to the documentation of this file.
00001 /*********************************************************************
00002  *<
00003     FILE: frontend.h
00004 
00005     DESCRIPTION: A new plug-in type that controls the main UI for MAX
00006 
00007     CREATED BY: Rolf Berteig
00008 
00009     HISTORY: 4/01/97
00010 
00011  *> Copyright (c) 1997, All Rights Reserved.
00012  **********************************************************************/
00013 
00014 #pragma once
00015 #include "maxheap.h"
00016 #include <WTypes.h>
00017 #include "custcont.h"
00018 
00019 // layout bits
00020 #define FE_LAYOUT_NO_TIMESLIDER         (1<<0)
00021 #define FE_LAYOUT_NO_TOOLBAR            (1<<1)
00022 #define FE_LAYOUT_NO_COMMAND_PANEL      (1<<2)
00023 #define FE_LAYOUT_CONTROL_COMMAND_PANEL (1<<3)
00024 #define FE_LAYOUT_DEFAULT               0
00025 
00026 
00027 // Tool bar buttons
00028 #define TOOLBUT_HELP                0
00029 #define TOOLBUT_UNDO                1
00030 #define TOOLBUT_REDO                2
00031 #define TOOLBUT_LINK                3
00032 #define TOOLBUT_UNLINK              4
00033 #define TOOLBUT_SPACEWARP_BIND      5
00034 #define TOOLBUT_SELECT              6
00035 #define TOOLBUT_REGION_TYPE         7
00036 #define TOOLBUT_SELECT_FILTER       8
00037 #define TOOLBUT_SELECT_BYNAME       9
00038 #define TOOLBUT_MOVE                10
00039 #define TOOLBUT_ROTATE              11
00040 #define TOOLBUT_SCALE               12
00041 #define TOOLBUT_REF_COORDSYS        13
00042 #define TOOLBUT_REF_CENTER          14
00043 #define TOOLBUT_CONST_X             15
00044 #define TOOLBUT_CONST_Y             16
00045 #define TOOLBUT_CONST_Z             17
00046 #define TOOLBUT_CONST_PLANE         18
00047 #define TOOLBUT_IK                  19
00048 #define TOOLBUT_MIRROR              20
00049 #define TOOLBUT_ARRAY               21
00050 #define TOOLBUT_ALIGN               22
00051 #define TOOLBUT_NAMED_SELSETS       23
00052 #define TOOLBUT_TRACKVIEW           24
00053 #define TOOLBUT_MEDIT               25
00054 #define TOOLBUT_RENDER              26
00055 #define TOOLBUT_QUICK_RENDER        27
00056 #define TOOLBUT_RENDER_LAST         29
00057 #define TOOLBUT_SEPERATOR           30
00058 #define TOOLBUT_LAYER_CURRENT       31
00059 #define TOOLBUT_LAYER_PROP          32
00060 #define TOOLBUT_LAYER_CONTROL       33
00061 #define TOOLBUT_LAYER_OBJ_PROP      34
00062 #define TOOLBUT_MEASURE             35
00063 #define TOOLBUT_SCHEMATIC_VIEW      36
00064 #define TOOLBUT_RENDER_PRESETS      37
00065 #define TOOLBUT_SHOW_VFB            38
00066 
00067 // Standard MAX tool buttons use IDs greater then this value.
00068 // FE plug-in tool buttons should use IDs less then this max value
00069 // and greater then this min value.
00070 // Note that the actual resource IDs for standard MAX buttons will
00071 // be converted to the above #defines when passed to ProcessToolButton().
00072 #define MIN_FE_CUSTOM_TOOLID        1000
00073 #define MAX_FE_CUSTOM_TOOLID        30000
00074 
00075 
00076 // Menu items
00077 #define MENUITEM_FILE_NEW                       0
00078 #define MENUITEM_FILE_RESET                     1
00079 #define MENUITEM_FILE_OPEN                      2
00080 #define MENUITEM_FILE_MERGE                     3
00081 #define MENUITEM_FILE_REPLACE                   4
00082 #define MENUITEM_FILE_INSERTTRACKS              5
00083 #define MENUITEM_FILE_SAVE                      6
00084 #define MENUITEM_FILE_SAVEAS                    7
00085 #define MENUITEM_FILE_SAVESELECTED              8
00086 #define MENUITEM_FILE_IMPORT                    9
00087 #define MENUITEM_FILE_EXPORT                    10
00088 #define MENUITEM_FILE_ARCHIVE                   11
00089 #define MENUITEM_FILE_SUMMARYINFO               12
00090 #define MENUITEM_FILE_VIEWFILE                  13
00091 #define MENUITEM_FILE_CONFIGUREPATHS            14
00092 #define MENUITEM_FILE_PREFERENCES               15
00093 #define MENUITEM_FILE_EXIT                      16
00094 
00095 #define MENUITEM_EDIT_UNDO                      17
00096 #define MENUITEM_EDIT_REDO                      18
00097 #define MENUITEM_EDIT_HOLD                      19
00098 #define MENUITEM_EDIT_FETCH                     20
00099 #define MENUITEM_EDIT_DELETE                    21
00100 #define MENUITEM_EDIT_CLONE                     22
00101 #define MENUITEM_EDIT_SELECTALL                 23
00102 #define MENUITEM_EDIT_SELECTNONE                24
00103 #define MENUITEM_EDIT_SELECTINVERT              25
00104 #define MENUITEM_EDIT_SELECTBY_COLOR            26
00105 #define MENUITEM_EDIT_SELECTBY_MATERIAL         27
00106 #define MENUITEM_EDIT_SELECTBY_SMOOTHING        28
00107 #define MENUITEM_EDIT_SELECTBY_NAME             29
00108 #define MENUITEM_EDIT_REGION_WINDOW             30
00109 #define MENUITEM_EDIT_REGION_CROSSING           31
00110 #define MENUITEM_EDIT_REMOVENAMEDSELECTIONS     32
00111 #define MENUITEM_EDIT_PROPERTIES                33
00112 
00113 #define MENUITEM_TOOLS_TRANSFORMTYPEIN          34
00114 #define MENUITEM_TOOLS_DISPLAYFLOATER           35
00115 #define MENUITEM_TOOLS_SELECTIONFLOATER         36
00116 #define MENUITEM_TOOLS_MIRROR                   37
00117 #define MENUITEM_TOOLS_ARRAY                    38
00118 #define MENUITEM_TOOLS_SNAPSHOT                 39
00119 #define MENUITEM_TOOLS_ALIGN                    40
00120 #define MENUITEM_TOOLS_ALIGNNORMALS             41
00121 #define MENUITEM_TOOLS_PLACEHIGHLIGHT           42
00122 #define MENUITEM_TOOLS_MTLEDIT                  43
00123 #define MENUITEM_TOOLS_MTLBROWSE                44
00124 
00125 #define MENUITEM_GROUP_GROUP                    45
00126 #define MENUITEM_GROUP_OPEN                     46
00127 #define MENUITEM_GROUP_CLOSE                    47
00128 #define MENUITEM_GROUP_UNGROUP                  48
00129 #define MENUITEM_GROUP_EXPLODE                  49
00130 #define MENUITEM_GROUP_ATTACH                   50
00131 #define MENUITEM_GROUP_DETACH                   51
00132 
00133 #define MENUITEM_VIEWS_UNDO                         52
00134 #define MENUITEM_VIEWS_REDO                         53
00135 #define MENUITEM_VIEWS_SAVEACTIVEVIEW               54
00136 #define MENUITEM_VIEWS_RESTOREACTIVEVIEW            55
00137 #define MENUITEM_VIEWS_UNITSETUP                    56
00138 #define MENUITEM_VIEWS_DRAWINGAIDS                  57
00139 #define MENUITEM_VIEWS_GRIDS_SHOWHOMEGRID           58
00140 #define MENUITEM_VIEWS_GRIDS_ACTIVATEHOMEGRID       59
00141 #define MENUITEM_VIEWS_GRIDS_ACTIVATEGRIDOBJECT     60
00142 #define MENUITEM_VIEWS_GRIDS_ALIGN                  61
00143 #define MENUITEM_VIEWS_IMAGEBACKGROUND              62
00144 #define MENUITEM_VIEWS_UPDATEBKGIMAGE               63
00145 #define MENUITEM_VIEWS_RESETBKGXFORM                64
00146 #define MENUITEM_VIEWS_SHOWAXISICON                 65
00147 #define MENUITEM_VIEWS_SHOWGHOSTING                 66
00148 #define MENUITEM_VIEWS_SHOWKEYTIMES                 67
00149 #define MENUITEM_VIEWS_SHADESELECTED                68
00150 #define MENUITEM_VIEWS_SHOWDEP                      69
00151 #define MENUITEM_VIEWS_MATCHCAMERATOVIEW            70
00152 #define MENUITEM_VIEWS_REDRAW                       71
00153 #define MENUITEM_VIEWS_DEACT_MAPS                   72
00154 #define MENUITEM_VIEWS_UPDATEDURINGSPINNERDRAG      73
00155 #define MENUITEM_VIEWS_EXPERTMODE                   74
00156 #define MENUITEM_VIEWS_VIEWPORTCONFIG               75
00157 
00158 #define MENUITEM_RENDER_RENDER                      76
00159 #define MENUITEM_RENDER_VIDEOPOST                   77
00160 #define MENUITEM_RENDER_SHOW_LAST_IMG               78
00161 #define MENUITEM_RENDER_ATMOSPHERE                  79
00162 #define MENUITEM_RENDER_PREVIEW                     80
00163 #define MENUITEM_RENDER_VIEWPREVIEW                 81
00164 #define MENUITEM_RENDER_RENAMEPREVIEW               82
00165 
00166 #define MENUITEM_HELP_CONTENTS                      83
00167 #define MENUITEM_HELP_INDEX                         84
00168 #define MENUITEM_HELP_PLUGINHELP                    85
00169 #define MENUITEM_HELP_ABOUT                         86
00170 
00171 // VIZ specific
00172 #define MENUITEM_TOOLS_SPACETOOL                    87
00173 #define MENUITEM_TOOLS_LAYERPROP                    88
00174 
00175 // JBW added MAXScript menu (11/11/98 & 12/15/98)
00176 #define MENUITEM_MAXSCRIPT_LISTENER                 89
00177 #define MENUITEM_MAXSCRIPT_OPEN                     90
00178 #define MENUITEM_MAXSCRIPT_NEW                      91
00179 #define MENUITEM_MAXSCRIPT_RUN                      92
00180 #define MENUITEM_MAXSCRIPT_MACROREC                 93
00181 
00182 
00183 #define MENUITEM_VIEWS_ACT_MAPS                     94
00184 
00185 #define MENUITEM_FILE_SAVECOPYAS                    95
00186 
00187 #define MENUITEM_FILE_SAVEXMLANIMATION              96
00188 #define MENUITEM_FILE_LOADXMLANIMATION              97
00189 
00190 #define MENUITEM_EDIT_SELECTBY_SIMILAR              98
00191 
00192 #define MENUITEM_MAXSCRIPT_EDITOR                   99
00193 
00194 #define MENUITEM_RENDER_SHOW_VFB                    100
00195 
00196 // Standard MAX menu items use IDs greater then this value.
00197 // FE plug-in menu items should use IDs less then this max value
00198 // and greater then this min value.
00199 // Note that the actual resource IDs for standard MAX menu items will
00200 // be converted to the above #defines when passed to ProcessMenuItem().
00201 #define MIN_FE_CUSTOM_MENUEITEM     1000
00202 #define MAX_FE_CUSTOM_MENUEITEM     30000
00203 
00204 
00205 
00206 
00207 // Special interface given only to front end controllers
00210 class IFrontEnd: public MaxHeapOperators {
00211     public:
00212         virtual HWND GetCommandPanelHWND()=0;
00213         
00214         virtual void *GetInterface(DWORD id)=0;
00215 
00216         virtual void ClearToolBar()=0;
00217         virtual void RemoveStandardToolButton(int id)=0;
00218         virtual void AddStandardToolButton(int id,int sepSize=-1)=0;
00219         virtual void CheckStandardTool(int id, BOOL onOff)=0;
00220         virtual BOOL IsStandardToolChecked(int id, BOOL onOdd)=0;
00221         virtual void EnableStandardTool(int id, BOOL enabled)=0;
00222         virtual void SetStandardToolFlyoff(int id, int fly)=0;
00223         virtual int GetStandardToolFlyoff(int id)=0;
00224         virtual ICustToolbar *GetMainToolbar()=0;
00225 
00226         virtual HMENU GetMainMenu()=0;
00227         virtual void SetMainMenu(HMENU hMenu)=0;
00228         virtual int MenuIDtoResID(int id)=0; // given one of the above defines, what is the corrisponding resource ID
00229         virtual int ResIDtoMenuID(int id)=0; // oppisite of above
00230     };
00231 
00232 
00235 #pragma warning(push)
00236 #pragma warning(disable:4100)
00237 class FrontEndController: public MaxHeapOperators
00238 {
00239 public:
00240     virtual void DeleteThis()=0;
00241 
00242     virtual void *GetInterface(DWORD id) {return NULL;}
00243 
00244     // Called once on startup. Note that MAX windows have been created
00245     // but not necessarily sized.
00246     virtual void Initialize(IFrontEnd *ife,Interface *ip) {}
00247 
00248     virtual DWORD GetLayout() {return FE_LAYOUT_DEFAULT;}       
00249 
00250     // Notifications
00251     virtual DWORD GeneralNotify(DWORD id, DWORD param1, DWORD param2) {return 0;}       
00252     virtual void SelectionChanged() {}
00253     virtual void TimeChanged(TimeValue t) {}
00254     virtual DWORD ProcessToolButton(int id, int notify) {return 0;}
00255     virtual DWORD ProcessMenuItem(int id, int notify) {return 0;}
00256     virtual DWORD ProcessInitMenu(HMENU hMenu) {return 0;}
00257     virtual DWORD ProcessViewportRightClick(HWND hWnd, IPoint2 m) {return 0;}
00258     virtual DWORD ProcessViewportLabelClick(HWND hWnd, IPoint2 m) {return 0;}
00259     virtual DWORD ProcessViewportMenuItem(int id, int notify) {return 0;}
00260     virtual DWORD ProcessViewportInitMenu(HMENU hMenu) {return 0;}
00261     virtual void Resize() {}
00262 };
00263 #pragma warning(pop)
00264 
00265 
00266 
00267 
00268 
00269