Go
to the documentation of this file.
00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #pragma once
00017
00018 #include "PFExport.h"
00019 #include <WTypes.h>
00020 #include "..\MaxHeap.h"
00021
00022 class Interface_ID;
00023
00024
00025 enum PCU_genericChannelIndex {
00026 PCG_float= 1<<0,
00027 PCG_int= 1<<1,
00028
00029 PCG_Point3= 1<<3,
00030 PCG_bool= 1<<4,
00031
00032
00033 PCG_PTV= 1<<7,
00034
00035 PCG_INode= 1<<9,
00036 PCG_Matrix3= 1<<10,
00037 PCG_void= 1<<11,
00038
00039 PCG_AngAxis= 1<<13,
00040 PCG_Quat= 1<<14,
00041
00042
00043 PCG_Mesh= 1<<17,
00044
00045
00046 PCG_TabUVVert= 1<<20,
00047 PCG_TabTVFace= 1<<21,
00048 PCG_Map= 1<<22,
00049 PCG_MeshMap= 1<<23
00050 };
00051
00052
00053
00054
00055
00056 enum PCU_channelIndex {
00057 PCU_Undefined= 0,
00058 PCU_Amount= 1<<0,
00059 PCU_New= 1<<1,
00060 PCU_ID= 1<<2,
00061 PCU_Time= 1<<3,
00062 PCU_BirthTime= 1<<4,
00063 PCU_EventStart= 1<<5,
00064 PCU_Position= 1<<6,
00065 PCU_Speed= 1<<7,
00066 PCU_Acceleration= 1<<8,
00067 PCU_Orientation= 1<<9,
00068 PCU_Spin= 1<<10,
00069 PCU_Scale= 1<<11,
00070 PCU_Shape= 1<<12,
00071
00072
00073
00074 PCU_ShapeTexture= 1<<16,
00075
00076 PCU_MtlIndex= 1<<18,
00077 PCU_Selection= 1<<19,
00078 PCU_MXSInteger= 1<<20,
00079 PCU_MXSFloat= 1<<21,
00080 PCU_MXSVector= 1<<22,
00081 PCU_MXSMatrix= 1<<23,
00082 PCU_DeathTime= 1<<24,
00083 PCU_Lifespan= 1<<25
00084 };
00085
00086 class ParticleChannelMask: public MaxHeapOperators
00087 {
00088 public:
00089
00097 PFExport ParticleChannelMask();
00098
00102 PFExport ParticleChannelMask(const ParticleChannelMask&);
00103
00107 PFExport ParticleChannelMask(DWORD readMask, DWORD writeMask);
00108
00112 PFExport ParticleChannelMask& operator=(const ParticleChannelMask&);
00113
00117 PFExport ~ParticleChannelMask();
00118
00122 PFExport int operator==(const ParticleChannelMask&) const;
00123
00127 PFExport int operator!=(const ParticleChannelMask&) const;
00128
00132 PFExport void SetReadChannels(DWORD channelsFlag);
00133
00137 PFExport void SetWriteChannels(DWORD channelsFlag);
00138
00142 PFExport bool SetChannels(int numChannels, Interface_ID* channels);
00143
00147 PFExport void AddReadChannels(DWORD channelsFlag);
00148
00152 PFExport void RemoveReadChannels(DWORD channelsFlag);
00153
00157 PFExport void AddWriteChannels(DWORD channelsFlag);
00158
00162 PFExport void RemoveWriteChannels(DWORD channelsFlag);
00163
00167 PFExport bool AddChannel(Interface_ID& channel);
00168
00172 PFExport bool RemoveChannel(Interface_ID& channel);
00173
00177 PFExport const int GetNumChannels() const;
00178
00182 PFExport const Interface_ID GetChannel(int i) const;
00183
00187 PFExport const bool HasChannel(Interface_ID& channel) const;
00188
00192 PFExport const bool HasReadChannels(DWORD channelsFlag) const;
00193
00197 PFExport const bool HasWriteChannels(DWORD channelsFlag) const;
00198
00202 PFExport static int NumStandardParticleChannels();
00203
00207 PFExport static const ParticleChannelMask& Null();
00208
00209 private:
00210
00211
00212 PFExport static const PCU_channelIndex InterfaceID2readIndex(Interface_ID& id);
00213 PFExport static const PCU_channelIndex InterfaceID2writeIndex(Interface_ID& id);
00214
00215 PFExport static const Interface_ID readIndex2InterfaceID(PCU_channelIndex index);
00216 PFExport static const Interface_ID writeIndex2InterfaceID(PCU_channelIndex index);
00217
00218 void invalidateNumSRChannels() { _numSRChannelsValid() = false; }
00219 void invalidateNumSWChannels() { _numSWChannelsValid() = false; }
00220
00221
00222 const DWORD readFlag() const { return m_readFlag; }
00223 const DWORD writeFlag() const { return m_writeFlag; }
00224 const bool numSRChannelsValid() const { return m_numSRChannelsValid; }
00225 const bool numSWChannelsValid() const { return m_numSWChannelsValid; }
00226 const int numStandardReadChannels() const;
00227 const int numStandardWriteChannels() const;
00228 const int numCustomChannels() const { return m_numCustomChannels; }
00229 const Interface_ID* customChannels() const { return m_customChannels; }
00230
00231
00232 DWORD& _readFlag() { return m_readFlag; }
00233 DWORD& _writeFlag() { return m_writeFlag; }
00234 bool& _numSRChannelsValid() { return m_numSRChannelsValid; }
00235 bool& _numSWChannelsValid() { return m_numSWChannelsValid; }
00236 int& _numStandardReadChannels() { return m_numStandardReadChannels; }
00237 int& _numStandardWriteChannels() { return m_numStandardWriteChannels; }
00238 int& _numCustomChannels() { return m_numCustomChannels; }
00239 Interface_ID*& _customChannels() { return m_customChannels; }
00240
00241
00242 protected:
00243
00244 DWORD m_readFlag, m_writeFlag;
00245 mutable bool m_numSRChannelsValid, m_numSWChannelsValid;
00246 mutable int m_numStandardReadChannels, m_numStandardWriteChannels;
00247 int m_numCustomChannels;
00248 Interface_ID *m_customChannels;
00249 const static DWORD kChannelsCast;
00250 const static int kNumStandardParticleChannels;
00251 const static ParticleChannelMask kNull;
00252 };
00253