00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #pragma once
00017
00018 #include "iFnPub.h"
00019 #include "plugapi.h"
00020 #include "GetCOREInterface.h"
00021 #include "ref.h"
00022
00023
00024 class Bitmap;
00025 class IRendParams;
00026 class ShadeContext;
00027 class RenderGlobalContext;
00028 class IReshadeFragment;
00029
00030 #pragma warning(push)
00031 #pragma warning(disable:4100)
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #define CAC_INTERFACE Interface_ID(0x666534, 0x50101)
00045
00053 class CheckAbortCallback : public FPMixinInterface
00054 {
00055 public:
00057 virtual BOOL Check()=0;
00068 virtual BOOL Progress(int done, int total)=0;
00071 virtual void SetTitle(const MCHAR *title)=0;
00072
00073
00074 enum { cac_check, cac_progress, cac_setTitle, };
00075
00076 BEGIN_FUNCTION_MAP
00077 FN_0(cac_check, TYPE_BOOL, Check);
00078 FN_2(cac_progress, TYPE_BOOL, Progress, TYPE_INT, TYPE_INT);
00079 VFN_1(cac_setTitle, SetTitle, TYPE_STRING);
00080 END_FUNCTION_MAP
00081
00082 FPInterfaceDesc* GetDesc() { return (FPInterfaceDesc*)GetCOREInterface(CAC_INTERFACE); }
00083 };
00084
00085
00086
00087
00088
00089
00090
00091
00092
00099 class SFXParamDlg : public InterfaceServer
00100 {
00101 public:
00103 virtual Class_ID ClassID()=0;
00110 virtual void SetThing(ReferenceTarget *m)=0;
00113 virtual ReferenceTarget* GetThing()=0;
00122 virtual void SetTime(TimeValue t) { }
00124 virtual void DeleteThis()=0;
00142 virtual INT_PTR Execute(int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0) { return 0; }
00143 virtual void InvalidateUI() { }
00144 };
00145
00146
00155 class SpecialFX: public ReferenceTarget
00156 {
00157 public:
00158 MSTR name;
00159
00163 virtual MSTR GetName() { return _M(""); }
00164
00165
00172 virtual BOOL Active(TimeValue t) { return !TestAFlag(A_ATMOS_DISABLED); }
00173
00174
00185 virtual void Update(TimeValue t, Interval& valid) { }
00186
00187
00188
00193 CoreExport IOResult Save(ISave *isave);
00198 CoreExport IOResult Load(ILoad *iload);
00199
00200
00210 virtual SFXParamDlg *CreateParamDialog(IRendParams *ip) { return NULL; }
00211
00212
00213
00214
00229 virtual BOOL SetDlgThing(SFXParamDlg* dlg) { return FALSE; }
00230
00231
00232
00238 virtual int NumGizmos() { return 0; }
00245 virtual INode *GetGizmo(int i) { return NULL; }
00252 virtual void DeleteGizmo(int i) { }
00260 virtual void AppendGizmo(INode *node) { }
00268 virtual BOOL OKGizmo(INode *node) { return FALSE; }
00282 virtual void EditGizmo(INode *node) { }
00293 virtual void InsertGizmo(int i, INode *node) { assert(0); }
00294
00295
00296 CoreExport SvGraphNodeReference SvTraverseAnimGraph(IGraphObjectManager *gom, Animatable *owner, int id, DWORD flags);
00297 };
00298
00299 #define SFXBASE_CHUNK 0x39bf
00300 #define SFXNAME_CHUNK 0x0100
00301
00302
00303
00321 class AppendGizmoRestore : public RestoreObj
00322 {
00323 public:
00324 SpecialFX *fx;
00325 INode *node;
00328 AppendGizmoRestore(SpecialFX *f, INode *n) { fx= f; node = n; }
00329 void Redo() { fx->AppendGizmo(node); }
00330 void Restore(int isUndo) { fx->DeleteGizmo(fx->NumGizmos()-1); }
00331 MSTR Description() { return MSTR("AppendGizmoRestore"); }
00332 };
00333
00353 class DeleteGizmoRestore: public RestoreObj
00354 {
00355 public:
00356 SpecialFX *fx;
00357 INode *node;
00358 int num;
00361 DeleteGizmoRestore(SpecialFX *a, INode *n, int i) { fx = a; node = n; num = i; }
00362 void Redo() { fx->DeleteGizmo(num); }
00363 void Restore(int isUndo) { fx->InsertGizmo(num,node); }
00364 MSTR Description() { return MSTR("DeleteGizmoRestore"); }
00365 };
00366
00367
00368
00369
00370
00371
00372 typedef SFXParamDlg AtmosParamDlg;
00373
00384 class Atmospheric : public SpecialFX
00385 {
00386 public:
00387 RefResult NotifyRefChanged(Interval changeInt,
00388 RefTargetHandle hTarget,
00389 PartID& partID,
00390 RefMessage message) { return REF_SUCCEED; }
00391 SClass_ID SuperClassID() { return ATMOSPHERIC_CLASS_ID; }
00392
00393
00394
00399 IOResult Save(ISave *isave) { return SpecialFX::Save(isave); }
00404 IOResult Load(ILoad *iload) { return SpecialFX::Load(iload); }
00405
00406
00418 virtual AtmosParamDlg *CreateParamDialog(IRendParams *ip) { return NULL; }
00419
00420
00421
00422
00439 virtual BOOL SetDlgThing(AtmosParamDlg* dlg) { return FALSE; }
00440
00441
00486 virtual void Shade(ShadeContext& sc,const Point3& p0,const Point3& p1,Color& color, Color& trans, BOOL isBG=FALSE)=0;
00487
00488
00489
00490
00491 };
00492
00493
00494 #define ATMOSHPERICBASE_CHUNK SFXBASE_CHUNK
00495 #define ATMOSHPERICNAME_CHUNK SFXNAME_CHUNK
00496
00497
00498
00499
00500
00501
00502
00503 typedef SFXParamDlg EffectParamDlg;
00504
00524 class Effect : public SpecialFX
00525 {
00526 public:
00527 RefResult NotifyRefChanged(Interval changeInt,
00528 RefTargetHandle hTarget,
00529 PartID& partID,
00530 RefMessage message) {return REF_SUCCEED;}
00531 SClass_ID SuperClassID() { return RENDER_EFFECT_CLASS_ID; }
00532
00533
00534
00542 IOResult Save(ISave *isave) { return SpecialFX::Save(isave); }
00550 IOResult Load(ILoad *iload) { return SpecialFX::Load(iload); }
00551
00552
00564 virtual EffectParamDlg *CreateParamDialog(IRendParams *ip) { return NULL; }
00565
00566
00567
00568
00585 virtual BOOL SetDlgThing(EffectParamDlg* dlg) { return FALSE; }
00586
00587
00596 virtual DWORD GBufferChannelsRequired(TimeValue t) { return 0; }
00597
00598
00612 virtual void Apply(TimeValue t, Bitmap* bm, RenderGlobalContext* gc, CheckAbortCallback* cb )=0;
00613
00614 };
00615
00616
00617
00618
00619
00630 class Effect8 : public Effect, public BaseInterface {
00631 public:
00632
00635 CoreExport static const Interface_ID m_kEffect8_Interface_ID;
00636
00641 CoreExport static Effect8* GetEffect8(Effect& effect);
00642
00651 CoreExport static bool SupportsBitmap(Effect& effect, Bitmap& bitmap);
00652
00669 virtual bool SupportsBitmap(Bitmap& bitmap) = 0;
00670
00671
00673 CoreExport virtual BaseInterface* GetInterface(Interface_ID id);
00674
00675
00677 CoreExport virtual void* GetInterface(ULONG id);
00678 };
00679
00680
00681 #define EFFECTBASE_CHUNK SFXBASE_CHUNK
00682 #define EFFECTNAME_CHUNK SFXNAME_CHUNK
00683
00684
00685
00686
00687
00688
00689 #define AREA_KERNEL_CLASS_ID 0x77912301
00690 #define DEFAULT_KERNEL_CLASS_ID AREA_KERNEL_CLASS_ID
00691
00692
00693 typedef SFXParamDlg FilterKernelParamDlg;
00694
00732 class FilterKernel : public SpecialFX
00733 {
00734 public:
00735 RefResult NotifyRefChanged(Interval changeInt,
00736 RefTargetHandle hTarget,
00737 PartID& partID,
00738 RefMessage message ) { return REF_SUCCEED; }
00739
00740 SClass_ID SuperClassID() { return FILTER_KERNEL_CLASS_ID; }
00741
00742
00743
00746 IOResult Save(ISave *isave) { return SpecialFX::Save(isave); }
00749 IOResult Load(ILoad *iload) { return SpecialFX::Load(iload); }
00750
00751
00752 virtual FilterKernelParamDlg *CreateParamDialog( IRendParams *ip ) { return NULL; }
00753
00754
00755
00764 virtual double KernelFn( double x, double y = 0.0 )=0;
00765
00766
00767
00775 virtual long GetKernelSupport()=0;
00776
00779 virtual long GetKernelSupportY()=0;
00780
00789 virtual bool Is2DKernel()=0;
00796 virtual bool IsVariableSz()=0;
00797
00805 virtual void SetKernelSz( double x, double y = 0.0 )=0;
00813 virtual void GetKernelSz( double& x, double& y )=0;
00814
00815
00829 virtual bool IsNormalized(){ return FALSE; }
00830
00831
00835 virtual bool HasNegativeLobes()=0;
00836
00839 virtual MCHAR* GetDefaultComment()=0;
00840
00841
00849 virtual long GetNFilterParams(){ return 0; }
00855 virtual MCHAR * GetFilterParamName( long nParam ){ return _M(""); }
00856 virtual double GetFilterParamMax( long nParam ){ return 1.0; }
00861 virtual double GetFilterParam( long nParam ){ return 0.0; }
00868 virtual void SetFilterParam( long nParam, double val ){};
00869 };
00870
00871 #pragma warning(pop)
00872
00873
00874 #define FILTERKERNELBASE_CHUNK 0x39bf
00875 #define FILTERKERNELNAME_CHUNK 0x0100
00876
00877