IParticleChannelPTV.h

Go to the documentation of this file.
00001 
00007 /**********************************************************************
00008  *<
00009     CREATED BY: Oleg Bayborodin
00010 
00011     HISTORY: created 11-29-01
00012 
00013  *> Copyright (c) 2001, All Rights Reserved.
00014  **********************************************************************/
00015 
00016 #pragma once
00017 #include "..\ifnpub.h"
00018 #include "PreciseTimeValue.h"
00019 
00020 // generic particle channel "PTV" : PreciseTimeValue
00021 // interface ID
00022 #define PARTICLECHANNELPTVR_INTERFACE Interface_ID(0x74f93c07, 0x1eb34500) 
00023 #define PARTICLECHANNELPTVW_INTERFACE Interface_ID(0x74f93c07, 0x1eb34501) 
00024 
00025 // since it's a "type" channel there is no "GetChannel" defines
00026 //#define GetParticleChannelPTVRInterface(obj) ((IParticleChannelPTVR*)obj->GetInterface(PARTICLECHANNELPTVR_INTERFACE)) 
00027 //#define GetParticleChannelPTVWInterface(obj) ((IParticleChannelPTVW*)obj->GetInterface(PARTICLECHANNELPTVW_INTERFACE)) 
00028 
00029 
00030 class IParticleChannelPTVR : public FPMixinInterface
00031 {
00032 public:
00033 
00034     // function IDs Read
00035     enum {  kGetTick, 
00036             kGetFraction,
00037             kGetTickFraction,
00038             kIsSync
00039     }; 
00040 
00041     // Function Map for Function Publish System 
00042     //***********************************
00043     BEGIN_FUNCTION_MAP
00044 
00045     FN_1(kGetTick, TYPE_TIMEVALUE, GetTick, TYPE_INT);
00046     FN_1(kGetFraction, TYPE_FLOAT, GetFraction, TYPE_INT);
00047     VFN_3(kGetTickFraction, GetTickFraction, TYPE_INT, TYPE_TIMEVALUE_BR, TYPE_FLOAT_BR);
00048     FN_0(kIsSync, TYPE_bool, IsSync);
00049 
00050     END_FUNCTION_MAP
00051 
00059     virtual TimeValue   GetTick(int index) const = 0;
00060 
00064     virtual float       GetFraction(int index) const = 0;
00065 
00069     virtual void        GetTickFraction(int index, TimeValue& tick, float& fraction) const = 0;
00070 
00074     virtual bool        IsSync() const = 0;  
00075     
00079     virtual const PreciseTimeValue& GetValue(int index) const = 0;
00080 
00085     virtual const PreciseTimeValue& GetValue() const = 0;
00086 
00090     FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELPTVR_INTERFACE); }
00093 };
00094 
00095 class IParticleChannelPTVW : public FPMixinInterface
00096 {
00097 public:
00098 
00099     // function IDs Write
00100     enum {  kSetTick,
00101             kSetFraction,
00102             kSetTickFraction,
00103     }; 
00104 
00105 
00106     BEGIN_FUNCTION_MAP
00107 
00108     VFN_2(kSetTick, SetTick, TYPE_INT, TYPE_TIMEVALUE);
00109     VFN_2(kSetFraction, SetFraction, TYPE_INT, TYPE_FLOAT);
00110     VFN_3(kSetTickFraction, SetTickFraction, TYPE_INT, TYPE_TIMEVALUE, TYPE_FLOAT);
00111 
00112     END_FUNCTION_MAP
00113 
00114     // set particle property
00115     virtual void    SetTick(int index, TimeValue time) = 0;
00116     virtual void    SetFraction(int index, float time) = 0;
00117     virtual void    SetTickFraction(int index, TimeValue tick, float fraction) = 0;
00118 
00119 // methods not in the mapped interface
00120     virtual void    SetValue(int index, const PreciseTimeValue& time) = 0;
00121     // set synchronized time for all particles
00122     virtual void    SetValue(const PreciseTimeValue& time) = 0;
00123 
00124     FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELPTVW_INTERFACE); }
00125 };
00126