IPFTest.h

Go to the documentation of this file.
00001 
00004 /**********************************************************************
00005  *<
00006     CREATED BY: Oleg Bayborodin
00007 
00008     HISTORY: created 10-12-01
00009 
00010  *> Copyright (c) 2001, All Rights Reserved.
00011  **********************************************************************/
00012 
00013 #pragma once
00014 
00015 #include "PFExport.h"
00016 #include "PreciseTimeValue.h"
00017 #include "..\object.h"
00018 // forward declarations
00019 class IPFIntegrator;
00020 
00021 PFExport Object* GetPFObject(Object* obj);
00022 // interface ID
00023 #define PFTEST_INTERFACE Interface_ID(0x74f93d02, 0x1eb34500) 
00024 #define GetPFTestInterface(obj) ((IPFTest*)((GetPFObject(obj))->GetInterface(PFTEST_INTERFACE))) 
00025 
00026 class IPFTest : public FPMixinInterface
00027 {
00028 public:
00029 
00030     // function IDs
00031     enum {  kProceedStep1,
00032             kProceedStep2,
00033             kGetNextActionList,
00034             kSetNextActionList,
00035             kSetLinkActive,
00036             kClearNextActionList
00037     }; 
00038 
00039     // Function Map for Function Publish System 
00040     //***********************************
00041     BEGIN_FUNCTION_MAP
00042 
00043     VFN_5(kProceedStep1, ProceedStep1, TYPE_IOBJECT, TYPE_OBJECT, TYPE_INODE, TYPE_INODE, TYPE_INTERFACE);
00044     FN_6(kProceedStep2, TYPE_bool, ProceedStep2, TYPE_TIMEVALUE, TYPE_FLOAT, TYPE_TIMEVALUE_BR, TYPE_FLOAT_BR, TYPE_BITARRAY_BR, TYPE_FLOAT_TAB_BR);
00045     FN_2(kGetNextActionList, TYPE_INODE, GetNextActionList, TYPE_INODE, TYPE_bool_BP );
00046     FN_2(kSetNextActionList, TYPE_bool, SetNextActionListMXS, TYPE_INODE, TYPE_INODE);
00047     FN_2(kSetLinkActive, TYPE_bool, SetLinkActive, TYPE_bool, TYPE_INODE);
00048     FN_1(kClearNextActionList, TYPE_bool, ClearNextActionList, TYPE_INODE);
00049 
00050     END_FUNCTION_MAP
00051 
00059     PFExport IPFTest();
00060 
00107     virtual bool    Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd, 
00108                             Object* pSystem, INode* pNode, INode* actionNode, IPFIntegrator* integrator, 
00109                             BitArray& testResult, Tab<float>& testTime) = 0;
00110 
00115     virtual void ProceedStep1(IObject* pCont, Object* pSystem, INode* pNode, INode* actionNode, FPInterface* integrator) = 0;
00116 
00123     virtual bool ProceedStep2(TimeValue timeStartTick, float timeStartFraction, 
00124                             TimeValue& timeEndTick, float& timeEndFraction, 
00125                             BitArray& testResult, Tab<float>& testTime) = 0;
00126 
00132     PFExport INode* GetNextActionList(INode* test, bool* linkActive=NULL);
00133 
00138     PFExport bool SetNextActionList(INode* nextAL, INode* test);
00139 
00143     PFExport bool SetNextActionListMXS(INode* nextAL, INode* test);
00144 
00148     PFExport bool SetLinkActive(bool active, INode* test);
00149 
00154     PFExport bool ClearNextActionList(INode* test);
00155 
00159     FPInterfaceDesc* GetDesc() { return GetDescByID(PFTEST_INTERFACE); }
00160 
00164     inline void updateNextActionListValue(INode* nextAL) { m_nextActionList = nextAL; }
00165 
00169     inline void updateArrowValue(Object* arrow) { m_arrow = arrow; }
00170 
00174     inline void updateLinkActiveValue(bool linkActive) { m_linkActive = linkActive; }
00175 
00176 protected:
00177     INode*  m_nextActionList; // an actionList node for the next event.
00178     Object* m_arrow; // an arrow object that controls the gate to the next ActionList
00179     bool    m_linkActive; // status of the link to the next ActionList
00180 };
00181 
00182 inline IPFTest* PFTestInterface(Object* obj) {
00183     return ((obj == NULL) ? NULL : GetPFTestInterface(obj));
00184 };
00185 
00186 inline IPFTest* PFTestInterface(INode* node) {
00187     return ((node == NULL) ? NULL : PFTestInterface(node->GetObjectRef()));
00188 };
00189