Panda3D
 All Classes Functions Variables Enumerations
maxOptionsDialog.h
1 /*
2  maxEggExpOptions.h
3  Created by Phillip Saltzman, 2/15/05
4  Carnegie Mellon University, Entetainment Technology Center
5 
6  This file contains a class that allows users to specify
7  export options, and then execute the export
8 */
9 
10 #ifndef __maxEggExpOptions__H
11 #define __maxEggExpOptions__H
12 
13 #include "pathReplace.h"
14 
15 #pragma conform(forScope, off)
16 
17 /* Externed Globals */
18 extern HINSTANCE hInstance;
19 
20 //Save/load chunk definitions
21 #define CHUNK_OVERWRITE_FLAG 0x1000
22 #define CHUNK_PVIEW_FLAG 0x1001
23 #define CHUNK_LOG_OUTPUT 0x1002
24 #define CHUNK_EGG_EXP_OPTIONS 0x1100
25 #define CHUNK_ANIM_TYPE 0x1101
26 #define CHUNK_EGG_CHECKED 0x1102
27 #define CHUNK_DBL_SIDED 0x1103
28 #define CHUNK_SF 0x1104
29 #define CHUNK_EF 0x1105
30 #define CHUNK_FILENAME 0x1106
31 #define CHUNK_SHORTNAME 0x1107
32 #define CHUNK_EXPORT_FULL 0x1108
33 #define CHUNK_ALL_FRAMES 0x1109
34 #define CHUNK_NODE_LIST 0x1200
35 #define CHUNK_NODE_HANDLE 0x1201
36 //
37 //#define CHUNK_ADD_COLLISION 0x1202
38 //#define CHUNK_CS_TYPE 0x1203
39 //#define CHUNK_CF_TYPE 0x1204
40 
41 //Global functions
42 void ChunkSave(ISave *isave, int chunkid, int value);
43 void ChunkSave(ISave *isave, int chunkid, bool value);
44 void ChunkSave(ISave *isave, int chunkid, char *value);
45 TCHAR *ChunkLoadString(ILoad *iload, TCHAR *buffer, int maxLength);
46 int ChunkLoadInt(ILoad *iload);
47 bool ChunkLoadBool(ILoad *iload);
48 void SetICustEdit(HWND wnd, int nIDDlgItem, TCHAR *text);
49 INT_PTR CALLBACK MaxOptionsDialogProc(HWND hWnd, UINT message,
50  WPARAM wParam, LPARAM lParam );
51 
53 {
54  MaxEggOptions();
55 
56  enum Anim_Type {
57  AT_none,
58  AT_model,
59  AT_chan,
60  AT_pose,
61  AT_strobe,
62  AT_both
63  };
64 
65 
66  IObjParam *_max_interface;
67  Anim_Type _anim_type;
68  int _start_frame;
69  int _end_frame;
70  bool _double_sided;
71  bool _successful;
72  bool _export_whole_scene;
73  bool _export_all_frames;
74  TCHAR _file_name[2048];
75  TCHAR _short_name[256];
76  PT(PathReplace) _path_replace;
77  std::vector<ULONG> _node_list;
78 };
79 
81 {
82  friend class MaxEggPlugin;
83 
84  public:
85  int _min_frame, _max_frame;
86  bool _checked;
87  bool _choosing_nodes;
88  MaxEggOptions::Anim_Type _prev_type;
89 
92 
93  // All these List functions should probably take what list they need to operate on
94  // rather than just operating on a global list
95  void SetMaxInterface(IObjParam *iface) { _max_interface = iface; }
96  void UpdateUI(HWND hWnd);
97  bool UpdateFromUI(HWND hWnd);
98  void RefreshNodeList(HWND hWnd);
99  void SetAnimRange();
100 
101  bool FindNode(ULONG INodeHandle); //returns true if the node is already in the list
102  void AddNode(ULONG INodeHandle);
103  void RemoveNode(int i);
104  void RemoveNodeByHandle(ULONG INodeHandle);
105  void ClearNodeList(HWND hWnd);
106  void CullBadNodes();
107 
108  ULONG GetNode(int i) { return (i >= 0 && i < _node_list.size()) ? _node_list[i] : ULONG_MAX; }
109 
110  IOResult Load(ILoad *iload);
111  IOResult Save(ISave *isave);
112 };
113 
114 #endif // __MaxEggExpOptions__H
This encapsulates the user&#39;s command-line request to replace existing, incorrect pathnames to models ...
Definition: pathReplace.h:40