IParticleChannelPoint3.h

Go to the documentation of this file.
00001 
00004 /**********************************************************************
00005  *<
00006     CREATED BY: Oleg Bayborodin
00007 
00008     HISTORY: created 11-29-01
00009 
00010  *> Copyright (c) 2001, All Rights Reserved.
00011  **********************************************************************/
00012 
00013 #pragma once
00014 
00015 #include "PFExport.h"
00016 #include "..\ifnpub.h"
00017 // forward declarations
00018 class Box3;
00019 
00020 // generic particle channel "Point3"
00021 // interface ID
00022 #define PARTICLECHANNELPOINT3R_INTERFACE Interface_ID(0x74f93c03, 0x1eb34500)
00023 #define PARTICLECHANNELPOINT3W_INTERFACE Interface_ID(0x74f93c03, 0x1eb34501)
00024 
00025 // since it's a "type" channel there is no "GetChannel" defines
00026 //#define GetParticleChannelPoint3RInterface(obj) ((IParticleChannelPoint3R*)obj->GetInterface(PARTICLECHANNELPOINT3R_INTERFACE))
00027 //#define GetParticleChannelPoint3WInterface(obj) ((IParticleChannelPoint3W*)obj->GetInterface(PARTICLECHANNELPOINT3W_INTERFACE))
00028 
00029 
00030 class IParticleChannelPoint3R : public FPMixinInterface
00031 {
00032 public:
00033 
00034     // function IDs Read
00035     enum {  kGetValue,
00036             kIsGlobal,
00037             kGetValueGlobal,
00038             kGetBoundingBox,
00039             kGetMaxLengthValue
00040     };
00041 
00042     // Function Map for Function Publish System
00043     //***********************************
00044     BEGIN_FUNCTION_MAP
00045 
00046     FN_1(kGetValue, TYPE_POINT3_BR, GetValue, TYPE_INT);
00047     FN_0(kIsGlobal, TYPE_bool, IsGlobal);
00048     FN_0(kGetValueGlobal, TYPE_POINT3_BR, GetValue);
00049     VFN_2(kGetBoundingBox, GetBoundingBox, TYPE_POINT3_BR, TYPE_POINT3_BR);
00050     FN_0(kGetMaxLengthValue, TYPE_FLOAT, GetMaxLengthValue);
00051 
00052     END_FUNCTION_MAP
00053 
00054     // get property for particle with index
00055     virtual const Point3&   GetValue(int index) const = 0;
00056     // verify if the channel is global
00057     virtual bool            IsGlobal() const = 0;
00058     // if channel is global returns the global value
00059     // if channel is not global returns value of the first particle
00060     virtual const Point3&   GetValue() const = 0;
00061     // returns bounding box for all particles
00062     virtual const Box3&     GetBoundingBox() const = 0;
00063     // FnPub alternative for the method above
00064     PFExport void           GetBoundingBox(Point3& corner1, Point3& corner2) const;
00065     // returns maximum length of 3D vector of all particles
00066     virtual float           GetMaxLengthValue() const = 0;
00067 
00068     FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELPOINT3R_INTERFACE); }
00069 };
00070 
00071 class IParticleChannelPoint3W : public FPMixinInterface
00072 {
00073 public:
00074 
00075     // function IDs Write
00076     enum {  kSetValue,
00077             kSetValueGlobal,
00078             kBuildBoundingBox,
00079             kUpdateMaxLengthValue
00080     };
00081 
00082     // Function Map for Function Publish System
00083     //***********************************
00084     BEGIN_FUNCTION_MAP
00085 
00086     VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_POINT3_BR);
00087     VFN_1(kSetValueGlobal, SetValue, TYPE_POINT3_BR);
00088     VFN_0(kBuildBoundingBox, BuildBoundingBox);
00089     VFN_0(kUpdateMaxLengthValue, UpdateMaxLengthValue);
00090 
00091     END_FUNCTION_MAP
00092 
00093     // set property for particle with index
00094     virtual void    SetValue(int index, const Point3& v) = 0;
00095     // set property for all particles at once thus making the channel global
00096     virtual void    SetValue(const Point3& v) = 0;
00097     // build bounding box for 3D vector data of all particles
00098     virtual void    BuildBoundingBox() = 0;
00099     // update maximum length value for 3d vector data of all particles
00100     virtual void    UpdateMaxLengthValue() = 0;
00101 
00102     FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELPOINT3W_INTERFACE); }
00103 };
00104