Panda3D
 All Classes Functions Variables Enumerations
maxOptionsDialog.h
00001 /*
00002   maxEggExpOptions.h 
00003   Created by Phillip Saltzman, 2/15/05
00004   Carnegie Mellon University, Entetainment Technology Center
00005 
00006   This file contains a class that allows users to specify
00007   export options, and then execute the export
00008 */
00009 
00010 #ifndef __maxEggExpOptions__H
00011 #define __maxEggExpOptions__H
00012 
00013 #pragma conform(forScope, off)
00014 
00015 /* Externed Globals */
00016 extern HINSTANCE hInstance;
00017 
00018 //Save/load chunk definitions
00019 #define CHUNK_OVERWRITE_FLAG  0x1000
00020 #define CHUNK_PVIEW_FLAG      0x1001
00021 #define CHUNK_LOG_OUTPUT      0x1002
00022 #define CHUNK_EGG_EXP_OPTIONS 0x1100
00023 #define CHUNK_ANIM_TYPE       0x1101
00024 #define CHUNK_EGG_CHECKED     0x1102
00025 #define CHUNK_DBL_SIDED       0x1103
00026 #define CHUNK_SF              0x1104
00027 #define CHUNK_EF              0x1105
00028 #define CHUNK_FILENAME        0x1106
00029 #define CHUNK_SHORTNAME       0x1107
00030 #define CHUNK_EXPORT_FULL     0x1108
00031 #define CHUNK_ALL_FRAMES      0x1109
00032 #define CHUNK_NODE_LIST       0x1200
00033 #define CHUNK_NODE_HANDLE     0x1201
00034 //
00035 //#define CHUNK_ADD_COLLISION   0x1202
00036 //#define CHUNK_CS_TYPE         0x1203
00037 //#define CHUNK_CF_TYPE         0x1204
00038 
00039 //Global functions
00040 void ChunkSave(ISave *isave, int chunkid, int value);
00041 void ChunkSave(ISave *isave, int chunkid, bool value);
00042 void ChunkSave(ISave *isave, int chunkid, char *value);
00043 char *ChunkLoadString(ILoad *iload, char *buffer, int maxBytes);
00044 int ChunkLoadInt(ILoad *iload);
00045 bool ChunkLoadBool(ILoad *iload);
00046 void SetICustEdit(HWND wnd, int nIDDlgItem, char *text);
00047 INT_PTR CALLBACK MaxOptionsDialogProc( HWND hWnd, UINT message, 
00048                                     WPARAM wParam, LPARAM lParam );
00049 
00050 struct MaxEggOptions
00051 {
00052     MaxEggOptions();
00053 
00054     enum Anim_Type {
00055         AT_none,
00056         AT_model,
00057         AT_chan,
00058         AT_pose,
00059         AT_strobe,
00060         AT_both
00061     };
00062 
00063 
00064     IObjParam *_max_interface;
00065     Anim_Type _anim_type;
00066     int _start_frame;
00067     int _end_frame;
00068     bool _double_sided;
00069     bool _successful;
00070     bool _export_whole_scene;
00071     bool _export_all_frames;
00072     char _file_name[2048];
00073     char _short_name[256];
00074     PT(PathReplace) _path_replace;
00075     std::vector<ULONG> _node_list;
00076 };
00077 
00078 class MaxOptionsDialog : public MaxEggOptions
00079 {
00080     friend class MaxEggPlugin;
00081     
00082   public:
00083     int _min_frame, _max_frame;
00084     bool _checked;
00085     bool _choosing_nodes;
00086     MaxEggOptions::Anim_Type _prev_type;
00087 
00088     MaxOptionsDialog();
00089     ~MaxOptionsDialog();
00090     
00091     //All these List functions should probably take what list they need to operate on
00092     //rather than just operating on a global list
00093     void SetMaxInterface(IObjParam *iface) { _max_interface = iface; }
00094     void UpdateUI(HWND hWnd);
00095     bool UpdateFromUI(HWND hWnd);
00096     void RefreshNodeList(HWND hWnd);
00097     void SetAnimRange();
00098     
00099     bool FindNode(ULONG INodeHandle); //returns true if the node is already in the list
00100     void AddNode(ULONG INodeHandle);
00101     void RemoveNode(int i);
00102     void RemoveNodeByHandle(ULONG INodeHandle);
00103     void ClearNodeList(HWND hWnd);
00104     void CullBadNodes();
00105     
00106     ULONG GetNode(int i) { return (i >= 0 && i < _node_list.size()) ? _node_list[i] : ULONG_MAX; }
00107     
00108     IOResult Load(ILoad *iload);
00109     IOResult Save(ISave *isave);
00110 };
00111 
00112 #endif // __MaxEggExpOptions__H
 All Classes Functions Variables Enumerations