IParticleChannelMap.h

Go to the documentation of this file.
00001 
00006 /**********************************************************************
00007  *<
00008     CREATED BY: Oleg Bayborodin
00009 
00010     HISTORY: created 06-17-02
00011 
00012  *> Copyright (c) 2001, All Rights Reserved.
00013  **********************************************************************/
00014 #pragma once
00015 
00016 #include "PFExport.h"
00017 #include "..\ifnpub.h"
00018 #include "IParticleChannelTabUVVert.h"
00019 #include "IParticleChannelTabTVFace.h"
00020 
00021 // interface for map channel; Mesh Map object may contain several map channels
00022 // interface ID
00023 #define PARTICLECHANNELMAPR_INTERFACE Interface_ID(0x74f93c16, 0x1eb34500)
00024 #define PARTICLECHANNELMAPW_INTERFACE Interface_ID(0x74f93c16, 0x1eb34501)
00025 
00026 #define GetParticleChannelMapRInterface(obj) ((IParticleChannelMapR*)obj->GetInterface(PARTICLECHANNELMAPR_INTERFACE))
00027 #define GetParticleChannelMapWInterface(obj) ((IParticleChannelMapW*)obj->GetInterface(PARTICLECHANNELMAPW_INTERFACE))
00028 
00029 class IParticleChannelMapR : public FPMixinInterface
00030 {
00031 public:
00039     bool        IsShared() const { return (IsUVVertShared() || IsTVFaceShared()); }
00040 
00044     virtual bool IsUVVertShared() const = 0;
00045 
00049     virtual bool IsTVFaceShared() const = 0;
00050 
00054     virtual int GetUVVertCount() const = 0;
00055 
00059     virtual int GetUVVertIndex(int particleIndex) const = 0;
00060 
00064     virtual const TabUVVert* GetUVVertByIndex(int valueIndex) const = 0;
00065 
00069     virtual const TabUVVert* GetUVVert(int particleIndex) const = 0;
00070 
00074     virtual const TabUVVert* GetUVVert() const = 0;
00075 
00079     virtual int GetTVFaceCount() const = 0;
00080 
00088     virtual int GetTVFaceIndex(int particleIndex) const = 0;
00089 
00093     virtual const TabTVFace* GetTVFaceByIndex(int valueIndex) const = 0;
00094 
00098     virtual const TabTVFace* GetTVFace(int particleIndex) const = 0;
00099 
00103     virtual const TabTVFace* GetTVFace() const = 0;
00104 
00108     virtual void Apply(Mesh* mesh, int particleIndex, int mp) const = 0;
00109 
00113     FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMAPR_INTERFACE); }
00114 };
00115 
00116 class IParticleChannelMapW : public FPMixinInterface
00117 {
00118 public:
00126     virtual bool SetUVVert(int particleIndex, const UVVert& value) = 0;
00127 
00131     virtual bool SetUVVert(int particleIndex, const TabUVVert* tab) = 0;
00132 
00136     virtual bool SetUVVert(Tab<int>& particleIndices, const UVVert& value) = 0;
00137 
00141     virtual bool SetUVVert(Tab<int>& particleIndices, const TabUVVert* tab) = 0;
00142 
00146     virtual bool SetUVVert(const UVVert& value) = 0;
00147 
00151     virtual bool SetUVVert(const TabUVVert* tab) = 0;
00152 
00156     virtual bool    CopyUVVert(int fromParticle, int toParticle) = 0;
00157 
00161     virtual bool    CopyUVVert(int fromParticle, Tab<int>& toParticles) = 0;
00162 
00166     virtual bool    CopyUVVert(int fromParticle) = 0;
00167 
00171     virtual bool SetTVFace(int particleIndex, const TabTVFace* tab) = 0;
00172 
00176     virtual bool SetTVFace(Tab<int>& particleIndices, const TabTVFace* tab) = 0;
00177 
00181     virtual bool SetTVFace(const TabTVFace* tab) = 0;
00182 
00186     virtual bool    CopyTVFace(int fromParticle, int toParticle) = 0;
00187 
00191     virtual bool    CopyTVFace(int fromParticle, Tab<int>& toParticles) = 0;
00192 
00196     virtual bool    CopyTVFace(int fromParticle) = 0;
00197 
00201     virtual IObject* GetUVVertChannel() const = 0;
00202 
00206     virtual IObject* GetTVFaceChannel() const = 0;
00207 
00211     bool SetMap(int particleIndex, const UVVert& value)
00212     { return (SetUVVert(particleIndex, value) && SetTVFace(NULL)); }
00213 
00217     bool SetMap(int particleIndex, const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
00218     { return (SetUVVert(particleIndex, tabUVVert) && SetTVFace(particleIndex, tabTVFace)); }
00219 
00223     bool SetMap(Tab<int>& particleIndices, const UVVert& value)
00224     { return (SetUVVert(particleIndices, value) && SetTVFace(particleIndices, NULL)); }
00225 
00229     bool SetMap(Tab<int>& particleIndices, const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
00230     { return (SetUVVert(particleIndices, tabUVVert) && SetTVFace(particleIndices, tabTVFace)); }
00231 
00235     bool SetMap(const UVVert& value)
00236     { return (SetUVVert(value) && SetTVFace(NULL)); }
00237 
00241     bool SetMap(const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
00242     { return (SetUVVert(tabUVVert) && SetTVFace(tabTVFace)); }
00243 
00247     bool    CopyMap(int fromParticle, int toParticle)
00248     { return (CopyUVVert(fromParticle, toParticle) && CopyTVFace(fromParticle, toParticle)); }
00249 
00253     bool    CopyMap(int fromParticle, Tab<int>& toParticles)
00254     { return (CopyUVVert(fromParticle, toParticles) && CopyTVFace(fromParticle, toParticles)); }
00255 
00259     bool    CopyMap(int fromParticle)
00260     { return (CopyUVVert(fromParticle) && CopyTVFace(fromParticle)); }
00261 
00265     FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMAPW_INTERFACE); }
00266 };
00267 
00268