IPViewManager.h

Go to the documentation of this file.
00001 
00007 /**********************************************************************
00008  *<
00009     CREATED BY: Oleg Bayborodin
00010 
00011     HISTORY: created 01-11-02
00012 
00013  *> Copyright (c) 2001, All Rights Reserved.
00014  **********************************************************************/
00015 
00016 #pragma once
00017 
00018 #include "PFExport.h"
00019 #include "..\ifnpub.h"
00020 // forward declarations
00021 class ClassEntry;
00022 class IParamBlock2;
00023 
00024 // interface ID
00025 #define PVIEWMANAGER_INTERFACE Interface_ID(0x74f93d07, 0x1eb34500) 
00026 
00027 #define GetPViewManagerInterface(obj) ((IPViewManager*)obj->GetInterface(PVIEWMANAGER_INTERFACE)) 
00028 
00029 class IPViewManager : public FPMixinInterface
00030 {
00031 public:
00032 
00033     // function IDs
00034     enum {  kOpenParticleView,
00035             kUpdateParticleViews,
00036             kPreUpdateParticleViews,
00037             kPostUpdateParticleViews,
00038             kUpdateOnHold,
00039             kNumActionClasses,
00040             kActionClass,
00041             kActionName,
00042             kNumPViewItemClasses,
00043             kPViewItemClass,
00044             kPViewItemName,
00045             kParticleViewOpenCloseToggle,
00046             kParticleFlowActivationToggle
00047     }; 
00048 
00049     BEGIN_FUNCTION_MAP
00050     FN_1(kOpenParticleView, TYPE_bool, OpenParticleView, TYPE_OBJECT);
00051     FN_1(kUpdateParticleViews, TYPE_bool, UpdateParticleViews, TYPE_bool);
00052     FN_1(kPreUpdateParticleViews, TYPE_bool, PreUpdateParticleViews, TYPE_bool);
00053     FN_1(kPostUpdateParticleViews, TYPE_bool, PostUpdateParticleViews, TYPE_bool);
00054     FN_0(kUpdateOnHold, TYPE_bool, UpdateOnHold);
00055     FN_0(kNumActionClasses, TYPE_INT, NumActionClasses );
00056     FN_1(kActionClass, TYPE_CLASS, ActionClass, TYPE_INT);
00057     FN_1(kActionName, TYPE_STRING, ActionName, TYPE_INT);
00058     FN_0(kNumPViewItemClasses, TYPE_INT, NumPViewItemClasses );
00059     FN_1(kPViewItemClass, TYPE_CLASS, PViewItemClass, TYPE_INT);
00060     FN_1(kPViewItemName, TYPE_STRING, PViewItemName, TYPE_INT);
00061     FN_0(kParticleViewOpenCloseToggle, TYPE_bool, ParticleViewOpenCloseToggle);
00062     FN_1(kParticleFlowActivationToggle, TYPE_bool, ParticleFlowActivationToggle, TYPE_bool);
00063     END_FUNCTION_MAP
00064 
00075     virtual bool    OpenParticleView(Object* engine) = 0;
00076 
00080     virtual bool    UpdateParticleViews(bool additionsOnly=false) = 0;
00081 
00086     virtual bool    PreUpdateParticleViews(bool additionsOnly=false) = 0;
00087 
00092     virtual bool    PostUpdateParticleViews(bool additionsOnly=false) = 0;
00093 
00097     virtual bool    CancelUpdateParticleViews() = 0;
00098 
00102     virtual bool    UpdateOnHold() = 0;
00103 
00107     virtual void    UpdateParticleAmountShown() { ; }
00108 
00112     #pragma warning(push)
00113     #pragma warning(disable:4100)
00114     virtual void    ActionProceedBegin(INode* actionNode) { ; }
00115 
00119     virtual void    ActionProceedEnd(INode* actionNode) { ; } 
00120     #pragma warning(pop)
00121 
00124     virtual bool    IsParticleViewInForeground() { return false; }
00125 
00129     PFExport static int NumActionClasses(); // public classes only
00130 
00134     PFExport static ClassDesc* ActionClass(int index);
00135 
00139     PFExport static MCHAR* ActionName(int index);
00140 
00144     PFExport static int NumPViewItemClasses(); 
00145 
00149     PFExport static ClassDesc* PViewItemClass(int index);
00150 
00154     PFExport static MCHAR* PViewItemName(int index);
00155 
00159     virtual bool ParticleViewOpenCloseToggle() = 0;
00160 
00164     virtual bool ParticleFlowActivationToggle(bool selectedOnly=false) = 0;
00165 
00170     virtual int GetVacantSpace() = 0;
00171 
00181     virtual void KeepMaterial(Mtl* mtl) = 0;
00182 
00189     PFExport static void RegisterModule(Class_ID moduleID);
00190 
00194     PFExport static bool IsModuleRegistered(Class_ID moduleID);
00195 
00199     FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWMANAGER_INTERFACE); }
00200 
00205     friend PFExport IPViewManager* GetPViewManager();
00206     friend PFExport void ReleasePViewManager();
00207     
00210 protected:
00211     PFExport IPViewManager();
00212     PFExport virtual ~IPViewManager();
00213 
00214     virtual void releaseManager() = 0;
00215 
00216     static IPViewManager* m_manager; // the one and only PViewManager in the scene
00217     static Tab<ClassEntry*> m_actionClasses;
00218     static Tab<ClassEntry*> m_pViewItemClasses;
00219     static Tab<Class_ID> m_registeredModules;
00220 };
00221 
00222 #define PFTOOLSBOX1_MODULE_CLASSID          Class_ID(0x13410824, 0x88cd3e26)
00223 #define PFTOOLSBOX1CHANNELS_MODULE_CLASSID  Class_ID(0x00358976, 0xf7f26da4)
00224 
00225 
00233 PFExport IPViewManager* GetPViewManager();
00234 
00239 PFExport   INode *CreatePFNode( Object *obj);
00240 
00249 PFExport   void DeletePFNode(INode* node);
00250 
00257 PFExport bool AppendPFAction(INode* actionList, INode* action);
00258 
00262 PFExport bool InsertPFAction(INode* actionList, INode* action, int indexAt);
00263 
00267 PFExport bool RemovePFAction(INode* actionList, int index);
00268 
00272 PFExport bool RemovePFAction(INode* actionList, INode* action);
00273 
00280 PFExport int GetPViewVacantSpace(INode* excludeNode=NULL);
00281 
00286 PFExport int GetPViewMaximumZOrderIndex(INode* excludeNode=NULL);
00287 
00293 PFExport bool CompactPViewZOrder();
00294 
00302 PFExport void RegisterParticleFlowNotification();
00303 
00307 PFExport void SuspendParticleFlowNotification();
00308 
00312 PFExport void ResumeParticleFlowNotification();
00313 
00317 PFExport bool IsParticleFlowNotificationSuspended();
00318 
00323 PFExport void ReleasePViewManager();
00324 
00330 PFExport int GetPFInt(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
00331 
00335 PFExport float GetPFFloat(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
00336 
00340 PFExport TimeValue GetPFTimeValue(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
00341 
00348 PFExport bool ValidateParticleFlows();
00349 
00350 enum { kPFDefaultDisplay_global, kPFDefaultDisplay_local };
00351 
00355 PFExport int GetPFDefaultDisplay();
00356 
00360 PFExport void SetPFDefaultDisplay(int type);
00361 
00365 PFExport void InitPFDefaultDisplay(int type);
00366 
00367 enum { kPFActionOrder_globalsFirst, kPFActionOrder_localsFirst };
00368 
00372 PFExport int GetPFActionOrder();
00373 
00377 PFExport void SetPFActionOrder(int order);
00378 
00382 PFExport void InitPFActionOrder(int order);
00383 
00384 // PF particle system has different modes for update. 
00385 // Forward mode: particles aren't updated right away. At playback time the particle history is
00386 // not recalculated. Only new events that will happen with the particles have new settings
00387 // Complete mode: the whole particle animation is recalculated. 
00388 enum { kPFUpdateType_complete, kPFUpdateType_forward };
00389 
00393 PFExport int GetPFUpdateType();
00394 
00398 PFExport void SetPFUpdateType(int type);
00399 
00403 PFExport void InitPFUpdateType(int type);
00404 
00405 // names of actions in PView may have a dynamic suffix to reflect the most important settings of the action
00406 enum { kPFDynamicNames_no, kPFDynamicNames_yes };
00407 
00411 PFExport int GetPFDynamicNames();
00412 
00416 PFExport void SetPFDynamicNames(int type);
00417 
00421 PFExport void InitPFDynamicNames(int type);
00422 
00432 PFExport void DisableParticleInvalidation();
00433 
00437 PFExport void EnableParticleInvalidation();
00438 
00442 PFExport bool IsAbleInvalidateParticles();
00443 
00447 PFExport void SetIgnoreEmitterTMChange();
00448 
00452 PFExport void ClearIgnoreEmitterTMChange();
00453 
00457 PFExport bool IsIgnoringEmitterTMChange();
00458 
00462 PFExport void SetIgnoreEmitterPropChange();
00463 
00467 PFExport void ClearIgnoreEmitterPropChange();
00468 
00472 PFExport bool IsIgnoringEmitterPropChange();
00473 
00477 PFExport void SetIgnoreRefNodeChange();
00478 
00482 PFExport void ClearIgnoreRefNodeChange();
00483 
00487 PFExport bool IsIgnoringRefNodeChange();
00488 
00493 PFExport void SetPFProceedStatus();
00494 
00499 PFExport void ClearPFProceedStatus();
00500 
00505 PFExport bool IsPFProceeding(); 
00506 
00512 PFExport Object* GetPFObject(Object* obj);
00513 
00514 // constants for particle view spacement and location
00515 enum { kPViewActionListHorSpace=20 };
00516