00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #pragma once
00011
00012 #include "maxheap.h"
00013 #include "inode.h"
00014 #include "maxapi.h"
00015 #include "plugapi.h"
00016 #include "snap.h"
00017 #include "genshape.h"
00018 #include "hitdata.h"
00019 #include "imtl.h"
00020 #include "channels.h"
00021 #include "LightTypeEnums.h"
00022 #include "mesh.h"
00023 #include "GraphicsTypes.h"
00024 #include "GraphicsWindow.h"
00025 #include "INodeTab.h"
00026 #include "UVWMapTypes.h"
00027 #include "AnimPropertyID.h"
00028
00029 #include "Graphics/IObjectDisplay.h"
00030 #include "Graphics/RenderItemHandle.h"
00031
00032
00033 class SubObjAxisCallback;
00034
00035
00036 typedef short MtlIndex;
00037 typedef short TextMapIndex;
00038
00039
00040 CoreExport void setHitType(int t);
00041 CoreExport int getHitType(void);
00042 CoreExport BOOL doingXORDraw(void);
00043
00045
00046
00047 #define HITTYPE_POINT 1
00048
00050 #define HITTYPE_BOX 2
00051
00053 #define HITTYPE_CIRCLE 3
00054
00062 #define HITTYPE_SOLID 4
00063
00065 #define HITTYPE_FENCE 5
00066
00067 #define HITTYPE_LASSO 6
00068
00069 #define HITTYPE_PAINT 7
00070
00071
00072
00078 #define HIT_SELONLY (1<<0)
00079
00080 #define HIT_UNSELONLY (1<<2)
00081
00082 #define HIT_ABORTONHIT (1<<3)
00083
00086 #define HIT_SELSOLID (1<<4)
00087
00090 #define HIT_ANYSOLID (1<<5)
00091
00092 #define HIT_TRANSFORMGIZMO (1<<6)
00093
00100 #define HIT_SWITCH_GIZMO (1<<7)
00101
00102 #define HIT_MANIP_SUBHIT (1<<8)
00103
00104
00106 #define HITFLTR_ALL (1<<10)
00107
00108 #define HITFLTR_OBJECTS (1<<11)
00109
00110 #define HITFLTR_CAMERAS (1<<12)
00111
00112 #define HITFLTR_LIGHTS (1<<13)
00113
00114 #define HITFLTR_HELPERS (1<<14)
00115
00116 #define HITFLTR_WSMOBJECTS (1<<15)
00117
00118 #define HITFLTR_SPLINES (1<<16)
00119
00120 #define HITFLTR_BONES (1<<17)
00121
00122 #define HIT_SCENEXREFS (1<<18)
00123
00124 #define HIT_MANAGER_HIDDEN_SCENEXREFS (1<<19)
00125
00126 #define HITFLAG_STARTUSERBIT 24
00127
00128
00129 class Modifier;
00130 class Object;
00131 class NameTab;
00132 class ExclList;
00133 class Texmap;
00134 class ISubObjType;
00135 class MaxIcon;
00136
00137 typedef Object* ObjectHandle;
00138 typedef Tab<TextMapIndex> TextMapIndexTab;
00139 typedef TextMapIndexTab TextTab;
00140
00141 #define BASEOBJAPPDATACID Class_ID(0x48a057d2, 0x44f70d8a)
00142 #define BASEOBJAPPDATALASTSELCID Class_ID(0x1cef158c, 0x1da8486f)
00143 #define BASEOBJAPPDATACURSELCID Class_ID(0x5b3b25fc, 0x35af6260)
00144 #define BASEOBJAPPDATASCID USERDATATYPE_CLASS_ID
00145
00146
00151 class IdentityTM: public Matrix3 {
00152 public:
00158 IdentityTM() { IdentityMatrix(); }
00159 };
00160
00161 CoreExport extern IdentityTM idTM;
00162
00163
00164
00165
00166
00167
00168
00169
00172
00173
00177 #define RENDER_MESH_DISPLACEMENT_MAP 1
00178
00179
00203 #pragma warning(push)
00204 #pragma warning(disable:4100 4239)
00205
00206 class View : public InterfaceServer{
00207 public:
00209 float screenW;
00210
00212 float screenH;
00213
00215 Matrix3 worldToView;
00216
00221 virtual Point2 ViewToScreen(Point3 p)=0;
00222
00224 int projType;
00225
00227 float fov;
00228
00230 float pixelSize;
00231
00233 Matrix3 affineTM;
00234
00236 DWORD flags;
00237
00247 virtual BOOL CheckForRenderAbort() { return FALSE; }
00248
00250 virtual INT_PTR Execute(int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0) { return 0; }
00251
00252 View() { projType = -1; flags = RENDER_MESH_DISPLACEMENT_MAP; }
00253 };
00254
00256 extern CoreExport Class_ID defObjectClassID;
00257
00259 extern CoreExport Class_ID mapObjectClassID;
00260
00262 CoreExport extern ChannelMask chMask[];
00263
00264 class Object;
00265
00266
00273 class ObjectState: public MaxHeapOperators {
00274 ulong flags;
00275 Matrix3 *tm;
00276 Interval tmvi;
00277 int mtl;
00278 Interval mtlvi;
00279 void AllocTM();
00280 public:
00284 Object *obj;
00285
00287 CoreExport ObjectState();
00288
00293 CoreExport ObjectState(Object *ob);
00294
00297 CoreExport ObjectState(const ObjectState& os);
00298
00300 CoreExport ~ObjectState();
00301
00304 void OSSetFlag(ulong f) { flags |= f; }
00305
00308 void OSClearFlag(ulong f) { flags &= ~f; }
00309
00313 ulong OSTestFlag(ulong f) const { return flags&f; }
00314
00318 CoreExport void OSCopyFlag(ulong f, const ObjectState& fromos);
00319
00323 CoreExport ObjectState& operator=(const ObjectState& os);
00324
00327 Interval tmValid() const { return tmvi; }
00328
00330 Interval mtlValid() const { return mtlvi; }
00331
00338 CoreExport Interval Validity(TimeValue t) const;
00339
00342 CoreExport int TMIsIdentity() const;
00343
00350 CoreExport void SetTM(Matrix3* mat, Interval iv);
00351
00353 CoreExport Matrix3* GetTM() const;
00354
00356 CoreExport void SetIdentityTM();
00357
00363 CoreExport void ApplyTM(Matrix3* mat, Interval iv);
00364
00368 CoreExport void CopyTM(const ObjectState &fromos);
00369
00373 CoreExport void CopyMtl(const ObjectState &fromos);
00374
00381 CoreExport void Invalidate(ChannelMask channels, BOOL checkLock=FALSE);
00382
00388 CoreExport ChannelMask DeleteObj(BOOL checkLock=FALSE);
00389 };
00390
00399 class LocalModData : public InterfaceServer {
00400 public:
00403 virtual ~LocalModData() {}
00404
00409 virtual LocalModData *Clone()=0;
00410
00411 using InterfaceServer::GetInterface;
00412 virtual void* GetInterface(ULONG id) { return NULL; }
00413 };
00414
00420 class ModContext : public BaseInterfaceServer {
00421 public:
00427 Matrix3 *tm;
00428
00436 Box3 *box;
00437
00441 LocalModData *localData;
00442
00444 CoreExport ~ModContext();
00445
00448 CoreExport ModContext();
00449
00453 CoreExport ModContext(const ModContext& mc);
00454
00460 CoreExport ModContext(Matrix3 *tm, Box3 *box, LocalModData *localData);
00461 };
00462
00468 class ModContextList : public Tab<ModContext*> {};
00469
00470
00471 class HitRecord;
00472
00473
00476
00477 #define NEWSET_MERGE 1 //!< The sets should be merged.
00478 #define NEWSET_INTERSECTION 2 //!< The sets should be intersected -- that is the items common to both sets should appear in the new set.
00479 #define NEWSET_SUBTRACT 3 //!< The new set should be the result of subtracting the 1st thru nth set from the 0th set.
00480
00481
00483
00484
00486 #define USE_DAMAGE_RECT (1<<0)
00487
00490 #define DISP_SHOWSUBOBJECT (1<<1)
00491
00492
00493
00496 class IParamArray;
00497
00515 class BaseObject : public ReferenceTarget {
00516
00517 friend class ModifyTaskImp;
00518 int subObjLevel;
00519
00520 private:
00521 MaxSDK::Graphics::IObjectDisplay* mpDisplayInterface;
00522
00523 protected:
00524 MaxSDK::Graphics::RenderItemHandleArray mRenderItemHandles;
00525
00526 public:
00527 CoreExport virtual bool RequiresSupportForLegacyDisplayMode() const;
00528 CoreExport virtual bool UpdateDisplay(
00529 unsigned long renderItemCategories,
00530 const MaxSDK::Graphics::MaterialRequiredStreams& materialRequiredStreams,
00531 TimeValue t);
00532 CoreExport virtual const MaxSDK::Graphics::RenderItemHandleArray& GetRenderItems() const;
00533
00534 CoreExport virtual void* GetInterface(ULONG id);
00535 CoreExport virtual BaseInterface* GetInterface(Interface_ID id);
00536
00537 CoreExport BaseObject();
00538 CoreExport virtual ~BaseObject();
00539
00550 virtual int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt){return 0;};
00551
00561 virtual void SetExtendedDisplay(int flags) {}
00562
00573 virtual int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) { return 0; };
00574
00584 virtual void Snap(TimeValue t, INode* inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt) {}
00585
00597 virtual void GetWorldBoundBox(TimeValue t, INode * inode, ViewExp* vp, Box3& box ){};
00598
00606 virtual void GetLocalBoundBox(TimeValue t, INode* inode, ViewExp* vp, Box3& box ){};
00607
00615 virtual CreateMouseCallBack* GetCreateMouseCallBack()=0;
00616
00618 virtual MCHAR *GetObjectName() { return _M("Object"); }
00619
00628 CoreExport virtual BOOL OKToChangeTopology(MSTR &modName);
00629
00630
00631
00640 virtual BOOL ChangeTopology() {return TRUE;}
00641
00643 virtual void ForceNotify(Interval& i)
00644 {
00645 NotifyDependents( i, (PartID)PART_ALL, REFMSG_CHANGE );
00646 }
00647
00653 virtual IParamArray *GetParamBlock() {return NULL;}
00654
00664 virtual int GetParamBlockIndex(int id) {return -1;}
00665
00679 virtual void Move( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE ){}
00680
00707 virtual void Rotate( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Quat& val, BOOL localOrigin=FALSE ){}
00708
00727 virtual void Scale( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin=FALSE ){}
00728
00732 virtual void TransformStart(TimeValue t) {}
00733
00737 virtual void TransformHoldingStart(TimeValue t) {}
00738
00743 virtual void TransformHoldingFinish(TimeValue t) {}
00744
00749 virtual void TransformFinish(TimeValue t) {}
00750
00754 virtual void TransformCancel(TimeValue t) {}
00755
00774 virtual int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt, ModContext* mc) { return 0; }
00789 virtual int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags, ModContext* mc) { return 0; };
00790
00798 virtual void GetWorldBoundBox(TimeValue t,INode* inode, ViewExp *vpt, Box3& box, ModContext *mc) {}
00799
00810 virtual void CloneSelSubComponents(TimeValue t) {}
00811
00815 virtual void AcceptCloneSelSubComponents(TimeValue t) {}
00816
00829 virtual void SelectSubComponent(
00830 HitRecord *hitRec, BOOL selected, BOOL all, BOOL invert=FALSE) {}
00831
00836 virtual void ClearSelection(int selLevel) {}
00837
00842 virtual void SelectAll(int selLevel) {}
00843
00849 virtual void InvertSelection(int selLevel) {}
00850
00860 virtual int SubObjectIndex(HitRecord *hitRec) {return 0;}
00861
00894 virtual void ActivateSubobjSel(int level, XFormModes& modes ) {}
00895
00904 virtual BOOL SupportsNamedSubSels() {return FALSE;}
00905
00910 virtual void ActivateSubSelSet(MSTR &setName) {}
00911
00916 virtual void NewSetFromCurSel(MSTR &setName) {}
00917
00922 virtual void RemoveSubSelSet(MSTR &setName) {}
00923
00930 virtual void SetupNamedSelDropDown() {}
00931
00935 virtual int NumNamedSelSets() {return 0;}
00936
00941 virtual MSTR GetNamedSelSetName(int i) {return _M("");}
00942
00950 virtual void SetNamedSelSetName(int i,MSTR &newName) {}
00951
00972 virtual void NewSetByOperator(MSTR &newName,Tab<int> &sets,int op) {}
00974
00975
00994 virtual void GetSubObjectCenters(SubObjAxisCallback *cb,TimeValue t,INode *node,ModContext *mc) {}
00995
01007 virtual void GetSubObjectTMs(SubObjAxisCallback *cb,TimeValue t,INode *node,ModContext *mc) {}
01009
01047 virtual BOOL HasUVW () { return 0; }
01054 virtual BOOL HasUVW (int mapChannel) { return (mapChannel==1) ? HasUVW() : FALSE; }
01059 virtual void SetGenUVW(BOOL sw) { }
01060
01068 virtual void SetGenUVW (int mapChannel, BOOL sw) { if (mapChannel==1) SetGenUVW (sw); }
01069
01080 virtual void ShowEndResultChanged (BOOL showEndResult) { }
01081
01083
01084
01091 virtual void NotifyPreCollapse(INode *node, IDerivedObject *derObj, int index){};
01092
01101 virtual void NotifyPostCollapse(INode *node, Object *obj, IDerivedObject *derObj, int index){};
01102
01114 virtual int NumSubObjTypes(){ return 0;}
01115
01125 virtual ISubObjType *GetSubObjType(int i) { return NULL; }
01126
01133 CoreExport virtual int GetSubObjectLevel();
01135
01136
01137
01143 virtual BOOL HasViewDependentBoundingBox() { return false; }
01144
01145
01146
01147
01148
01149 private:
01150 BaseObject(const BaseObject&);
01151 BaseObject& operator=(const BaseObject&);
01152 };
01153
01154
01158 class Deformer: public MaxHeapOperators {
01159 public:
01161 virtual ~Deformer() { }
01175 virtual Point3 Map(int i, Point3 p) = 0;
01176 void ApplyToTM(Matrix3* tm);
01177 };
01178
01179
01180
01181
01182
01183
01184
01185 enum { OBJECT_LOCKED = 0x08000000 };
01186
01187 class ShapeObject;
01188 class XTCObject;
01189
01193 class XTCContainer: public MaxHeapOperators {
01194
01195 public:
01196 XTCObject *obj;
01197 int prio;
01198 int branchID;
01199
01201 XTCContainer(){obj = NULL; prio = 0; branchID = -1;}
01202
01203 };
01204
01205 #define IXTCACCESS_INTERFACE_ID Interface_ID(0x60b033d7, 0x3e1d4d0d)
01206
01210 class IXTCAccess : public BaseInterface
01211 {
01212 public:
01214 virtual Interface_ID GetID() { return IXTCACCESS_INTERFACE_ID; }
01215
01230 virtual LifetimeType LifetimeControl() { return noRelease; }
01231
01236 virtual void AddXTCObject(XTCObject *pObj, int priority = 0, int branchID = -1)=0;
01237
01239 virtual int NumXTCObjects()=0;
01240
01243 virtual XTCObject *GetXTCObject(int index)=0;
01244
01247 virtual void RemoveXTCObject(int index)=0;
01248
01252 virtual void SetXTCObjectPriority(int index,int priority)=0;
01253
01257 virtual int GetXTCObjectPriority(int index)=0;
01258
01263 virtual void SetXTCObjectBranchID(int index,int branchID)=0;
01264
01267 virtual int GetXTCObjectBranchID(int index)=0;
01268
01280 virtual void MergeAdditionalChannels(Object *from, int branchID)=0;
01281
01289 virtual void BranchDeleted(int branchID, bool reorderChannels)=0;
01290
01297 virtual void CopyAdditionalChannels(Object *from, bool deleteOld = true, bool bShallowCopy = false)=0;
01298
01300 virtual void DeleteAllAdditionalChannels()=0;
01301 };
01302
01303 class XTCAccessImp;
01304
01305 namespace MaxGraphics {
01306
01307 class IDisplayInternal;
01308
01309 }
01310
01327 class Object : public BaseObject {
01328 ChannelMask locked;
01329 Interval noEvalInterval;
01330 Interval xtcValid;
01331
01332 Tab<XTCContainer *> xObjs;
01333 XTCAccessImp *pXTCAccess;
01334
01335 MaxGraphics::IDisplayInternal* mpDisplayInternal;
01336
01337 public:
01338 CoreExport Object();
01339 CoreExport ~Object();
01340
01344 virtual int IsRenderable()=0;
01345
01346
01349 virtual void InitNodeName(MSTR& s)=0;
01350
01353 virtual int UsesWireColor() { return TRUE; }
01354
01365 virtual int DoOwnSelectHilite() { return 0; }
01366
01367
01368
01377 virtual int IntersectRay(TimeValue t, Ray& r, float& at, Point3& norm) {return FALSE;}
01378
01379
01380
01389 virtual BOOL NormalAlignVector(TimeValue t,Point3 &pt, Point3 &norm) {return FALSE;}
01391
01406
01410 void LockObject() { locked |= OBJECT_LOCKED; }
01411
01414 void UnlockObject() { locked &= ~OBJECT_LOCKED; }
01415
01418 int IsObjectLocked() { return (locked&OBJECT_LOCKED ? 1 : 0); }
01419
01420
01437 virtual ObjectState Eval(TimeValue t)=0;
01438
01439
01443 void LockChannels(ChannelMask channels) { locked |= channels; }
01444
01448 void UnlockChannels(ChannelMask channels) { locked &= ~channels; }
01449
01453 ChannelMask GetChannelLocks() { return locked; }
01454
01458 void SetChannelLocks(ChannelMask channels) { locked = channels; }
01459
01464 ChannelMask GetChannelLocks(ChannelMask m) { return locked; }
01465
01466
01467
01468
01469
01470
01476 virtual BOOL CanCacheObject() {return TRUE;}
01477
01478
01479
01480
01481
01486 virtual void WSStateInvalidate() {}
01487
01488
01489
01490
01495 virtual BOOL IsWorldSpaceObject() {return FALSE;}
01496
01497
01498
01499
01500
01501
01502 CoreExport INode *GetWorldSpaceObjectNode();
01503
01504
01505 virtual BOOL IsParticleSystem() {return FALSE;}
01506
01507
01512 CoreExport void CopyChannelLocks(Object *obj, ChannelMask needChannels);
01513
01514 virtual void TopologyChanged() { }
01515
01516
01517
01518
01519
01541 virtual int IsDeformable() { return 0; }
01542
01543
01544
01550 virtual int NumPoints(){ return 0;}
01551
01562 virtual Point3 GetPoint(int i) { return Point3(0,0,0); }
01563
01568 virtual void SetPoint(int i, const Point3& p) {}
01569
01570
01571
01572
01573
01574
01577 virtual BOOL IsPointSelected (int i) { return FALSE; }
01578
01583 virtual float PointSelection (int i) {
01584 return IsPointSelected(i) ? 1.0f : 0.0f;
01585 }
01586
01587
01588
01591 virtual BOOL HasWeights() { return FALSE; }
01592
01595 virtual double GetWeight(int i) { return 1.0; }
01596
01600 virtual void SetWeight(int i, const double w) {}
01601
01602
01603
01604
01605
01606
01617 virtual BOOL PolygonCount(TimeValue t, int& numFaces, int& numVerts) { return FALSE; }
01618
01619
01627 virtual void PointsWereChanged(){}
01628
01629
01697 CoreExport virtual void Deform(Deformer *defProc, int useSel=0);
01698
01699
01700
01711 CoreExport virtual void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm=NULL, BOOL useSel=FALSE );
01712
01713
01714
01715
01720 virtual int IsMappable() { return 0; }
01721
01725 virtual int NumMapChannels () { return IsMappable(); }
01726
01731 virtual int NumMapsUsed () { return NumMapChannels(); }
01732
01733
01734
01757 virtual void ApplyUVWMap(int type,
01758 float utile, float vtile, float wtile,
01759 int uflip, int vflip, int wflip, int cap,
01760 const Matrix3 &tm,int channel=1) {}
01761
01762
01763
01764
01765
01777 CoreExport virtual int CanConvertToType(Class_ID obtype);
01778
01779
01780
01781
01907 CoreExport virtual Object* ConvertToType(TimeValue t, Class_ID obtype);
01908
01916 virtual Class_ID PreferredCollapseType() {return Class_ID(0,0);}
01917
01942 CoreExport virtual void GetCollapseTypes(Tab<Class_ID> &clist,Tab<MSTR*> &nlist);
01943
01957 virtual Object *CollapseObject() { return this;}
01958
01959
01966 virtual DWORD GetSubselState() {return 0;}
01967 virtual void SetSubSelState(DWORD s) {}
01968
01969
01970
01971
01972
01977 CoreExport void ReadyChannelsForMod(ChannelMask channels);
01978
01979
01980
01981
01982
01983
01984
01985
01986
01987
01988
01989
01990
01991
02002 CoreExport virtual Interval ChannelValidity(TimeValue t, int nchan);
02003
02004
02008 CoreExport virtual void SetChannelValidity(int nchan, Interval v);
02009
02010
02011
02015 CoreExport virtual void InvalidateChannels(ChannelMask channels);
02016
02017
02018
02025 CoreExport virtual Interval ObjectValidity(TimeValue t);
02026
02027
02028
02029
02030
02031
02032
02038 virtual Object *MakeShallowCopy(ChannelMask channels) { return NULL; }
02039
02040
02041
02042
02051 CoreExport virtual void ShallowCopy(Object* fromOb, ChannelMask channels);
02052
02053
02054
02055
02056
02060 CoreExport virtual void FreeChannels(ChannelMask channels);
02061
02062
02063
02064
02068 CoreExport virtual void NewAndCopyChannels(ChannelMask channels);
02069
02070
02071
02072
02073
02104 CoreExport virtual void MaybeEnlargeViewportRect(GraphicsWindow *gw, Rect &rect);
02105
02106
02107
02108
02109
02110
02111
02112
02113 CoreExport bool IsBaseClassOwnedChannel(int nchan) { return (nchan == EXTENSION_CHAN_NUM) ? true : false;}
02114
02123 CoreExport void UpdateValidity(int nchan, Interval v);
02124
02126 Interval GetNoEvalInterval() { return noEvalInterval; }
02127
02129 void SetNoEvalInterval(Interval iv) {noEvalInterval = iv; }
02130
02131
02132
02135 CoreExport virtual void ReduceCaches(TimeValue t);
02136
02137
02138
02141 virtual int IsConstObject() { return 0; }
02142
02143
02144
02145
02146
02147
02148
02149
02150
02151
02152
02153
02154
02155
02156
02157
02158
02159
02160
02161
02162
02163
02164
02175 virtual int NumPipeBranches(bool selected = true) {return 0;}
02176
02177
02178
02179
02180
02181
02182
02183
02184
02201 virtual Object *GetPipeBranch(int i, bool selected = true) {return NULL;}
02202
02203
02204
02205
02206
02207
02208
02209
02210
02211
02212
02213
02214
02215
02216
02234 virtual INode *GetBranchINode(TimeValue t,INode *node,int i, bool selected = true) {return node;}
02236
02247
02248
02249
02254 virtual int NumberOfContainedShapes() { return -1; }
02255
02260 virtual ShapeObject *GetContainedShape(TimeValue t, int index) { return NULL; }
02261
02268 virtual void GetContainedShapeMatrix(TimeValue t, int index, Matrix3 &mat) {}
02269
02274 virtual BitArray ContainedShapeSelectionArray() { return BitArray(); }
02275
02276
02277 virtual BOOL IsShapeObject() { return FALSE; }
02278
02279
02280
02284 virtual BOOL CheckObjectIntegrity() {return TRUE;}
02285
02286
02287 virtual BOOL HasUVW() { return 0; }
02288
02289 virtual BOOL HasUVW (int mapChannel) { return (mapChannel==1) ? HasUVW() : FALSE; }
02290
02291
02292
02299 virtual Object *FindBaseObject() { return this; }
02300
02301
02312 virtual BOOL IsParamSurface() {return FALSE;}
02313
02316 virtual int NumSurfaces(TimeValue t) {return 1;}
02317
02318
02329 virtual Point3 GetSurfacePoint(TimeValue t, float u, float v,Interval &iv) {return Point3(0,0,0);}
02330
02331
02340 virtual Point3 GetSurfacePoint(TimeValue t, int surface, float u, float v,Interval &iv) {return Point3(0,0,0);}
02341
02342
02352 virtual void SurfaceClosed(TimeValue t, int surface, BOOL &uClosed, BOOL &vClosed) {uClosed = vClosed = TRUE;}
02353
02354
02355
02356
02373 virtual BOOL GetExtendedProperties(TimeValue t, MSTR &prop1Label, MSTR &prop1Data, MSTR &prop2Label, MSTR &prop2Data) {return FALSE;}
02374
02375
02376
02377 CoreExport SvGraphNodeReference SvTraverseAnimGraph(IGraphObjectManager *gom, Animatable *owner, int id, DWORD flags);
02378 CoreExport bool SvHandleDoubleClick(IGraphObjectManager *gom, IGraphNode *gNode);
02379 CoreExport MSTR SvGetName(IGraphObjectManager *gom, IGraphNode *gNode, bool isBeingEdited);
02380 CoreExport COLORREF SvHighlightColor(IGraphObjectManager *gom, IGraphNode *gNode);
02381 CoreExport bool SvIsSelected(IGraphObjectManager *gom, IGraphNode *gNode);
02382 CoreExport MultiSelectCallback* SvGetMultiSelectCallback(IGraphObjectManager *gom, IGraphNode *gNode);
02383 CoreExport bool SvCanSelect(IGraphObjectManager *gom, IGraphNode *gNode);
02384
02385
02386
02387
02395 CoreExport void AddXTCObject(XTCObject *pObj, int priority = 0, int branchID = -1);
02396
02399 CoreExport int NumXTCObjects();
02400
02404 CoreExport XTCObject *GetXTCObject(int index);
02405
02409 CoreExport void RemoveXTCObject(int index);
02410
02415 CoreExport void SetXTCObjectPriority(int index,int priority);
02416
02421 CoreExport int GetXTCObjectPriority(int index);
02422
02427 CoreExport void SetXTCObjectBranchID(int index,int branchID);
02428
02433 CoreExport int GetXTCObjectBranchID(int index);
02434
02435
02436
02437
02438
02439
02440
02441
02442
02443
02456 CoreExport void MergeAdditionalChannels(Object *from, int branchID);
02457
02458
02459
02460
02461
02462
02463
02473 CoreExport void BranchDeleted(int branchID, bool reorderChannels);
02474
02475
02476
02477
02487 CoreExport void CopyAdditionalChannels(Object *from, bool deleteOld = true, bool bShallowCopy = false);
02488
02491 CoreExport void DeleteAllAdditionalChannels();
02492
02493
02497 virtual BOOL UseSelectionBrackets() { return TRUE; }
02498
02499
02500 virtual BOOL IsManipulator() { return FALSE; }
02501
02502 CoreExport void* GetInterface(ULONG id);
02503 CoreExport BaseInterface* GetInterface(Interface_ID id);
02504
02506
02509 virtual void ReduceDisplayCaches() { }
02510
02517 virtual bool NeedGWCacheRebuilt(GraphicsWindow *gw, Material *ma, int numMat) { return false; }
02518
02526 virtual void BuildGWCache(GraphicsWindow *gw, Material *ma, int numMat, BOOL threaded) { }
02527
02528
02529
02530 };
02531
02532
02533
02534
02535
02544 CoreExport void GetPolygonCount(TimeValue t, Object* pObj, int& numFaces, int& numVerts);
02545
02550 CoreExport void GetTriMeshFaceCount(TimeValue t, Object* pObj, int& numFaces, int& numVerts);
02551
02552
02553 class CameraObject;
02554
02566 class IMultiPassCameraEffect : public ReferenceTarget
02567 {
02568 public:
02569
02576 virtual bool IsCompatible(CameraObject *pCameraObject) = 0;
02577
02578
02585 virtual bool DisplayPasses(TimeValue renderTime) = 0;
02586
02587
02592 virtual int TotalPasses(TimeValue renderTime) = 0;
02593
02594
02613 virtual ViewParams *Apply(INode *pCameraNode, CameraObject *pCameraObject, int passNum, TimeValue &overrideRenderTime) = 0;
02614
02615
02629 virtual void AccumulateBitmap(Bitmap *pDest, Bitmap *pSrc, int passNum, TimeValue renderTime) = 0;
02630
02636 virtual void PostRenderFrame() = 0;
02637
02638
02654 virtual RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message) { return REF_SUCCEED; }
02655
02656
02659 virtual SClass_ID SuperClassID() { return MPASS_CAM_EFFECT_CLASS_ID; }
02660 virtual void BeginEditParams(IObjParam *ip, ULONG flags, Animatable *prev=NULL) {}
02661 virtual void EndEditParams(IObjParam *ip, ULONG flags, Animatable *next=NULL) {}
02662 };
02663
02664
02665
02666
02667
02668
02670
02671 #define CAM_HITHER_CLIP 1 //!< The hither distance
02672 #define CAM_YON_CLIP 2 //!< The yon distance.
02673
02674
02676
02677 #define ENV_NEAR_RANGE 0 //!< The near distance
02678 #define ENV_FAR_RANGE 1 //!< The far distance
02679
02680
02684 struct CameraState: public MaxHeapOperators {
02685 inline CameraState() {cbStruct = sizeof(CameraState);}
02686 DWORD cbStruct;
02688 BOOL isOrtho;
02690 float fov;
02692 float tdist;
02694 BOOL horzLine;
02696 int manualClip;
02698 float hither;
02700 float yon;
02702 float nearRange;
02704 float farRange;
02705 };
02706
02714 class CameraObject : public Object
02715 {
02716 public:
02717 SClass_ID SuperClassID() { return CAMERA_CLASS_ID; }
02718 int IsRenderable() { return(0);}
02719 virtual void InitNodeName(MSTR& s) { s = _M("Camera"); }
02720 virtual int UsesWireColor() { return FALSE; }
02721
02738 virtual RefResult EvalCameraState(TimeValue time, Interval& valid, CameraState* cs)=0;
02739
02742 virtual void SetOrtho(BOOL b)=0;
02744 virtual BOOL IsOrtho()=0;
02748 virtual void SetFOV(TimeValue t, float f)=0;
02755 virtual float GetFOV(TimeValue t, Interval& valid = Interval(0,0))=0;
02759 virtual void SetTDist(TimeValue t, float f)=0;
02767 virtual float GetTDist(TimeValue t, Interval& valid = Interval(0,0))=0;
02771 virtual int GetManualClip()=0;
02776 virtual void SetManualClip(int onOff)=0;
02785 virtual float GetClipDist(TimeValue t, int which, Interval &valid=Interval(0,0))=0;
02790 virtual void SetClipDist(TimeValue t, int which, float val)=0;
02795 virtual void SetEnvRange(TimeValue time, int which, float f)=0;
02804 virtual float GetEnvRange(TimeValue t, int which, Interval& valid = Interval(0,0))=0;
02811 virtual void SetEnvDisplay(BOOL b, int notify=TRUE)=0;
02814 virtual BOOL GetEnvDisplay(void)=0;
02818 virtual void RenderApertureChanged(TimeValue t)=0;
02824 virtual void UpdateTargDistance(TimeValue t, INode* inode) { }
02825
02829 virtual void SetMultiPassEffectEnabled(TimeValue t, BOOL enabled) { }
02835 virtual BOOL GetMultiPassEffectEnabled(TimeValue t, Interval& valid) { return FALSE; }
02836 virtual void SetMPEffect_REffectPerPass(BOOL enabled) { }
02837 virtual BOOL GetMPEffect_REffectPerPass() { return FALSE; }
02841 virtual void SetIMultiPassCameraEffect(IMultiPassCameraEffect *pIMultiPassCameraEffect) { }
02844 virtual IMultiPassCameraEffect *GetIMultiPassCameraEffect() { return NULL; }
02845 };
02846
02848
02849 #define LIGHT_ATTEN_START 0 //!< The start range radius
02850 #define LIGHT_ATTEN_END 1 //!< The end range radius
02851
02852
02856 struct LightState: public MaxHeapOperators {
02863 LightType type;
02865 Matrix3 tm;
02867 Color color;
02869 float intens;
02871 float hotsize;
02873 float fallsize;
02875 int useNearAtten;
02877 float nearAttenStart;
02879 float nearAttenEnd;
02881 int useAtten;
02883 float attenStart;
02885 float attenEnd;
02888 int shape;
02890 float aspect;
02892 BOOL overshoot;
02894 BOOL shadow;
02896 BOOL on;
02898 BOOL affectDiffuse;
02900 BOOL affectSpecular;
02901 BOOL ambientOnly;
02902 DWORD extra;
02903 };
02904
02905 class LightDesc;
02906 class RendContext;
02907
02908
02909
02910
02944 class LightRayTraversal: public MaxHeapOperators {
02945 public:
02947 virtual ~LightRayTraversal() {;}
02948
02949
02950
02951
02968 virtual BOOL Step(float t0, float t1, Color illum, float distAtten)=0;
02969 };
02970
02971
02973
02974
02978 #define TRAVERSE_LOWFILTSHADOWS (1<<0)
02979
02980 #define TRAVERSE_HIFILTSHADOWS (1<<1)
02981
02984 #define TRAVERSE_USESAMPLESIZE (1<<2)
02985
02986
02988
02989
02990
02991
02992
02993
02999 class IlluminateComponents : public BaseInterfaceServer {
03000 public:
03002 Point3 L;
03004 float NL;
03005
03006
03009 float geometricAtten;
03011 float shapeAtten;
03013 float distanceAtten;
03014
03015
03016
03021 float shadowAtten;
03022
03023
03024
03027 float ambientAtten;
03030 float diffuseAtten;
03033 float specularAtten;
03034
03035
03036
03037
03038
03039
03040
03043 Color rawColor;
03044
03045
03046
03047
03050 Color filteredColor;
03051
03052
03053
03055 Color shadowColor;
03056
03057
03058
03059
03060
03061
03062
03063
03064
03066 Color lightAmbientColor;
03068 Color lightDiffuseColor;
03070 Color lightSpecularColor;
03071
03072
03073
03074
03076 Color finalColor;
03077
03078
03079
03082 Color finalColorNS;
03083
03084
03086 int nUserIllumOut;
03088 MCHAR** userIllumNames;
03090 Color* userIllumOut;
03091
03092 IlluminateComponents(): nUserIllumOut(0),userIllumOut(NULL),userIllumNames(NULL) {}
03093
03094 CoreExport ~IlluminateComponents();
03095
03096
03100 int nUserIllumChannels(){ return nUserIllumOut; }
03101
03102
03106 MCHAR* GetUserIllumName( int n ) {
03107 DbgAssert( n < nUserIllumOut );
03108 if( userIllumNames )
03109 return userIllumNames[n];
03110 return NULL;
03111 }
03112
03113
03114
03119 CoreExport int FindUserIllumName( MCHAR* name );
03120
03121
03125 void SetUserIllumOutput( int n, Color& out ){
03126 DbgAssert( n < nUserIllumOut );
03127 userIllumOut[n] = out;
03128 }
03129
03134 Color GetUserIllumOutput( int n ){
03135 DbgAssert( n < nUserIllumOut );
03136 return userIllumOut[n];
03137 }
03138
03140 void Reset(){
03141 NL = geometricAtten = shapeAtten = distanceAtten = shadowAtten
03142 = ambientAtten = diffuseAtten = specularAtten = 0.0f;
03143 rawColor.Black();
03144 filteredColor.Black();
03145 lightAmbientColor.Black();
03146 lightDiffuseColor.Black();
03147 lightSpecularColor.Black();
03148 shadowColor.Black();
03149 finalColor.Black();
03150 finalColorNS.Black();
03151 L = Point3( 0,0,0 );
03152 if(nUserIllumOut>0 && userIllumOut){
03153 for(int i=0; i<nUserIllumOut; ++i )
03154 userIllumOut[i].Black();
03155 }
03156 }
03157
03158 };
03159
03160
03161 #define IID_IIlluminationComponents Interface_ID(0xdae00001, 0x0)
03162
03166 class IIlluminationComponents : public BaseInterface {
03167 public:
03168 virtual BOOL Illuminate(ShadeContext& sc, Point3& normal, IlluminateComponents& illumComp )=0;
03169
03170 };
03171
03172
03173
03174
03175
03176
03177
03178
03194 class ObjLightDesc : public LightDesc {
03195 public:
03196
03197 LightState ls;
03198 INode *inode;
03199 BOOL uniformScale;
03200 Point3 lightPos;
03201 Matrix3 lightToWorld;
03202 Matrix3 worldToLight;
03203 Matrix3 lightToCam;
03204
03210 Matrix3 camToLight;
03216 int renderNumber;
03217
03220 CoreExport ObjLightDesc(INode *n);
03222 CoreExport virtual ~ObjLightDesc();
03223
03226 virtual ExclList* GetExclList() { return NULL; }
03227
03228
03270 CoreExport virtual int Update(TimeValue t, const RendContext &rc, RenderGlobalContext *rgc, BOOL shadows, BOOL shadowGeomChanged);
03271
03272
03275 CoreExport virtual void UpdateGlobalLightLevel(Color globLightLevel) {}
03276
03277
03285 CoreExport virtual int UpdateViewDepParams(const Matrix3& worldToCam);
03286
03287
03290 CoreExport virtual Point3 LightPosition() { return lightPos; }
03291
03292
03293
03294
03295
03296
03297
03298
03299
03300
03301
03302
03303
03304
03305
03356 virtual void TraverseVolume(
03357 ShadeContext& sc,
03358 const Ray &ray, int samples, float tStop,
03359 float attenStart, float attenEnd,
03360 DWORD flags,
03361 LightRayTraversal *proc) {}
03362 };
03363
03364
03369 #define LIGHTSHADOW_NONE 0
03370 #define LIGHTSHADOW_MAPPED 1
03371 #define LIGHTSHADOW_RAYTRACED 2
03372
03373
03374
03377 class LightObject : public Object {
03378 public:
03379 SClass_ID SuperClassID() { return LIGHT_CLASS_ID; }
03380 int IsRenderable() { return(0);}
03381 virtual void InitNodeName(MSTR& s) { s = _M("Light"); }
03382
03383
03384 CoreExport virtual void* GetInterface(ULONG id);
03385 CoreExport virtual BaseInterface* GetInterface(Interface_ID id);
03386
03387
03399 virtual RefResult EvalLightState(TimeValue time, Interval& valid, LightState *ls)=0;
03407 virtual ObjLightDesc *CreateLightDesc(INode *n, BOOL forceShadowBuffer=FALSE) {return NULL;}
03408
03409 virtual ObjLightDesc *CreateLightDesc(RenderGlobalContext *rgc, INode *inode, BOOL forceShadowBuf=FALSE ){return NULL;}
03412 virtual void SetUseLight(int onOff)=0;
03414 virtual BOOL GetUseLight(void)=0;
03418 virtual void SetHotspot(TimeValue time, float f)=0;
03423 virtual float GetHotspot(TimeValue t, Interval& valid = Interval(0,0))=0;
03427 virtual void SetFallsize(TimeValue time, float f)=0;
03433 virtual float GetFallsize(TimeValue t, Interval& valid = Interval(0,0))=0;
03440 virtual void SetAtten(TimeValue time, int which, float f)=0;
03448 virtual float GetAtten(TimeValue t, int which, Interval& valid = Interval(0,0))=0;
03452 virtual void SetTDist(TimeValue time, float f)=0;
03457 virtual float GetTDist(TimeValue t, Interval& valid = Interval(0,0))=0;
03464 virtual void SetConeDisplay(int s, int notify=TRUE)=0;
03469 virtual BOOL GetConeDisplay(void)=0;
03475 virtual int GetShadowMethod() {return LIGHTSHADOW_NONE;}
03479 virtual void SetRGBColor(TimeValue t, Point3& rgb) {}
03485 virtual Point3 GetRGBColor(TimeValue t, Interval &valid = Interval(0,0)) {return Point3(0,0,0);}
03489 virtual void SetIntensity(TimeValue time, float f) {}
03496 virtual float GetIntensity(TimeValue t, Interval& valid = Interval(0,0)) {return 0.0f;}
03500 virtual void SetAspect(TimeValue t, float f) {}
03507 virtual float GetAspect(TimeValue t, Interval& valid = Interval(0,0)) {return 0.0f;}
03510 virtual void SetUseAtten(int s) {}
03512 virtual BOOL GetUseAtten(void) {return FALSE;}
03515 virtual void SetAttenDisplay(int s) {}
03518 virtual BOOL GetAttenDisplay(void) {return FALSE;}
03521 virtual void Enable(int enab) {}
03525 virtual void SetMapBias(TimeValue t, float f) {}
03531 virtual float GetMapBias(TimeValue t, Interval& valid = Interval(0,0)) {return 0.0f;}
03535 virtual void SetMapRange(TimeValue t, float f) {}
03542 virtual float GetMapRange(TimeValue t, Interval& valid = Interval(0,0)) {return 0.0f;}
03546 virtual void SetMapSize(TimeValue t, int f) {}
03553 virtual int GetMapSize(TimeValue t, Interval& valid = Interval(0,0)) {return 0;}
03557 virtual void SetRayBias(TimeValue t, float f) {}
03564 virtual float GetRayBias(TimeValue t, Interval& valid = Interval(0,0)) {return 0.0f;}
03566 virtual int GetUseGlobal() {return 0;}
03570 virtual void SetUseGlobal(int a) {}
03573 virtual int GetShadow() {return 0;}
03577 virtual void SetShadow(int a) {}
03584 virtual int GetShadowType() {return 0;}
03590 virtual void SetShadowType(int a) {}
03594 virtual int GetAbsMapBias() {return 0;}
03597 virtual void SetAbsMapBias(int a) {}
03600 virtual int GetOvershoot() {return 0;}
03603 virtual void SetOvershoot(int a) {}
03606 virtual int GetProjector() {return 0;}
03609 virtual void SetProjector(int a) {}
03612 virtual ExclList* GetExclList() {return NULL;}
03615 virtual BOOL Include() {return FALSE;}
03617 virtual Texmap* GetProjMap() {return NULL;}
03620 virtual void SetProjMap(Texmap* pmap) {}
03625 virtual void UpdateTargDistance(TimeValue t, INode* inode) {}
03626 };
03627
03628
03629
03630
03635 class HelperObject : public Object {
03636 public:
03639 SClass_ID SuperClassID() { return HELPER_CLASS_ID; }
03642 int IsRenderable() { return(0); }
03645 virtual void InitNodeName(MSTR& s) { s = _M("Helper"); }
03648 virtual int UsesWireColor() { return FALSE; }
03649 virtual BOOL NormalAlignVector(TimeValue t,Point3 &pt, Point3 &norm) {pt=Point3(0,0,0);norm=Point3(0,0,-1);return TRUE;}
03650 };
03651
03652
03654
03655 #define GRID_PLANE_NONE -1
03656 #define GRID_PLANE_TOP 0
03657 #define GRID_PLANE_LEFT 1
03658 #define GRID_PLANE_FRONT 2
03659 #define GRID_PLANE_BOTTOM 3
03660 #define GRID_PLANE_RIGHT 4
03661 #define GRID_PLANE_BACK 5
03662
03663
03669 class ConstObject : public HelperObject {
03670 private:
03671 bool m_transient;
03672 bool m_temporary;
03673 public:
03674 ConstObject() { m_transient = m_temporary = false; }
03675
03676
03679 int IsConstObject() { return 1; }
03680
03681
03689 virtual void GetConstructionTM( TimeValue t, INode* inode, ViewExp *vpt, Matrix3 &tm ) = 0;
03690 virtual void SetConstructionPlane(int which, int notify=TRUE) = 0;
03691 virtual int GetConstructionPlane(void) = 0;
03700 virtual Point3 GetSnaps( TimeValue t ) = 0;
03701 virtual void SetSnaps(TimeValue t, Point3 p) = 0;
03702
03703 virtual BOOL NormalAlignVector(TimeValue t,Point3 &pt, Point3 &norm) {pt=Point3(0,0,0);norm=Point3(0,0,-1);return TRUE;}
03704
03705
03706 bool IsTransient()const {return m_transient;}
03707 void SetTransient(bool state = true) {m_transient = state;}
03708
03709
03710 bool IsTemporary() const { return m_temporary; }
03711 void SetTemporary(bool state = true) { m_temporary = state; }
03712
03713
03714 virtual void SetExtents(TimeValue t, Point3 halfbox)=0;
03715 virtual Point3 GetExtents(TimeValue t)=0;
03716
03717
03718
03719
03720 };
03721
03722
03723
03724
03725
03729 class GeomObject : public Object {
03730 public:
03731 virtual void InitNodeName(MSTR& s) { s = _M("Object"); }
03732 SClass_ID SuperClassID() { return GEOMOBJECT_CLASS_ID; }
03733
03734 virtual int IsRenderable() { return(1); }
03735
03736
03737
03740 virtual int IsInstanceDependent() { return 0; }
03741
03742
03743
03744
03745
03762 CoreExport virtual Mesh* GetRenderMesh(TimeValue t, INode *inode, View& view, BOOL& needDelete);
03763
03764
03765
03766
03773 virtual int NumberOfRenderMeshes() { return 0; }
03774
03775
03776
03777
03786 virtual Mesh* GetMultipleRenderMesh(TimeValue t, INode *inode, View& view, BOOL& needDelete, int meshNumber) { return NULL; }
03787
03788
03789
03790
03799 virtual void GetMultipleRenderMeshTM(TimeValue t, INode *inode, View& view, int meshNumber,
03800 Matrix3& meshTM, Interval& meshTMValid) { return; }
03801
03802
03811 CoreExport virtual PatchMesh* GetRenderPatchMesh(TimeValue t, INode *inode, View& view, BOOL& needDelete);
03812
03813 CoreExport Class_ID PreferredCollapseType();
03814
03816 virtual BOOL CanDoDisplacementMapping() { return 0; }
03817
03818 private:
03819 };
03820
03821
03822
03823
03824
03825
03826
03827
03828
03829
03841 class ForceField : public InterfaceServer {
03842 public:
03851 virtual Point3 Force(TimeValue t,const Point3 &pos, const Point3 &vel, int index)=0;
03852 virtual void SetRandSeed(int seed) {}
03856 virtual void DeleteThis() {}
03857 };
03858
03859
03860
03861
03862
03863
03870 class CollisionObject : public InterfaceServer {
03871 public:
03872
03930 virtual BOOL CheckCollision(TimeValue t,Point3 &pos, Point3 &vel, float dt,int index, float *ct=NULL, BOOL UpdatePastCollide=TRUE)=0;
03935 virtual Object *GetSWObject()=0;
03936 virtual void SetRandSeed(int seed) {}
03937 virtual void DeleteThis() {}
03938 };
03939
03943 #define PARTCENTER_HEAD 1 //!< Particle geometry lies behind the particle position
03944 #define PARTCENTER_CENTER 2 //!< Particle geometry is centered around particle position
03945 #define PARTCENTER_TAIL 3 //!< Particle geometry lies in front of the particle position
03946
03947
03948
03949
03950
03951
03952
03953
03954
03971 class ParticleObject : public GeomObject {
03972 public:
03973 BOOL IsParticleSystem() {return TRUE;}
03974
03985 virtual void ApplyForceField(ForceField *ff)=0;
03999 virtual BOOL ApplyCollisionObject(CollisionObject *co)=0;
04000
04001
04002
04003
04009 int IsDeformable() {return TRUE;}
04010
04011
04012
04016 BOOL CanCacheObject() {return FALSE;}
04017
04018
04027 virtual BOOL NormalAlignVector(TimeValue t,Point3 &pt, Point3 &norm) {pt=Point3(0,0,0);norm=Point3(0,0,-1);return TRUE;}
04028
04029
04030
04065 virtual Point3 ParticlePosition(TimeValue t,int i) {return Point3(0,0,0);}
04071 virtual Point3 ParticleVelocity(TimeValue t,int i) {return Point3(0,0,0);}
04078 virtual float ParticleSize(TimeValue t,int i) {return 0.0f;}
04095 virtual int ParticleCenter(TimeValue t,int i) {return PARTCENTER_CENTER;}
04102 virtual TimeValue ParticleAge(TimeValue t, int i) {return -1;}
04109 virtual TimeValue ParticleLife(TimeValue t, int i) {return -1;}
04110
04111
04112
04113
04119 virtual BOOL HasConstantTopology() { return FALSE; }
04120 };
04121
04122
04123
04124
04125
04126
04127
04128
04129 class PolyShape;
04130 class BezierShape;
04131 class MeshCapInfo;
04132 class PatchCapInfo;
04133 class ShapeHierarchy;
04134
04136
04137 #define GENMESH_DEFAULT -1 //!< Use whatever is stored in the ShapeObject's UseViewport flag
04138 #define GENMESH_VIEWPORT 0
04139 #define GENMESH_RENDER 1
04140
04141
04148 #define SHAPE_OBJ_NUM_REFS 1
04149 #define SHAPE_OBJ_NUM_SUBS 1
04150
04151
04153
04154 #define USERPBLOCK SHAPE_OBJ_NUM_REFS //!< User's parameter block
04155 #define IPBLOCK (SHAPE_OBJ_NUM_REFS + 1) //!< Interpolations parameter block
04156
04157
04158 class IParamBlock;
04159 class IParamMap;
04160
04161 #define SHAPE_RECT_RENDERPARAMS_PROPID PROPID_USER+10
04162
04170 class IShapeRectRenderParams : public AnimProperty
04171 {
04172 protected :
04173 ShapeObject *mShape;
04174 public:
04177 IShapeRectRenderParams(ShapeObject *so) : mShape(so)
04178 {
04179 }
04180
04184 CoreExport BOOL GetRectangular(TimeValue t) const;
04188 CoreExport void SetRectangular(TimeValue t, BOOL rectangular);
04189
04193 CoreExport float GetWidth(TimeValue t) const;
04197 CoreExport void SetWidth(TimeValue t, float width);
04198
04202 CoreExport float GetLength(TimeValue t) const;
04206 CoreExport void SetLength(TimeValue t, float length);
04207
04211 CoreExport float GetAngle2(TimeValue t) const;
04215 CoreExport void SetAngle2(TimeValue t, float angle);
04216
04220 CoreExport BOOL GetAspectLock(TimeValue t) const;
04224 CoreExport void SetAspectLock(TimeValue t, BOOL aspectLock);
04225
04229 CoreExport BOOL GetVPTRectangular(TimeValue t) const;
04233 CoreExport void SetVPTRectangular(TimeValue t, BOOL rectangular);
04234
04238 CoreExport float GetVPTWidth(TimeValue t) const;
04242 CoreExport void SetVPTWidth(TimeValue t, float width);
04243
04247 CoreExport float GetVPTLength(TimeValue t) const;
04251 CoreExport void SetVPTLength(TimeValue t, float length);
04252
04256 CoreExport float GetVPTAngle2(TimeValue t) const;
04260 CoreExport void SetVPTAngle2(TimeValue t, float angle);
04261
04265 CoreExport BOOL GetVPTAspectLock(TimeValue t) const;
04269 CoreExport void SetVPTAspectLock(TimeValue t, BOOL aspectLock);
04270
04274 CoreExport BOOL GetAutosmooth(TimeValue t) const;
04278 CoreExport void SetAutosmooth(TimeValue t, BOOL autosmooth);
04279
04283 CoreExport float GetAutosmoothThreshold(TimeValue t) const;
04287 CoreExport void SetAutosmoothThreshold(TimeValue t, float threshold);
04288
04291 DWORD ID() { return SHAPE_RECT_RENDERPARAMS_PROPID;}
04292 };
04293
04342 class ShapeObject : public GeomObject
04343 {
04344 friend class SObjRenderingDlgProc;
04345 friend class ShapePostLoadCallback;
04346 friend class IShapeRectRenderParams;
04347 IObjParam *ip;
04348 IParamBlock *sopblock;
04349 static IParamMap *pmap;
04350 int loadVersion;
04351
04352 Mesh meshCache;
04353 Interval cacheValid;
04354 int cacheType;
04355
04356 public:
04357 CoreExport ShapeObject();
04358 CoreExport ~ShapeObject();
04359
04360
04361 CoreExport virtual BaseInterface* GetInterface(Interface_ID iid);
04362
04363
04364 CoreExport virtual void* GetInterface(ULONG id);
04365
04366
04367 CoreExport virtual bool RequiresSupportForLegacyDisplayMode() const;
04368 CoreExport virtual bool UpdateDisplay(
04369 unsigned long renderItemCategories,
04370 const MaxSDK::Graphics::MaterialRequiredStreams& materialRequiredStreams,
04371 TimeValue t);
04372
04373 virtual BOOL IsShapeObject() { return TRUE; }
04374
04384 virtual int IntersectRay(TimeValue t, Ray& ray, float& at, Point3& norm) {return FALSE;}
04385 virtual void InitNodeName(MSTR& s) { s = _M("Shape"); }
04386 SClass_ID SuperClassID() { return SHAPE_CLASS_ID; }
04387 CoreExport virtual int IsRenderable();
04394 CoreExport virtual void CopyBaseData(ShapeObject &from);
04395
04400 CoreExport float GetThickness(TimeValue t, Interval &ivalid);
04405 CoreExport int GetSides(TimeValue t, Interval &ivalid);
04410 CoreExport float GetAngle(TimeValue t, Interval &ivalid);
04413 CoreExport float GetViewportThickness();
04417 CoreExport int GetViewportSides();
04421 CoreExport float GetViewportAngle();
04427 CoreExport BOOL GetRenderable();
04430 CoreExport BOOL GetGenUVs();
04433 CoreExport BOOL GetDispRenderMesh();
04436 CoreExport BOOL GetUseViewport();
04439 CoreExport BOOL GetViewportOrRenderer();
04444 CoreExport void SetThickness(TimeValue t, float thick);
04450 CoreExport void SetSides(TimeValue t, int s);
04455 CoreExport void SetAngle(TimeValue t, float a);
04456 CoreExport void SetViewportThickness(float thick);
04460 CoreExport void SetViewportSides(int s);
04465 CoreExport void SetViewportAngle(float a);
04469 CoreExport void SetRenderable(BOOL sw);
04473 CoreExport void SetGenUVs(BOOL sw);
04476 CoreExport void SetDispRenderMesh(BOOL sw);
04480 CoreExport void SetUseViewport(BOOL sw);
04483 CoreExport void SetViewportOrRenderer(BOOL sw);
04484 CoreExport virtual Mesh* GetRenderMesh(TimeValue t, INode *inode, View& view, BOOL& needDelete);
04492 CoreExport virtual void GetRenderMeshInfo(TimeValue t, INode *inode, View& view, int &nverts, int &nfaces);
04501 CoreExport virtual void GenerateMesh(TimeValue t, int option, Mesh *mesh);
04509 virtual int NumberOfVertices(TimeValue t, int curve = -1) { return 0; }
04511 virtual int NumberOfCurves()=0;
04517 virtual BOOL CurveClosed(TimeValue t, int curve)=0;
04528 virtual Point3 InterpCurve3D(TimeValue t, int curve, float param, int ptype=PARAM_SIMPLE)=0;
04539 virtual Point3 TangentCurve3D(TimeValue t, int curve, float param, int ptype=PARAM_SIMPLE)=0;
04561 virtual float LengthOfCurve(TimeValue t, int curve)=0;
04565 virtual int NumberOfPieces(TimeValue t, int curve)=0;
04579 virtual Point3 InterpPiece3D(TimeValue t, int curve, int piece, float param, int ptype=PARAM_SIMPLE)=0;
04590 virtual Point3 TangentPiece3D(TimeValue t, int curve, int piece, float param, int ptype=PARAM_SIMPLE)=0;
04600 virtual MtlID GetMatID(TimeValue t, int curve, int piece) { return 0; }
04605 virtual BOOL CanMakeBezier() { return FALSE; }
04609 virtual void MakeBezier(TimeValue t, BezierShape &shape) {}
04615 virtual ShapeHierarchy &OrganizeCurves(TimeValue t, ShapeHierarchy *hier=NULL)=0;
04625 virtual void MakePolyShape(TimeValue t, PolyShape &shape, int steps = PSHAPE_BUILTIN_STEPS, BOOL optimize = FALSE)=0;
04631 virtual int MakeCap(TimeValue t, MeshCapInfo &capInfo, int capType)=0;
04637 virtual int MakeCap(TimeValue t, PatchCapInfo &capInfo) { return 0; }
04651 virtual BOOL AttachShape(TimeValue t, INode *thisNode, INode *attachNode, BOOL weldEnds=FALSE, float weldThreshold=0.0f) { return FALSE; }
04652
04653 virtual BOOL HasUVW() { return GetGenUVs(); }
04654 virtual BOOL HasUVW (int mapChannel) { return (mapChannel==1) ? HasUVW() : FALSE; }
04655 virtual void SetGenUVW(BOOL sw) { SetGenUVs(sw); }
04656 virtual void SetGenUVW (int mapChannel, BOOL sw) { if (mapChannel==1) SetGenUVW (sw); }
04657
04658
04665 CoreExport virtual IOResult Save(ISave *isave);
04672 CoreExport virtual IOResult Load(ILoad *iload);
04673
04677 CoreExport virtual Class_ID PreferredCollapseType();
04681 CoreExport virtual BOOL GetExtendedProperties(TimeValue t, MSTR &prop1Label, MSTR &prop1Data, MSTR &prop2Label, MSTR &prop2Data);
04703 CoreExport virtual void RescaleWorldUnits(float f);
04704
04730 CoreExport virtual RefResult ShapeObject::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message );
04741 CoreExport virtual RefTargetHandle GetReference(int i);
04750 protected:
04751 CoreExport virtual void SetReference(int i, RefTargetHandle rtarg);
04752 public:
04760 CoreExport virtual Animatable* SubAnim(int i);
04768 CoreExport virtual MSTR SubAnimName(int i);
04773 CoreExport ParamDimension *GetParameterDim(int pbIndex);
04776 CoreExport MSTR GetParameterName(int pbIndex);
04798 CoreExport virtual int RemapRefOnLoad(int iref);
04799
04807 virtual int NumRefs() {return 1;}
04808 virtual int NumSubs() {return 1;}
04822 CoreExport void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
04823
04838 CoreExport void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
04839
04840
04849 CoreExport Interval GetShapeObjValidity(TimeValue t);
04850
04873 CoreExport int Display(TimeValue t, INode *inode, ViewExp* vpt, int flags);
04874
04875
04884 CoreExport virtual Box3 GetBoundingBox(TimeValue t, Matrix3 *tm=NULL);
04885
04892 CoreExport virtual void InvalidateGeomCache();
04893
04895
04901 int SetProperty(ULONG id, void *data)
04902 {
04903 AnimProperty *prop = (AnimProperty *)GetProperty(id);
04904 if (prop) prop = (AnimProperty*)data;
04905 else
04906 {
04907 prop = (AnimProperty *)data;
04908 aprops.Append(1, &prop);
04909 }
04910 return 1;
04911 }
04912
04914
04918 void *GetProperty(ULONG id)
04919 {
04920 for(int i = 0;i<aprops.Count();i++)
04921 if (aprops[i] && aprops[i]->ID() == id )
04922 return aprops[i];
04923 return NULL;
04924 }
04925
04926
04927
04928
04930 CoreExport BOOL GetUsePhysicalScaleUVs();
04932 CoreExport void SetUsePhysicalScaleUVs(BOOL flag);
04933
04934 private:
04935
04939 void SetAspect(HWND hWnd);
04945 float GetAspect(TimeValue t, BOOL viewport);
04946 void CheckAspectLock(HWND hWnd);
04950 void OnAspectChange(HWND hWnd);
04951 void OnLengthWidthChange(HWND hWnd, BOOL lengthChange);
04955 BOOL UseViewOrRenderParams();
04956 BOOL CanLockAspect(BOOL vpt);
04957 };
04958
04959
04960
04961 CoreExport void SetShapeObjectCCSThreshold(float angle);
04962
04963
04964
04965
04966
04972 class WSMObject : public Object {
04973 public:
04977 SClass_ID SuperClassID() { return WSM_OBJECT_CLASS_ID; }
04983 virtual Modifier *CreateWSMMod(INode *node)=0;
04984
04987 virtual int UsesWireColor() { return FALSE; }
04988
04991 virtual BOOL NormalAlignVector(TimeValue t,Point3 &pt, Point3 &norm) {pt=Point3(0,0,0);norm=Point3(0,0,-1);return TRUE;}
04992
04995 virtual BOOL SupportsDynamics() { return FALSE; }
04996
05005 virtual ForceField *GetForceField(INode *node) {return NULL;}
05006
05010 virtual CollisionObject *GetCollisionObject(INode *node) {return NULL;}
05011
05012 CoreExport void* GetInterface(ULONG id);
05013 };
05014
05015
05016
05017
05018
05019 class ControlMatrix3;
05020
05021
05022
05027 class ModContextEnumProc: public MaxHeapOperators {
05028 public:
05030 virtual ~ModContextEnumProc() {;}
05036 virtual BOOL proc(ModContext *mc)=0;
05037 };
05038
05039
05040
05041
05042
05043
05044
05053 class Modifier : public BaseObject {
05054 friend class ModNameRestore;
05055 MSTR modName;
05056 public:
05057
05058 CoreExport Modifier();
05059 CoreExport ~Modifier();
05060
05063 CoreExport virtual MSTR GetName();
05067 CoreExport virtual void SetName(MSTR n);
05068
05069 SClass_ID SuperClassID() { return OSM_CLASS_ID; }
05070
05071
05072
05074 void DisableModApps() { NotifyDependents(FOREVER,PART_OBJ,REFMSG_DISABLE); }
05076 void EnableModApps() { NotifyDependents(FOREVER,PART_OBJ,REFMSG_ENABLE); }
05077
05078
05081 void DisableMod() {
05082 SetAFlag(A_MOD_DISABLED);
05083 NotifyDependents(FOREVER, (PartID)(PART_ALL|PART_OBJECT_TYPE),REFMSG_CHANGE);
05084 }
05087 void EnableMod() {
05088 ClearAFlag(A_MOD_DISABLED);
05089 NotifyDependents(FOREVER, (PartID)(PART_ALL|PART_OBJECT_TYPE), REFMSG_CHANGE);
05090 }
05096 int IsEnabled() { return !TestAFlag(A_MOD_DISABLED); }
05097
05098
05102 void DisableModInViews() {
05103 SetAFlag(A_MOD_DISABLED_INVIEWS);
05104 NotifyDependents(FOREVER, (PartID)(PART_ALL|PART_OBJECT_TYPE), REFMSG_CHANGE);
05105 }
05108 void EnableModInViews() {
05109 ClearAFlag(A_MOD_DISABLED_INVIEWS);
05110 NotifyDependents(FOREVER,(PartID)(PART_ALL|PART_OBJECT_TYPE), REFMSG_CHANGE);
05111 }
05115 int IsEnabledInViews() { return !TestAFlag(A_MOD_DISABLED_INVIEWS); }
05116
05117
05121 void DisableModInRender() {
05122 SetAFlag(A_MOD_DISABLED_INRENDER);
05123 NotifyDependents(FOREVER,(PartID)(PART_ALL|PART_OBJECT_TYPE), REFMSG_CHANGE);
05124 }
05128 void EnableModInRender() {
05129 ClearAFlag(A_MOD_DISABLED_INRENDER);
05130 NotifyDependents(FOREVER,(PartID)(PART_ALL|PART_OBJECT_TYPE), REFMSG_CHANGE);
05131 }
05137 int IsEnabledInRender() { return !TestAFlag(A_MOD_DISABLED_INRENDER); }
05138
05157 CoreExport virtual Interval LocalValidity(TimeValue t);
05168 virtual ChannelMask ChannelsUsed()=0;
05173 virtual ChannelMask ChannelsChanged()=0;
05174
05217 virtual void NotifyInputChanged(Interval changeInt, PartID partID, RefMessage message, ModContext *mc) {}
05218
05219
05220
05221
05222
05229 virtual bool ChangesSelType(){ return ChannelsChanged()&SUBSEL_TYPE_CHANNEL ? true : false;}
05230
05231
05235 CoreExport ChannelMask TotalChannelsUsed();
05240 CoreExport ChannelMask TotalChannelsChanged();
05241
05242
05243
05244
05260 virtual void ModifyObject(TimeValue t, ModContext &mc, ObjectState* os, INode *node)=0;
05261
05262
05264 virtual int NeedUseSubselButton() { return 1; }
05265
05266
05267
05268
05275 virtual BOOL DependOnTopology(ModContext &mc) {return FALSE;}
05276
05277
05278
05279
05280
05281
05290 virtual Class_ID InputType()=0;
05291
05292 virtual void ForceNotify(Interval& i)
05293 {NotifyDependents(i,ChannelsChanged(),REFMSG_CHANGE );}
05294
05302 virtual IOResult SaveLocalData(ISave *isave, LocalModData *ld) { return IO_OK; }
05311 virtual IOResult LoadLocalData(ILoad *iload, LocalModData **pld) { return IO_OK; }
05312
05313
05314
05333 CoreExport IOResult Save(ISave *isave);
05337 CoreExport IOResult Load(ILoad *iload);
05338
05339
05345 CoreExport void EnumModContexts(ModContextEnumProc *proc);
05346
05347
05348
05354 CoreExport void GetIDerivedObject(ModContext *mc, IDerivedObject *&derObj, int &modIndex);
05355
05356
05357
05358
05365 CoreExport virtual void CopyAdditionalChannels(Object *fromObj, Object *toObj) { toObj->CopyAdditionalChannels(fromObj);}
05366
05367
05368 CoreExport SvGraphNodeReference SvTraverseAnimGraph(IGraphObjectManager *gom, Animatable *owner, int id, DWORD flags);
05369 CoreExport MSTR SvGetName(IGraphObjectManager *gom, IGraphNode *gNode, bool isBeingEdited);
05370 CoreExport bool SvCanSetName(IGraphObjectManager *gom, IGraphNode *gNode);
05371 CoreExport bool SvSetName(IGraphObjectManager *gom, IGraphNode *gNode, MSTR &name);
05372 CoreExport bool SvHandleDoubleClick(IGraphObjectManager *gom, IGraphNode *gNode);
05373 CoreExport COLORREF SvHighlightColor(IGraphObjectManager *gom, IGraphNode *gNode);
05374 CoreExport bool SvIsSelected(IGraphObjectManager *gom, IGraphNode *gNode);
05375 CoreExport MultiSelectCallback* SvGetMultiSelectCallback(IGraphObjectManager *gom, IGraphNode *gNode);
05376 CoreExport bool SvCanSelect(IGraphObjectManager *gom, IGraphNode *gNode);
05377 CoreExport bool SvCanInitiateLink(IGraphObjectManager *gom, IGraphNode *gNode);
05378 CoreExport bool SvCanConcludeLink(IGraphObjectManager *gom, IGraphNode *gNode, IGraphNode *gNodeChild);
05379 CoreExport bool SvLinkChild(IGraphObjectManager *gom, IGraphNode *gNodeThis, IGraphNode *gNodeChild);
05380 CoreExport bool SvCanRemoveThis(IGraphObjectManager *gom, IGraphNode *gNode);
05381 CoreExport bool SvRemoveThis(IGraphObjectManager *gom, IGraphNode *gNode);
05382
05383 private:
05384 };
05385
05390 class OSModifier : public Modifier {
05391 public:
05394 SClass_ID SuperClassID() { return OSM_CLASS_ID; }
05395 };
05396
05402 class WSModifier : public Modifier {
05403 public:
05406 SClass_ID SuperClassID() { return WSM_CLASS_ID; }
05407 };
05408
05409 CoreExport void MakeHitRegion(HitRegion& hr, int type, int crossing, int epsi, IPoint2 *p);
05410
05430 class PolyLineProc: public MaxHeapOperators {
05431 public:
05433 virtual ~PolyLineProc() {;}
05437 virtual int proc(Point3 *p, int n)=0;
05442 virtual void SetLineColor(float r, float g, float b) {}
05443 virtual void SetLineColor(Point3 c) {}
05444 virtual void Marker(Point3 *p,MarkerType type) {}
05445 };
05446 #pragma warning(pop)
05447
05452 class DrawLineProc : public PolyLineProc {
05453 GraphicsWindow *gw;
05454 public:
05456 DrawLineProc() { gw = NULL; }
05458 DrawLineProc(GraphicsWindow *g) { gw = g; }
05464 int proc(Point3 *p, int n) { gw->polyline(n, p, NULL, NULL, 0, NULL); return 0; }
05470 void SetLineColor(float r, float g, float b) {gw->setColor(LINE_COLOR,r,g,b);}
05471 void SetLineColor(Point3 c) {gw->setColor(LINE_COLOR,c);}
05472 void Marker(Point3 *p,MarkerType type) {gw->marker(p,type);}
05473 };
05474
05475
05481 class BoxLineProc : public PolyLineProc {
05482 Box3 box;
05483 Matrix3 *tm;
05484 public:
05486 BoxLineProc() { box.Init();}
05489 BoxLineProc(Matrix3* m) { tm = m; box.Init(); }
05491 Box3& Box() { return box; }
05498 CoreExport int proc(Point3 *p, int n);
05499 CoreExport void Marker(Point3 *p,MarkerType type);
05500 };
05501
05502
05503
05504
05505 CoreExport void DoModifiedBox(Box3& box, Deformer &def, PolyLineProc& lp);
05506 CoreExport void DoModifiedLimit(Box3& box, float z, int axis, Deformer &def, PolyLineProc& lp);
05507 CoreExport void DrawCenterMark(PolyLineProc& lp, Box3& box );
05508
05509
05510 CoreExport void DoSphericalMapIcon(BOOL sel,float radius, PolyLineProc& lp);
05511 CoreExport void DoCylindricalMapIcon(BOOL sel,float radius, float height, PolyLineProc& lp);
05512 CoreExport void DoPlanarMapIcon(BOOL sel,float width, float length, PolyLineProc& lp);
05513
05514
05515
05516
05517
05518 class HitLog;
05519
05547 class HitRecord: public MaxHeapOperators {
05548 friend class HitLog;
05549 HitRecord *next;
05550 public:
05551 INode *nodeRef;
05552 ModContext *modContext;
05553 DWORD distance;
05554 ulong hitInfo;
05555 HitData *hitData;
05559 HitRecord() { next = NULL; modContext = NULL; distance = 0; hitInfo = 0; hitData = NULL;}
05562 HitRecord(INode *nr, ModContext *mc, DWORD d, ulong inf, HitData *hitdat) {
05563 next = NULL;
05564 nodeRef = nr; modContext = mc; distance = d; hitInfo = inf; hitData = hitdat;
05565 }
05568 HitRecord(HitRecord *n,INode *nr, ModContext *mc, DWORD d, ulong inf, HitData *hitdat) {
05569 next = n;
05570 nodeRef = nr; modContext = mc; distance = d; hitInfo = inf; hitData = hitdat;
05571 }
05575 HitRecord * Next() { return next; }
05578 CoreExport ~HitRecord();
05579 };
05580
05586 class HitLog: public MaxHeapOperators {
05587 HitRecord *first;
05588 int hitIndex;
05589 bool hitIndexReady;
05590 public:
05592 HitLog() { first = NULL; hitIndex = 0; hitIndexReady = false; }
05594 ~HitLog() { Clear(); }
05596 CoreExport void Clear();
05597 CoreExport void ClearHitIndex(bool ready = false) { hitIndex = 0; hitIndexReady = ready; }
05598 CoreExport void IncrHitIndex() { if (hitIndexReady) hitIndex++; else hitIndexReady = true; }
05601 HitRecord* First() { return first; }
05606 CoreExport HitRecord* ClosestHit();
05622 CoreExport void LogHit(INode *nr, ModContext *mc, DWORD dist, ulong info, HitData *hitdat = NULL);
05623 };
05624
05625
05626
05627
05632 CoreExport Object *MakeObjectDerivedObject(Object *obj);
05633
05635
05636 #define SPACEWARP_CAT_GEOMDEF 1
05637 #define SPACEWARP_CAT_MODBASED 2
05638 #define SPACEWARP_CAT_PARTICLE 3
05639
05640
05641 CoreExport MCHAR *GetSpaceWarpCatString(int id);
05642
05643
05644
05645
05662 class ObjectConverter : public InterfaceServer {
05663 public:
05666 virtual Class_ID ConvertsFrom ()=0;
05669 virtual Class_ID ConvertsTo ()=0;
05670
05671
05675 virtual Object *Convert (Object *from)=0;
05677 virtual void DeleteThis () { }
05678 };
05679
05680
05681
05682
05683
05684
05685
05686
05687
05688
05689
05690
05691
05692
05693
05694
05695 #define INTERFACE_TIME_BASED_CONVERTER Interface_ID(0x1e064bad,0x716643db)
05696
05697 class ITimeBasedConverter : public BaseInterface {
05698 public:
05699 Interface_ID GetID () { return INTERFACE_TIME_BASED_CONVERTER; }
05700
05701 virtual Object *ConvertWithTime (TimeValue t, Object *from)=0;
05702 };
05703
05707 CoreExport bool RegisterObjectConverter (ObjectConverter *conv);
05721 CoreExport int CanConvertTriObject (Class_ID to);
05726 CoreExport int CanConvertPatchObject (Class_ID to);
05731 CoreExport int CanConvertSplineShape (Class_ID to);
05734 CoreExport void RegisterStaticEditTri (Object *triob);
05743 CoreExport void RegisterCollapseType (Class_ID cid, MSTR name, bool canSelfConvert=false);
05744
05745
05746
05747
05748
05754 class ISubObjType : public InterfaceServer
05755 {
05756 public:
05759 virtual MaxIcon *GetIcon()=0;
05762 virtual MCHAR *GetName()=0;
05763 };
05764
05765
05766
05767
05768
05769
05770
05784 class GenSubObjType : public ISubObjType {
05785 MSTR name;
05786 MaxIcon *mIcon;
05787 int mIdx;
05788 MSTR mFilePrefix;
05789
05790 public:
05802 GenSubObjType(MCHAR *nm, MCHAR* pFilePrefix, int idx) : name(nm), mIcon(NULL), mIdx(idx), mFilePrefix(pFilePrefix) {}
05803
05809 GenSubObjType(int idx) : mIcon(NULL), mIdx(idx), mFilePrefix(_M("SubObjectIcons")) {}
05810
05812 CoreExport ~GenSubObjType();
05815 void SetName(MCHAR *nm){name = nm;}
05818 MCHAR *GetName() { return name;}
05821 CoreExport MaxIcon *GetIcon();
05822 };
05823