IParticleChannelID.h

Go to the documentation of this file.
00001 
00020 /**********************************************************************
00021  *<
00022     CREATED BY: Oleg Bayborodin
00023 
00024     HISTORY: created 10-04-01
00025 
00026  *> Copyright (c) 2001, All Rights Reserved.
00027  **********************************************************************/
00028 
00029 #pragma once
00030 #include "..\maxheap.h"
00031 #include "..\ifnpub.h"
00032 
00033 
00034 // standard particle channel "particleID"
00035 // interface ID
00036 #define PARTICLECHANNELIDR_INTERFACE Interface_ID(0x74f93b02, 0x1eb34500) 
00037 #define PARTICLECHANNELIDW_INTERFACE Interface_ID(0x74f93b02, 0x1eb34501) 
00038 
00039 #define GetParticleChannelIDRInterface(obj) ((IParticleChannelIDR*)obj->GetInterface(PARTICLECHANNELIDR_INTERFACE)) 
00040 #define GetParticleChannelIDWInterface(obj) ((IParticleChannelIDW*)obj->GetInterface(PARTICLECHANNELIDW_INTERFACE)) 
00041 
00042 // function IDs Read
00043 enum {  particleChannelID_getID, 
00044         particleChannelID_getParticleIndex,
00045         particleChannelID_getParticleBorn
00046 }; 
00047 
00048 // function IDs Write
00049 enum {  particleChannelID_setID
00050 }; 
00051 
00052 struct ParticleID: public MaxHeapOperators {
00053     int index;
00054     int born;
00055 };
00056 
00057 class IParticleChannelIDR : public FPMixinInterface
00058 {
00059 
00060 BEGIN_FUNCTION_MAP
00061 
00062 VFN_3(particleChannelID_getID, GetID, TYPE_INT, TYPE_INT_BR, TYPE_INT_BR);
00063 FN_1(particleChannelID_getParticleIndex, TYPE_INT, GetParticleIndex, TYPE_INT);
00064 FN_1(particleChannelID_getParticleBorn, TYPE_INT, GetParticleBorn, TYPE_INT);
00065 
00066 END_FUNCTION_MAP
00067 
00068 public:
00069 
00077     virtual void    GetID(int index, int& particleIndex, int& particleBorn) const = 0;
00078 
00082     virtual int     GetParticleIndex(int index) const = 0; // returns particleIndex
00083 
00087     virtual int     GetParticleBorn(int index) const = 0; // returns particleBorn
00088 
00092     virtual const ParticleID& GetID(int index) const = 0;
00093 
00097     FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELIDR_INTERFACE); }
00098 };
00099 
00100 class IParticleChannelIDW : public FPMixinInterface
00101 {
00102 
00103 BEGIN_FUNCTION_MAP
00104 
00105 VFN_3(particleChannelID_setID, SetID, TYPE_INT, TYPE_INT, TYPE_INT);
00106 
00107 END_FUNCTION_MAP
00108 
00109 public:
00110 
00118     virtual void SetID(int index, int particleIndex, int particleBorn) = 0;
00119 
00123     virtual void SetID(int index, const ParticleID& id) = 0;
00124 
00128     FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELIDW_INTERFACE); }
00129 };
00130