00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __MaxEgg__H
00014 #define __MaxEgg__H
00015
00016 #include "pandatoolbase.h"
00017 #include <sys/types.h>
00018 #include <sys/stat.h>
00019 #include <fcntl.h>
00020 #include <crtdbg.h>
00021 #include "errno.h"
00022 #include "Max.h"
00023 #include "eggGroup.h"
00024 #include "eggTable.h"
00025 #include "eggXfmSAnim.h"
00026 #include "eggData.h"
00027 #include "referenceCount.h"
00028 #include "pointerTo.h"
00029 #include "namable.h"
00030 #include "modstack.h"
00031
00032 #include <iostream>
00033 #include <fstream>
00034 #include <vector>
00035
00036 #include "windef.h"
00037 #include "windows.h"
00038
00039 #include "Max.h"
00040 #include "iparamb2.h"
00041 #include "iparamm2.h"
00042 #include "istdplug.h"
00043 #include "iskin.h"
00044 #include "maxResource.h"
00045 #include "stdmat.h"
00046 #include "phyexp.h"
00047 #include "surf_api.h"
00048 #include "bipexp.h"
00049
00050 #include "eggCoordinateSystem.h"
00051 #include "eggGroup.h"
00052 #include "eggPolygon.h"
00053 #include "eggTextureCollection.h"
00054 #include "eggTexture.h"
00055 #include "eggVertex.h"
00056 #include "eggVertexPool.h"
00057 #include "eggNurbsCurve.h"
00058 #include "pandatoolbase.h"
00059 #include "somethingToEgg.h"
00060 #include "somethingToEggConverter.h"
00061 #include "eggXfmSAnim.h"
00062 #include "pathStore.h"
00063
00064 #include "maxNodeDesc.h"
00065 #include "maxNodeTree.h"
00066 #include "maxOptionsDialog.h"
00067 #include "maxToEggConverter.h"
00068
00069 #define MaxEggPlugin_CLASS_ID Class_ID(0x7ac0d6b7, 0x55731ef6)
00070
00071 #pragma conform(forScope, off)
00072
00073
00074
00075 extern HINSTANCE hInstance;
00076
00077
00078
00079 extern TCHAR *GetString(int id);
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 #if MAX_VERSION_MAJOR < 9
00091 #define DefaultRemapDir NoRemap
00092 #endif
00093
00094 class MaxEggPlugin : public HelperObject
00095 {
00096 MaxOptionsDialog **eggList;
00097 int numEggs;
00098 int maxEggs;
00099
00100 public:
00101 bool autoOverwrite;
00102 bool pview;
00103 bool logOutput;
00104
00105
00106 static Mesh mesh;
00107 static short meshBuilt;
00108 static HWND hMaxEggParams;
00109 static IObjParam *iObjParams;
00110
00111
00112 MaxEggPlugin();
00113 virtual ~MaxEggPlugin();
00114
00115
00116 void DoExport();
00117 void UpdateUI();
00118 void SaveCheckState();
00119 void BuildMesh();
00120
00121 void AddEgg(MaxOptionsDialog *newEgg);
00122 void RemoveEgg(int i);
00123 MaxOptionsDialog *GetEgg(int i) { return (i >= 0 && i < numEggs) ? eggList[i] : NULL; }
00124
00125
00126
00127 RefResult NotifyRefChanged( Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message );
00128 void GetMat(TimeValue t, INode* inod, ViewExp *vpt, Matrix3& mat);
00129
00130
00131 int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt);
00132 int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags);
00133 CreateMouseCallBack* GetCreateMouseCallBack();
00134 void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
00135 void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
00136 TCHAR *GetObjectName() { return GetString(IDS_LIBDESCRIPTION); }
00137
00138
00139 ObjectState Eval(TimeValue time);
00140 void InitNodeName(TSTR& s) { s = GetString(IDS_CLASS_NAME); }
00141 Interval ObjectValidity(TimeValue time);
00142 void Invalidate();
00143 int DoOwnSelectHilite() { return 1; }
00144
00145
00146 int IntersectRay(TimeValue t, Ray& r, PN_stdfloat& at) { return 0; }
00147 void GetWorldBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box );
00148 void GetLocalBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box );
00149 void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm, BOOL useSel );
00150
00151
00152 void DeleteThis() { delete this; }
00153 Class_ID ClassID() { return MaxEggPlugin_CLASS_ID; }
00154 void GetClassName(TSTR& s) { s = TSTR(GetString(IDS_CLASS_NAME)); }
00155 TSTR SubAnimName(int i) { return TSTR(GetString(IDS_CLASS_NAME)); }
00156
00157
00158 RefTargetHandle Clone(RemapDir& remap = DefaultRemapDir());
00159
00160
00161 IOResult Save(ISave *isave);
00162 IOResult Load(ILoad *iload);
00163 };
00164
00165
00166 #endif // __MaxEgg__H