added everything

This commit is contained in:
Metario
2017-04-17 06:17:10 -06:00
commit 9c6ff74f19
6121 changed files with 1625704 additions and 0 deletions

View File

@ -0,0 +1,66 @@
/**********************************************************************
*<
FILE: CreatedChannelLinker.h
DESCRIPTION: Class definitions for CreatedChannelLinker
CreatedChannelLinker keeps track of all channels created for
a specific particle container. If an action creates a channel
only under certain condition (for example, if the channel
doesn't exists) then it's the action responsibility to
initialized channel value for all new particles. Therefore
the action should keep track of all channels created by the
action. The class makes this task easier.
CREATED BY: Oleg Bayborodin
HISTORY: created 03-11-2002
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _CREATEDCHANNELLINKER_H
#define _CREATEDCHANNELLINKER_H
#include "max.h"
#include "PFExport.h"
namespace PF {
class CreatedChannelLinker {
public:
PFExport CreatedChannelLinker();
PFExport ~CreatedChannelLinker();
// to indicated that the channel was created in this container
PFExport bool RegisterCreatedChannel(IObject* pCont, Interface_ID channelID);
// to unregister all created channels in the container
PFExport void Release(IObject* pCont);
// verify if the channel was created for the container
PFExport bool IsCreatedChannel(IObject* pCont, Interface_ID channelID) const;
private:
// const access to class members
const Tab<IObject*>& particleContainers() const { return m_particleContainers; }
IObject* particleContainer(int index) const { return m_particleContainers[index]; }
const Tab<Interface_ID>& IDs() const { return m_IDs; }
Interface_ID ID(int index) const { return m_IDs[index]; }
// access to class members
Tab<IObject*>& _particleContainers() { return m_particleContainers; }
IObject*& _particleContainer(int index) { return m_particleContainers[index]; }
Tab<Interface_ID>& _IDs() { return m_IDs; }
Interface_ID& _ID(int index) { return m_IDs[index]; }
protected:
Tab<IObject*> m_particleContainers;
Tab<Interface_ID> m_IDs;
};
} // end of namespace PF
#endif // _CREATEDCHANNELLINKER_H_

View File

@ -0,0 +1,190 @@
/*! \file IChannelContainer.h
\brief An interface to manage channels in ParticleContainer.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-10-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _ICHANNELCONTAINER_H_
#define _ICHANNELCONTAINER_H_
#include "Max.h"
// interface ID
#define CHANNELCONTAINER_INTERFACE Interface_ID(0x74f93c00, 0x1eb34600)
#define GetChannelContainerInterface(obj) ((IChannelContainer*)obj->GetInterface(CHANNELCONTAINER_INTERFACE))
class IChannelContainer : public FPMixinInterface
{
public:
// function IDs
enum {
// kNumChannels,
// kGetChannel,
kGetPublicChannel,
kGetPrivateChannel,
kAddChannel
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
// FN_0(kNumChannels, TYPE_INT, NumChannels);
// FN_1(kGetChannel, TYPE_IOBJECT, GetChannel, TYPE_INT);
FN_2(kGetPublicChannel, TYPE_IOBJECT, GetPublicChannel, TYPE_INT, TYPE_INT);
FN_4(kGetPrivateChannel, TYPE_IOBJECT, GetPrivateChannel, TYPE_INT, TYPE_INT, TYPE_OBJECT, TYPE_INODE);
FN_1(kAddChannel, TYPE_bool, AddChannel, TYPE_IOBJECT);
END_FUNCTION_MAP
/** @defgroup IChannelContainer IChannelContainer.h
* @{
*/
/*! \fn virtual Class_ID GetClassID() = 0;
* \brief Returns the unique ID for the particle container class. ID is used for constructing the container when loading since the particle container class is not inherited from class Animatable
*/
virtual Class_ID GetClassID() = 0;
/*! \fn virtual int NumChannels() const = 0;
* \brief Returns number of channels in the container
*/
virtual int NumChannels() const = 0;
/*! \fn virtual IObject*& GetChannel(int i) = 0;
* \brief Returns i-th channel in the container
*/
virtual IObject*& GetChannel(int i) = 0;
/*! \fn virtual IObject* GetChannel(Interface_ID id, Object* privateOwner=NULL, INode* creatorAction=NULL) = 0;
* \brief Returns a channel with the given interface id. If privateOwner is NULL, then the channel is public. If privateOwner is specified, then the channel is private with the given private owner.
*/
virtual IObject* GetChannel(Interface_ID id, Object* privateOwner=NULL, INode* creatorAction=NULL) = 0;
// FnPub alternatives for the method above
/*! \fn IObject* GetPublicChannel(int id_PartA, int id_PartB)
* \brief FnPub alternative for the method virtual IObject* GetChannel.
* \brief Essentially takes in the two (2) components that make up the full Interface_ID CHANNELCONTAINER_INTERFACE
* \param id_PartA: Corresponds to 0x74f93c00. Look at #define CHANNELCONTAINER_INTERFACE Interface_ID(0x74f93c00, 0x1eb34600)
* \param id_partB: Corresponds to 0x1eb34600. Look at #define CHANNELCONTAINER_INTERFACE Interface_ID(0x74f93c00, 0x1eb34600)
*/
IObject* GetPublicChannel(int id_PartA, int id_PartB)
{ return GetChannel( Interface_ID(id_PartA, id_PartB), NULL); }
/*! \fn IObject* GetPrivateChannel(int id_PartA, int id_PartB, Object* privateOwner, INode* creatorAction)
* \brief FnPub alternative for method virtual IObject* GetChannel.
*/
IObject* GetPrivateChannel(int id_PartA, int id_PartB, Object* privateOwner, INode* creatorAction)
{ return GetChannel( Interface_ID(id_PartA, id_PartB), privateOwner, creatorAction); }
/*! \fn virtual bool AddChannel(IObject* channel) = 0;
* \brief Returns true if the channel has been added. The channel may be rejected if there are duplicate interfaces in the added channel and in the container. The ParticleChannelReadWrite and ParticleChannelAmount interfaces don't count since every channel has them.
*/
virtual bool AddChannel(IObject* channel) = 0;
/*! \fn virtual IObject* EnsureChannel(Interface_ID& iChanID, Class_ID& channelClassID, bool isWrapper, Interface_ID& wrappingReadID, Interface_ID& wrappingWriteID, bool isTransferable=TRUE, INode* creatorAction=NULL, Object* privateOwner=NULL, bool* initChannel=NULL) = 0;
* \brief Returns a channel object if a channel with the given interface id is in the container. If such channel
doesn't exist, that container makes an attempt to create and add a channel
for the interface according to the specifications. The method is not for FnPub intentionally.
\param iChanID: interface id of channel to be present in the container\n
\param channelClassID: if interface is not present then create particle channel with the classID\n
\param isWrapper: if true then the created particle channel is wrapper\n
\param wrappingReadID & wrappingWriteID: read & write ID for wrapping the particle channel\n
\param isTransferable: if true then the channel is transferable (contrary to temporary)\n
\param creatorAction: the parameter is used to record an action that created the channel\n
this record can be used later on to identify if the action needs to initialize the
channel values for new particles\n
\param privateOwner: the parameter is used to set a private owner of the channel. Only the action
with the same object pointer may access this channel\n
\param initChannel: if the channel was created by the same action node then it's responsibility of
the action to initialize values\n
*/
virtual IObject* EnsureChannel(Interface_ID& iChanID, Class_ID& channelClassID,
bool isWrapper, Interface_ID& wrappingReadID, Interface_ID& wrappingWriteID,
bool isTransferable=TRUE, INode* creatorAction=NULL, Object* privateOwner=NULL,
bool* initChannel=NULL) = 0;
/*! \fn virtual BaseInterface* EnsureInterface(Interface_ID& iChanID, Class_ID& channelClassID, bool isWrapper, Interface_ID& wrappingReadID, Interface_ID& wrappingWriteID, bool isTransferable=TRUE, INode* creatorAction=NULL, Object* privateOwner=NULL, bool* initChannel=NULL) = 0;
* \brief Returns an interface if the interface with the given interface id is in the container.
If such interface doesn't exist, that container makes an attempt to
create and add a channel for the interface according to the specifications.
The method is not for FnPub intentionally.
\param iChanID: interface id of channel to be present in the container\n
\param channelClassID: if interface is not present then create particle channel with the classID\n
\param isWrapper: if true then the created particle channel is wrapper\n
\param wrappingReadID & wrappingWriteID: read & write ID for wrapping the particle channel\n
\param isTransferable: if true then the channel is transferable (contrary to temporary)\n
\param creatorAction: the parameter is used to record an action that created the channel\n
this record can be used later on to identify if the action needs to initialize the
channel values for new particles\n
\param privateOwner: the parameter is used to set a private owner of the channel. Only the action
with the same object pointer may access this channel\n
\param initChannel: if the channel was created by the same action node then it's responsibility of
the action to initialize values\n
*/
virtual BaseInterface* EnsureInterface(Interface_ID& iChanID, Class_ID& channelClassID,
bool isWrapper, Interface_ID& wrappingReadID, Interface_ID& wrappingWriteID,
bool isTransferable=TRUE, INode* creatorAction=NULL, Object* privateOwner=NULL,
bool* initChannel=NULL) = 0;
/*! \fn virtual BaseInterface* GetPrivateInterface(Interface_ID id, Object* privateOwner) = 0;
* \brief Returns an interface of a channel with the given interface id and private owner.
\param iChanID: interface id of channel to be present in the container. \n
\param privateOwner: the parameter is used to identify a private owner of the channel.\n
*/
virtual BaseInterface* GetPrivateInterface(Interface_ID id, Object* privateOwner) = 0;
/*! \fn virtual int RemoveNonTransferableChannels(INode* nextParticleGroup=NULL) = 0;
* \brief Returns an interface of a channel with the given interface id and private owner parameters:\n
iChanID: interface id of channel to be present in the container\n
privateOwner: the parameter is used to identify a private owner of the channel.
*/
virtual int RemoveNonTransferableChannels(INode* nextParticleGroup=NULL) = 0;
/*! \fn virtual IObject* Clone() = 0;
* \brief Makes a clone copy of the whole container (all channels), returns new container
*/
virtual IObject* Clone() = 0;
/*! \fn virtual bool Copy(IObject* container) = 0;
* \brief Makes a copy from the other container, returns true if successful
*/
virtual bool Copy(IObject* container) = 0;
/*! \fn virtual IOResult Save(ISave* isave) const = 0;
* \brief Saves content of the channel to file
*/
virtual IOResult Save(ISave* isave) const = 0;
/*! \fn IOResult Load(ILoad* iload) = 0;
* \brief Loads content of the channel from file.
*/
virtual IOResult Load(ILoad* iload) = 0;
/*! \fn int MemoryUsed() const = 0;
* \brief Returns amount of memory used (in bytes) by the channel container to store the information. This is a total sum of the memory used by all channels and the data from the container itself.
*/
virtual int MemoryUsed() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(CHANNELCONTAINER_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(CHANNELCONTAINER_INTERFACE); }
/*@}*/
};
#endif // _ICHANNELCONTAINER_H_

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,297 @@
/*! \file IPFAction.h
\brief Action-generic interface IPFAction.
This is a part of every PF Operator & Test.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-12-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFACTION_H_
#define _IPFACTION_H_
#include "ParticleChannelMask.h"
#include "PFExport.h"
#include "Max.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFACTION_INTERFACE Interface_ID(0x74f93d00, 0x1eb34500)
#define GetPFActionInterface(obj) ((IPFAction*)((GetPFObject(obj))->GetInterface(PFACTION_INTERFACE)))
class IPFAction : public FPMixinInterface
{
public:
// function IDs
enum { kInit,
kRelease,
kChannelsUsed, // reserved for future use
kActivityInterval,
kIsFertile,
kIsNonExecutable,
kSupportRand,
kGetRand,
kSetRand,
kNewRand,
kIsMaterialHolder,
kGetMaterial,
kSetMaterial,
kSupportScriptWiring,
kGetUseScriptWiring,
kSetUseScriptWiring
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_5(kInit, TYPE_bool, Init, TYPE_IOBJECT, TYPE_OBJECT, TYPE_INODE, TYPE_OBJECT_TAB_BR, TYPE_INODE_TAB_BR);
FN_1(kRelease, TYPE_bool, Release, TYPE_IOBJECT);
VFN_2(kChannelsUsed, ChannelsUsed, TYPE_INTERVAL_BR, TYPE_FPVALUE); // reserved for future use
FN_0(kActivityInterval, TYPE_INTERVAL_BV, ActivityInterval);
FN_0(kIsFertile, TYPE_bool, IsFertile);
FN_0(kIsNonExecutable, TYPE_bool, IsNonExecutable);
FN_0(kSupportRand, TYPE_bool, SupportRand);
FN_0(kGetRand, TYPE_INT, GetRand);
VFN_1(kSetRand, SetRand, TYPE_INT);
FN_0(kNewRand, TYPE_INT, NewRand);
FN_0(kIsMaterialHolder, TYPE_bool, IsMaterialHolder);
FN_0(kGetMaterial, TYPE_MTL, GetMaterial);
FN_1(kSetMaterial, TYPE_bool, SetMaterial, TYPE_MTL);
FN_0(kSupportScriptWiring, TYPE_bool, SupportScriptWiring);
FN_0(kGetUseScriptWiring, TYPE_bool, GetUseScriptWiring);
VFN_1(kSetUseScriptWiring, SetUseScriptWiring, TYPE_bool);
END_FUNCTION_MAP
/** @defgroup IPFAction IPFAction.h
* @{
*/
/*! \fn virtual bool Init(IObject* pCont, Object* pSystem, INode* node, Tab<Object*>& actions, Tab<INode*>& actionNodes) = 0;
* \brief Returns true if the operation has been proceeded successfully. The method is called when the ActionList
is established the first time, when there is a first particle that enters the ActionList and there is a need to proceed particles.
/param pCont: particle container with particle data
/param pSystem: the particle system that generates the particle stream;
the same operator may get calls from different particle systems; if the
result varies according to the particle system that generates
particles, then this parameter is useful.
/param pNode: INode of the particle system that generates the particles.
/param actions: Tab<Object*> of Actions in the current ActionList.
The stack will be used to proceed particles.
The stack is mutable: an Action may change the stack (to remove
or add some Actions) to fine-tune the order of execution or
add some extra actions. The next parameter should sync with
the mutation.
/param actionNodes: Tab<INode*> of action nodes.
*/
virtual bool Init(IObject* pCont, Object* pSystem, INode* node, Tab<Object*>& actions, Tab<INode*>& actionNodes) = 0;
/*! \fn virtual bool Release(IObject* pCont) = 0;
* \brief See Init().
*/
virtual bool Release(IObject* pCont) = 0;
/*! \fn virtual const ParticleChannelMask& ChannelsUsed(const Interval& time) const = 0;
* \brief See Init().
*/
virtual const ParticleChannelMask& ChannelsUsed(const Interval& time) const = 0;
/*! \fn PFExport void ChannelsUsed(const Interval& time, FPValue* channels) const;
* \brief "Function publishing" alternative for ChannelsUsed method. Reserved for future use.
*/
PFExport void ChannelsUsed(const Interval& time, FPValue* channels) const;
/*! \fn virtual const Interval ActivityInterval() const = 0;
* \brief Casting the FPValue->ptr parameter to Tab<Interface_ID>* as in PFExport void ChannelsUsed(...);
an Action may have a time interval when the Action is active. Outside this interval
the Action does nothing, therefore there is no need to proceed particles outside
the activity interval.
*/
virtual const Interval ActivityInterval() const = 0;
/*! \fn virtual bool IsFertile() const { return false; }
* \brief Birth Action is a special type of actions since it can create particles from scratch.
All other type of actions proceed existing particles. Only Action that can create
absolutely new particles (if number of particles in the container is zero) should
override this method returning true.
*/
virtual bool IsFertile() const { return false; }
/*! \fn virtual bool IsNonExecutable() const { return false; }
* \brief There is a special case of non-executable actions. They are present in the action
schematics but don't affect the particle behavior. Example: Comments operator
*/
virtual bool IsNonExecutable() const { return false; }
/*! \fn virtual bool Has3dIcon() const { return false; }
* \brief An action may have 3d icon representation in viewport.
The 3d icon can be used as a reference for some of the action parameters.
*/
virtual bool Has3dIcon() const { return false; }
/*! \fn virtual int IsColorCoordinated() const { return -1; }
* \brief If an operator/test has a 3D icon the icon can be automatically color matched
to the color of the display operator in the same event. For the automatic
color match the operator/test should return 1 in this method.
If returns 0 then the action gets the default color for operator/test.
If returns -1 then the action doesn't need any color coordination from Particle Flow.
*/
virtual int IsColorCoordinated() const { return -1; }
/*! \fn virtual bool SupportRand() const = 0;
* \brief An Action may carry some chaos/unpredictibility in its processing. This
method supports chaos randomness.
*/
virtual bool SupportRand() const = 0;
/*! \fn virtual int GetRand() = 0;
* \brief For chaos/unpredictibility action, gets rand value.
*/
virtual int GetRand() = 0;
/*! \fn virtual void SetRand(int seed) = 0;
* \brief For chaos/unpredictibility action, sets rand value.
*/
virtual void SetRand(int seed) = 0;
/*! \fn PFExport int NewRand();
* \brief For chaos/unpredictibility action, sets and returns new rand value.
*/
PFExport int NewRand();
/*! \fn PFExport static int NewRand(IParamBlock2* pblock, int randomSeedParamID);
* \brief Alternative for PFExport int NewRand(); but not in FnPub interface
*/
PFExport static int NewRand(IParamBlock2* pblock, int randomSeedParamID);
/*! \fn virtual bool IsMaterialHolder() const { return false; }
* \brief If the Action may potentically change particle material, then return true
*/
virtual bool IsMaterialHolder() const { return false; }
/*! \fn virtual Mtl* GetMaterial() { return NULL; }
* \brief Returns a material for particles
*/
virtual Mtl* GetMaterial() { return NULL; }
/*! \fn virtual bool SetMaterial(Mtl* mtl) { return false; }
* \brief Return true if material was set successfully
*/
virtual bool SetMaterial(Mtl* mtl) { return false; }
/*! \fn virtual bool SupportScriptWiring() const { return false; }
* \brief An Action may have parameters controlled by script channels.
How the script wiring is set up is controlled by a separate rollup
with script-wiring pblock. The rollup is visible if "Use Script Wiring"
option in the right-click menu is set to ON. The option is visible
only for actions that support script wiring.
*/
virtual bool SupportScriptWiring() const { return false; }
/*! \fn virtual bool GetUseScriptWiring() const { return false; }
* \brief Supports script wiring. See SupportScriptWiring().
*/
virtual bool GetUseScriptWiring() const { return false; }
/*! \fn virtual void SetUseScriptWiring(bool useScriptWiring) { ; }
* \brief Supports script wiring. See SupportScriptWiring().
*/
virtual void SetUseScriptWiring(bool useScriptWiring) { ; }
/*! \fn virtual bool IsEmitterTMDependent() const { return false; }
* \brief An Action may or may not be dependent on the particle system emitter.
When the emitter is invalidated, a particle group has to decide if it needs
to invalidate itself. To make the decision, the group checks all the actions
if any of them are dependent on the emitter change. There are two categories of
dependency: the transformation matrix of the emitter (TM), and object parameters
of the emitter (props). This method checks the TM category.
*/
virtual bool IsEmitterTMDependent() const { return false; }
/*! \fn virtual bool IsEmitterPropDependent() const { return false; }
* \brief Checks the props category for dependency. See IsEmitterTMDependent().
*/
virtual bool IsEmitterPropDependent() const { return false; }
/*! \fn virtual IObject* GetCurrentState(IObject* pContainer) { return NULL; }
* \brief Returns action state (see IPFActionState.h for details).
You have to delete the IObject by DeleteIObject method
when the state is no longer needed.
*/
virtual IObject* GetCurrentState(IObject* pContainer) { return NULL; }
/*! \fn virtual void SetCurrentState(IObject* actionState, IObject* pContainer) { ; }
* \brief Sets the state of the action to the given state
*/
virtual void SetCurrentState(IObject* actionState, IObject* pContainer) { ; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTION_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTION_INTERFACE); }
};
// Codes for ClassDesc::Execute(...) method
// The Execute method is used to extract action description from the ClassDesc
enum { kPF_GetActionDescription = 781,
// defines an action name to be shown in the action depot area in PView
// if the method is not supported then the class name of the action is used
kPF_GetActionName,
// defines if the action is shown in ParticleView Action Depot window
// if the execute is not implemented then it is assumed that the action is
// public
kPF_PViewPublic,
// defines a category for the action to be placed in the Action Depot
// the call is reserved for future use. If the execute is not implemented
// then the category is assigned according to the action type (operator or test)
kPF_PViewCategory,
// defines if the action is "fertile". It means it is able to generate particles
// from nothing. If the execute is not implemented then it is assumed
// that the action is not "fertile".
kPF_IsFertile,
// defines if the action is "non-executable". Non-executable action doesn't
// affect particle behavior. The action is present in the action schematics
// but its presence doesn't change how the particles are shown or rendered.
// If the execute is not implemented then it is assumed that the action is
// executable.
kPF_IsNonExecutable,
// returns bitmap with icon for the depot window of ParticleView
// if the execute is not implemented then a default icon is used
kPF_PViewDepotIcon
};
/*! \fn inline IPFAction* PFActionInterface(Object* obj)
* \brief
*/
inline IPFAction* PFActionInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFActionInterface(obj));
};
/*! \fn inline IPFAction* PFActionInterface(INode* node)
* \brief
*/
inline IPFAction* PFActionInterface(INode* node) {
return ((node == NULL) ? NULL : PFActionInterface(node->GetObjectRef()));
};
/*! \fn PFExport int IsPFActionActive(INode* actionNode);
* \brief An action may be turned ON, OFF, True and False in Particle View.
An operator has two states: ON (1) and OFF (0).
A test has three states: ON (1), False (0) and True (-1).
The method returns the state of the action.
*/
PFExport int IsPFActionActive(INode* actionNode);
#endif // _IPFACTION_H_
/*@}*/

View File

@ -0,0 +1,257 @@
/*! \file IPFActionList.h
\brief Interface for PF ActionList
An ActionList is a list of actions combined together
to control properties of group of particles
PF System also implements this interface to keep
track of all global Actions for the particle system.
Part of public SDK
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-15-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFACTIONLIST_H_
#define _IPFACTIONLIST_H_
#include "Max.h"
#include "PFExport.h"
#include "IPFAction.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFACTIONLIST_INTERFACE Interface_ID(0x74f93d04, 0x1eb34500)
#define GetPFActionListInterface(obj) ((IPFActionList*)((GetPFObject(obj))->GetInterface(PFACTIONLIST_INTERFACE)))
class IPFActionList : public FPMixinInterface
{
public:
// function IDs
enum { kGetNumActions, kGetAction, kAppendAction,
kInsertAction, kRemoveAction, kHasAction,
kIsAction, kIsOperator, kIsTest,
kIsActivated, kActivate, kIsActionActive,
kActivateAction, kGetPViewLocation, kSetPViewLocation,
kGetPViewZOrder, kSetPViewZOrder, kGetListWidth,
kSetListWidth, kGetPViewRightBoundary,
kIsCollapsed, kCollapse, kExpand,
kHasUpStream, kGetSelected, kSetSelected,
kAcceptFertile
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_0( kGetNumActions, TYPE_INT, NumActions );
FN_1( kGetAction, TYPE_INODE, GetAction, TYPE_INDEX);
FN_1( kAppendAction, TYPE_bool, AppendAction, TYPE_INODE);
FN_2( kInsertAction, TYPE_bool, InsertAction, TYPE_INODE, TYPE_INDEX);
FN_1( kRemoveAction, TYPE_bool, RemoveAction, TYPE_INDEX);
FN_2( kHasAction, TYPE_bool, HasAction, TYPE_INODE, TYPE_INDEX_BR);
FN_1( kIsAction, TYPE_bool, IsAction, TYPE_INODE);
FN_1( kIsOperator, TYPE_bool, IsOperator, TYPE_INODE);
FN_1( kIsTest, TYPE_bool, IsTest, TYPE_INODE);
FN_0( kIsActivated, TYPE_bool, IsActivated );
VFN_1( kActivate, Activate, TYPE_bool);
FN_1( kIsActionActive, TYPE_INT, IsActionActive, TYPE_INDEX);
VFN_2( kActivateAction, ActivateAction, TYPE_INDEX, TYPE_INT);
VFN_2( kGetPViewLocation, GetPViewLocation, TYPE_INT_BR, TYPE_INT_BR);
VFN_2( kSetPViewLocation, SetPViewLocation, TYPE_INT, TYPE_INT);
FN_0( kGetPViewZOrder, TYPE_INT, GetPViewZOrder );
VFN_1( kSetPViewZOrder, SetPViewZOrder, TYPE_INT);
FN_0( kGetListWidth, TYPE_INT, GetListWidth );
VFN_1( kSetListWidth, SetListWidth, TYPE_INT);
FN_0( kGetPViewRightBoundary, TYPE_INT, GetPViewRightBoundary );
FN_0( kIsCollapsed, TYPE_bool, IsCollapsed );
VFN_0( kCollapse, Collapse );
VFN_0( kExpand, Expand );
FN_0( kHasUpStream, TYPE_bool, HasUpStream );
FN_0( kGetSelected, TYPE_INT, GetSelected );
VFN_1( kSetSelected, SetSelected, TYPE_INT);
FN_0( kAcceptFertile, TYPE_bool, AcceptFertile );
END_FUNCTION_MAP
/** @defgroup IPFActionList IPFActionList.h
* @{
*/
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONLIST_INTERFACE); }
* \brief Must implement GetDescByID method
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONLIST_INTERFACE); }
//End of Function Publishing system code
//***********************************
/*! \fn virtual int NumActions() const = 0;
* \brief
*/
virtual int NumActions() const = 0;
/*! \fn virtual INode* GetAction(int index) const = 0;
* \brief
*/
virtual INode* GetAction(int index) const = 0;
/*! \fn virtual bool AppendAction(INode* action) = 0;
* \brief
*/
virtual bool AppendAction(INode* action) = 0;
/*! \fn virtual bool InsertAction(INode* action, int indexAt) = 0;
* \brief
*/
virtual bool InsertAction(INode* action, int indexAt) = 0;
/*! \fn virtual bool RemoveAction(int index) = 0;
* \brief
*/
virtual bool RemoveAction(int index) = 0;
/*! \fn virtual bool HasAction(INode* action, int& index) const = 0;
* \brief
*/
virtual bool HasAction(INode* action, int& index) const = 0;
/*! \fn PFExport static bool IsAction(INode* action);
* \brief
*/
PFExport static bool IsAction(INode* action);
/*! \fn PFExport static bool IsOperator(INode* action);
* \brief
*/
PFExport static bool IsOperator(INode* action);
/*! \fn PFExport static bool IsTest(INode* action);
* \brief
*/
PFExport static bool IsTest(INode* action);
/*! \fn virtual bool IsActivated() const = 0;
* \brief
*/
virtual bool IsActivated() const = 0;
/*! \fn virtual void Activate(bool active) = 0;
* \brief Activate/deactivate all the actions in the list
*/
virtual void Activate(bool active) = 0;
/*! \fn virtual int IsActionActive(int index) const = 0;
* \brief Activate/deactivate all the actions in the list. 1: active; 0: non-active for operators and "always false" for tests;
-1: "always true" for tests
*/
virtual int IsActionActive(int index) const = 0;
/*! \fn virtual void ActivateAction(int index, int active=1) = 0;
* \brief Activate/deactivate all the actions in the list
*/
virtual void ActivateAction(int index, int active=1) = 0;
// default spacing and location on Particle View
enum { kListWidth=180 }; // default actionList width
/*! \fn virtual void GetPViewLocation(int& x, int& y) = 0;
* \brief
*/
virtual void GetPViewLocation(int& x, int& y) = 0;
/*! \fn virtual void SetPViewLocation(int x, int y) { ; }
* \brief
*/
virtual void SetPViewLocation(int x, int y) { ; }
/*! \fn virtual int GetPViewZOrder() { return 0; }
* \brief
*/
virtual int GetPViewZOrder() { return 0; }
/*! \fn virtual void SetPViewZOrder(int z) { ; }
* \brief
*/
virtual void SetPViewZOrder(int z) { ; }
/*! \fn virtual int GetListWidth() { return kListWidth; }
* \brief
*/
virtual int GetListWidth() { return kListWidth; }
/*! \fn virtual void SetListWidth(int w) { ; }
* \brief
*/
virtual void SetListWidth(int w) { ; }
/*! \fn PFExport int GetPViewRightBoundary();
* \brief Returns x-coord of the right side of the action list
*/
PFExport int GetPViewRightBoundary();
/*! \fn virtual bool IsCollapsed() { return false; }
* \brief Action list may be shown in a "collapsed" state in ParticleView
*/
virtual bool IsCollapsed() { return false; }
/*! \fn virtual void Collapse() { ; }
* \brief Action list may be shown in a "collapsed" state in ParticleView
*/
virtual void Collapse() { ; }
/*! \fn virtual void Expand() { ; }
* \brief Action list may be shown in a "collapsed" state in ParticleView
*/
virtual void Expand() { ; }
/*! \fn virtual bool HasUpStream() { return false; }
* \brief Indicates if there are PFSystems or ActionLists that direct particle flow
in this action list. If returns false then the action list won't produce particles.
*/
virtual bool HasUpStream() { return false; }
/*! \fn virtual int GetSelected() const { return 0; }
* \brief ActionList has its own methods for selecting. Selected ActionList has a white boundary
in the ParticleView. If the corresponding particle system has Event-Based Selection ON,
the the corresponding particles are shown as selected.
*/
virtual int GetSelected() const { return 0; }
/*! \fn virtual void SetSelected(int onOff) { ; }
* \brief See virtual int GetSelected().
*/
virtual void SetSelected(int onOff) { ; }
/*! \fn virtual bool AcceptFertile() { return false; }
* \brief ActionList has some restrictions on whether it is able to add a "fertile" action.
ActionList may have only single "fertile" action in the list of actions.
Also, ActionList may have a "fertile" action only if no test uses this
actionList as a next event.
*/
virtual bool AcceptFertile() { return false; }
/*! \fn virtual void UpdateMaterial() { ; }
* \brief The method is used to initiate material update in the associated particle group.
*/
virtual void UpdateMaterial() { ; }
};
/*! \fn PFExport IPFActionList* GetParentPFActionList(INode* actionNode);
* \brief Returns interface of the parent actionList of the given action
*/
PFExport IPFActionList* GetParentPFActionList(INode* actionNode);
inline IPFActionList* PFActionListInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFActionListInterface(obj));
};
inline IPFActionList* PFActionListInterface(INode* node) {
return ((node == NULL) ? NULL : PFActionListInterface(node->GetObjectRef()));
};
#endif // _IPFACTIONLIST_H_

View File

@ -0,0 +1,119 @@
/*! \file IPFActionListPool.h
\brief The interface and a method are used to access a list
of all ActionList objects in the current scene.
It is possible to register notification with the object
thus getting notification each time when the set of
all ActionLists is changing (create, clone, delete).
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 08-20-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFACTIONLISTPOOL_H_
#define _IPFACTIONLISTPOOL_H_
#include "Max.h"
#include "notify.h"
#include "PFExport.h"
// interface ID
#define PFACTIONLISTPOOL_INTERFACE Interface_ID(0x74f93d09, 0x1eb34500)
#define GetPFActionListPoolInterface(obj) ((IPFActionListPool*)obj->GetInterface(PFACTIONLISTPOOL_INTERFACE))
class IPFActionListPool : public FPMixinInterface
{
public:
// function IDs
enum { kNumActionLists,
kGetActionList,
kHasActionList,
kHasActionListByHandle,
kRegisterNotification,
kUnRegisterNotification
};
BEGIN_FUNCTION_MAP
FN_0(kNumActionLists, TYPE_INT, NumActionLists );
FN_1(kGetActionList, TYPE_INODE, GetActionList, TYPE_INDEX );
FN_1(kHasActionList, TYPE_bool, HasActionList, TYPE_INODE );
FN_1(kHasActionListByHandle, TYPE_bool, HasActionListByHandle, TYPE_INT );
END_FUNCTION_MAP
/** @defgroup IPFActionListPool IPFActionListPool.h
* @{
*/
/*! \fn virtual int NumActionLists() = 0;
* \brief Returns number of ActionLists in the current scene
*/
virtual int NumActionLists() = 0;
/*! \fn virtual INode* GetActionList(int i) = 0;
* \brief Returns i-th action lists in the scene
\param i: action list index
*/
virtual INode* GetActionList(int i) = 0;
/*! \fn virtual bool HasActionList(INode* node) = 0;
* \brief Checks if the given aciton list node is present in the scene
\param node: action list node
*/
virtual bool HasActionList(INode* node) = 0;
/*! \fn virtual bool HasActionListByHandle(int handle) = 0;
* \brief check if the scene has an action list with the given node handle
*/
virtual bool HasActionListByHandle(int handle) = 0;
/*! \fn virtual int RegisterNotification(NOTIFYPROC proc, void *param) = 0;
* \brief Register notification with the action list pool.
The given function is called each time the set of all action lists is changing
Returns nonzero if the event was registered; otherwise zero.
\param proc: The callback function called when the event occurs.
\param param: A pointer to a parameter which will be passed to the callback function.
*/
virtual int RegisterNotification(NOTIFYPROC proc, void *param) = 0;
/*! \fn virtual int UnRegisterNotification(NOTIFYPROC proc, void *param) = 0;
* \brief Unregister notification with the action list pool.
This function is called to break the connection between the event and the callback.
After this function executes the callback is no longer invoked when the event occurs.
Returns nonzero if the event was unregistered; otherwise zero.
\param proc: The callback function called when the event occurs.
\param param: A pointer to a parameter which will be passed to the callback function.
*/
virtual int UnRegisterNotification(NOTIFYPROC proc, void *param) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONLISTPOOL_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONLISTPOOL_INTERFACE); }
/*! \fn friend PFExport IPFActionListPool* GetPFActionListPool();
* \brief Friend function declarations
*/
friend PFExport IPFActionListPool* GetPFActionListPool();
protected:
PFExport IPFActionListPool();
static IPFActionListPool* m_pool; // the one and only PFActionList Pool in the scene
};
/*! \fn PFExport IPFActionListPool* GetPFActionListPool();
* \brief Gets PFActionListPool from the scene
*/
PFExport IPFActionListPool* GetPFActionListPool();
/*@}*/
#endif // _IPFACTIONLISTPOOL_H_

View File

@ -0,0 +1,105 @@
/*! \file IPFActionListSet.h
\brief Interface for PF ActionList Set
It's a set of ActionLists. PF System implements the
interface to keep track of all initial ActionLists.
Part of public SDK
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-09-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFACTIONLISTSET_H_
#define _IPFACTIONLISTSET_H_
#include "Max.h"
#include "PFExport.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFACTIONLISTSET_INTERFACE Interface_ID(0x7216b6f, 0x634253c5)
#define GetPFActionListSetInterface(obj) ((IPFActionListSet*)((GetPFObject(obj))->GetInterface(PFACTIONLISTSET_INTERFACE)))
class IPFActionListSet : public FPMixinInterface
{
public:
// function IDs
enum { kGetNumActionLists, kGetActionList, kAppendActionList,
kInsertActionList, kRemoveActionList, kHasActionList,
kIsActionList
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_0( kGetNumActionLists, TYPE_INT, NumActionLists );
FN_1( kGetActionList, TYPE_INODE, GetActionList, TYPE_INDEX);
FN_1( kAppendActionList, TYPE_bool, AppendActionList, TYPE_INODE);
FN_2( kInsertActionList, TYPE_bool, InsertActionList, TYPE_INODE, TYPE_INDEX);
FN_1( kRemoveActionList, TYPE_bool, RemoveActionList, TYPE_INDEX);
FN_2( kHasActionList, TYPE_bool, HasActionList, TYPE_INODE, TYPE_INDEX_BR);
FN_1( kIsActionList, TYPE_bool, IsActionList, TYPE_INODE);
END_FUNCTION_MAP
// must implement GetDescByID method !
FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONLISTSET_INTERFACE); }
//End of Function Publishing system code
//***********************************
/** @defgroup IPFActionListSet IPFActionListSet.h
* @{
*/
/*! \fn virtual int NumActionLists() const = 0;
* \brief
*/
virtual int NumActionLists() const = 0;
/*! \fn virtual INode* GetActionList(int index) const = 0;
* \brief
*/
virtual INode* GetActionList(int index) const = 0;
/*! \fn virtual bool AppendActionList(INode* alist) = 0;
* \brief
*/
virtual bool AppendActionList(INode* alist) = 0;
/*! \fn virtual bool InsertActionList(INode* alist, int indexAt) = 0;
* \brief
*/
virtual bool InsertActionList(INode* alist, int indexAt) = 0;
/*! \fn virtual bool RemoveActionList(int index) = 0;
* \brief
*/
virtual bool RemoveActionList(int index) = 0;
/*! \fn virtual bool HasActionList(INode* alist, int& index) const = 0;
* \brief
*/
virtual bool HasActionList(INode* alist, int& index) const = 0;
/*! \fn PFExport static bool IsActionList(INode* alist);
* \brief
*/
PFExport static bool IsActionList(INode* alist);
};
inline IPFActionListSet* PFActionListSetInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFActionListSetInterface(obj));
};
inline IPFActionListSet* PFActionListSetInterface(INode* node) {
return ((node == NULL) ? NULL : PFActionListSetInterface(node->GetObjectRef()));
};
#endif // _IPFACTIONLISTSET_H_

View File

@ -0,0 +1,95 @@
/*! \file IPFActionState.h
\brief Action-generic interface IPFActionState for action state.
An action may have history-dependent parameters that need
to be restored if the state of the whole particle system
needs to be saved/restored. For example, random generator
that is used by an action, is a history-dependent item.
An action may have several action states at the same time,
each of them reflecting a state for a specific particle
container.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-25-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFACTIONSTATE_H_
#define _IPFACTIONSTATE_H_
#include "Max.h"
// interface ID
#define PFACTIONSTATE_INTERFACE Interface_ID(0x23a31c4e, 0x6a2b2c68)
#define GetPFActionStateInterface(obj) (IPFActionState*)(obj->GetInterface(PFACTIONSTATE_INTERFACE))
class IPFActionState : public FPMixinInterface
{
public:
// chunk IDs for saving and loading
// developer: you may have your own chunk IDs
// they are factored here for convenience
enum { kChunkActionHandle = 4100,
kChunkRandGen = 4200,
kChunkRandGen2 = 4210,
kChunkRandGen3 = 4220,
kChunkRandGen4 = 4230,
kChunkRandGen5 = 4240,
kChunkData = 4300,
kChunkData2 = 4310,
kChunkData3 = 4320,
kChunkData4 = 4330,
kChunkData5 = 4340,
};
public:
/** @defgroup IPFActionState IPFActionState.h
* @{
*/
/*! \fn virtual Class_ID GetClassID() = 0;
* \brief The method returns the unique ID for the action state class.
The ID is used for constructing the action state when loading since
the action state class is not inherited from class Animatable.
*/
virtual Class_ID GetClassID() = 0;
/*! \fn virtual ULONG GetActionHandle() const = 0;
* \brief Returns node handle of the action with the action state
*/
virtual ULONG GetActionHandle() const = 0;
/*! \fn virtual void SetActionHandle(ULONG actionHandle) = 0;
* \brief Defines node handle of the action with the action state
*/
virtual void SetActionHandle(ULONG actionHandle) = 0;
/*! \fn virtual IOResult Save(ISave* isave) const = 0;
* \brief Saving content of the action state to file
*/
virtual IOResult Save(ISave* isave) const = 0;
/*! \fn virtual IOResult Load(ILoad* iload) = 0;
* \brief Loading content of the action state from file
*/
virtual IOResult Load(ILoad* iload) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONSTATE_INTERFACE);
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONSTATE_INTERFACE);
/*@}*/
}
};
#endif // _IPFACTIONSTATE_H_

View File

@ -0,0 +1,130 @@
/*! \file IPFArrow.h
\brief Interface for PF Arrow
Directs particles from Test to the next ActionList
Part of public SDK
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-15-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFARROW_H_
#define _IPFARROW_H_
#include "Max.h"
#include "PFExport.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFARROW_INTERFACE Interface_ID(0x74f93d05, 0x1eb34500)
#define GetPFArrowInterface(obj) ((IPFArrow*)(GetPFObject(obj))->GetInterface(PFARROW_INTERFACE))
class IPFArrow : public FPMixinInterface
{
public:
// function IDs
enum { kSetTest,
kSetActionList,
kGetTest,
kGetActionList,
kActivate,
kDeactivate,
kIsActive
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kSetTest, TYPE_bool, SetTest, TYPE_INODE);
FN_1(kSetActionList, TYPE_bool, SetActionList, TYPE_INODE);
FN_0(kGetTest, TYPE_INODE, GetTest);
FN_0(kGetActionList, TYPE_INODE, GetActionList);
FN_0(kActivate, TYPE_bool, Activate);
FN_0(kDeactivate, TYPE_bool, Deactivate);
FN_0(kIsActive, TYPE_bool, IsActive);
END_FUNCTION_MAP
/** @defgroup IPFArrow IPFArrow.h
* @{
*/
/*! \fn virtual bool SetTest(INode* test) = 0;
* \brief Set test the particles are coming from.
Returns true if has been set successfully
The INode can be rejected if it is not a real test (doesn't have IPFTest interface).
*/
virtual bool SetTest(INode* test) = 0;
/*! \fn virtual bool SetActionList(INode* actionList) = 0;
* \brief Set actionList for particles to come to.
Returns true if has been set successfully.
The INode can be rejected if it is not a real actionList (doesn't have IPFActionList interface).
*/
virtual bool SetActionList(INode* actionList) = 0;
/*! \fn virtual INode* GetTest() const = 0;
* \brief
*/
virtual INode* GetTest() const = 0;
/*! \fn virtual INode* GetActionList() const = 0;
* \brief
*/
virtual INode* GetActionList() const = 0;
/*! \fn virtual bool Activate() = 0;
* \brief
*/
virtual bool Activate() = 0;
/*! \fn virtual bool Deactivate() = 0;
* \brief
*/
virtual bool Deactivate() = 0;
/*! \fn virtual bool IsActive() const = 0;
* \brief
*/
virtual bool IsActive() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFARROW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFARROW_INTERFACE); }
/*! \fn PFExport void updateNextActionListValueInTestFrom(INode* nextAL, INode* testFrom);
* \brief For internal use
*/
PFExport void updateNextActionListValueInTestFrom(INode* nextAL, INode* testFrom);
/*! \fn PFExport void updateArrowValueInTestFrom(Object* arrow, INode* testFrom);
* \brief For internal use
*/
PFExport void updateArrowValueInTestFrom(Object* arrow, INode* testFrom);
/*! \fn PFExport void updateLinkActiveValueInTestFrom(bool active, INode* testFrom);
* \brief For internal use
*/
PFExport void updateLinkActiveValueInTestFrom(bool active, INode* testFrom);
};
inline IPFArrow* PFArrowInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFArrowInterface(obj));
};
inline IPFArrow* PFArrowInterface(INode* node) {
return ((node == NULL) ? NULL : PFArrowInterface(node->GetObjectRef()));
};
/*@}*/
#endif // _IPFARROW_H_

View File

@ -0,0 +1,161 @@
/*! \file IPFIntegrator.h
\brief Interface for time-integrating PF Operator
PF has a default implementation of such interface
The interface is used to "advance" particles in time
according to some rules. The default implementation
uses classical mechanics physics rules for a body
Position and speed is calculated according to
the current speed and acceleration. That applies to
linear and angular movements.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-12-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFINTEGRATOR_H_
#define _IPFINTEGRATOR_H_
#include "Max.h"
#include "PFExport.h"
#include "PreciseTimeValue.h"
// interface ID
#define PFINTEGRATOR_INTERFACE Interface_ID(0x74f93d03, 0x1eb34500)
#define GetPFIntegratorInterface(obj) ((IPFIntegrator*)obj->GetInterface(PFINTEGRATOR_INTERFACE))
// function IDs
enum { kPFIntegrator_proceedSync,
kPFIntegrator_proceedASync
};
class IPFIntegrator : public FPMixinInterface
{
BEGIN_FUNCTION_MAP
FN_5(kPFIntegrator_proceedSync, TYPE_bool, ProceedSync, TYPE_IOBJECT, TYPE_TIMEVALUE, TYPE_FLOAT, TYPE_bool, TYPE_BITARRAY);
FN_5(kPFIntegrator_proceedASync, TYPE_bool, ProceedASync, TYPE_IOBJECT, TYPE_TIMEVALUE_TAB, TYPE_FLOAT_TAB, TYPE_bool, TYPE_BITARRAY);
END_FUNCTION_MAP
public:
/** @defgroup IPFIntegrator IPFIntegrator.h
* @{
*/
/*! \fn virtual bool Proceed(IObject* pCont, PreciseTimeValue time, int index) = 0;
* \brief Returns true if the operation has been proceeded successfully
Proceed a single particle with the given index to the given time.
If pCont is NULL then the method works with previously given container.
It will expedite the call since the method won't acquire particle channels
from the container but uses the previously acquired channels.
When working with individual particles from the same container, the good
practice is to make the call for the first particle with the container specified,
and then for all other particles with the container set to NULL.
\param pCont: particleContainer
\param time: the time for particles to come to; each particle may have its
own current valid time; the parameter sets the time for all particles to synchronize to
\param times: time value for a particle to come to; particles may have different time values to come to
\param selected: bitArray to define which particles to proceed
*/
virtual bool Proceed(IObject* pCont, PreciseTimeValue time, int index) = 0;
/*! \fn virtual bool Proceed(IObject* pCont, PreciseTimeValue time) = 0;
* \brief Proceed all particles in the container to the given time
*/
virtual bool Proceed(IObject* pCont, PreciseTimeValue time) = 0;
/*! \fn virtual bool Proceed(IObject* pCont, Tab<PreciseTimeValue>& times) = 0;
* \brief Proceed all particles in the container to the given times (maybe different for each particle)
*/
virtual bool Proceed(IObject* pCont, Tab<PreciseTimeValue>& times) = 0;
/*! \fn virtual bool Proceed(IObject* pCont, PreciseTimeValue time, BitArray& selected) = 0;
* \brief Proceed selected particles only to the given time
*/
virtual bool Proceed(IObject* pCont, PreciseTimeValue time, BitArray& selected) = 0;
/*! \fn virtual bool Proceed(IObject* pCont, Tab<PreciseTimeValue>& times, BitArray& selected) = 0;
* \brief Proceed selected particles only to the given times (maybe different for each particle)
*/
virtual bool Proceed(IObject* pCont, Tab<PreciseTimeValue>& times, BitArray& selected) = 0;
/*! \fn PFExport bool ProceedSync(IObject* pCont, TimeValue timeTick, float timeFraction,
bool isSelected, BitArray* selected);
* \brief "function-publishing" hook-up for the methods above
\param pCont: particleContainer
\param timeTick, timeFraction, timeTicks, timeFractions:
time for particles to come to. All particles may have the same time value to
come to, in that case the method with timeTick and timeFraction have to
used. Sum of timeTick and timeFraction define the exact time
value (without TimeValue granularity). If particles have different time values
to come to than use the second method with Tabs of timeTicks and timeFractions
\param isSelected, selected: if only part of particles need to be time-advanced then
isSelected is true, and "selected" BitArray have to be defined
*/
PFExport bool ProceedSync(IObject* pCont, TimeValue timeTick, float timeFraction,
bool isSelected, BitArray* selected);
/*! \fn PFExport bool ProceedASync(IObject* pCont, Tab<TimeValue> *timeTicks, Tab<float> *timeFractions,
bool isSelected, BitArray* selected);
* \brief "function-publishing" hook-up for the methods above
\param pCont: particleContainer
\param timeTick, timeFraction, timeTicks, timeFractions:
time for particles to come to. All particles may have the same time value to
come to, in that case the method with timeTick and timeFraction have to
used. Sum of timeTick and timeFraction define the exact time
value (without TimeValue granularity). If particles have different time values
to come to than use the second method with Tabs of timeTicks and timeFractions
\param isSelected, selected: if only part of particles need to be time-advanced then
isSelected is true, and "selected" BitArray have to be defined
*/
PFExport bool ProceedASync(IObject* pCont, Tab<TimeValue> *timeTicks, Tab<float> *timeFractions,
bool isSelected, BitArray* selected);
/*! \fn virtual IPFIntegrator* GetEncapsulatedIntegrator() { return NULL; }
* \brief An integrator may rely on another integrator to calculation some particle proceedings.
For example, a Collision test has IPFIntegrator interface to proceed particles according
to collision approximations. At the same time a Collision test doesn't proceed angular
velocity of a particle. For that the test relies on encapsulated standard integrator.
*/
virtual IPFIntegrator* GetEncapsulatedIntegrator() { return NULL; }
/*! \fn PFExport bool HasEncapsulatedIntegrator(IPFIntegrator* integrator);
* \brief Check if the current integrator has the given integrator encapsulated inside
the encapsulated integrator can be more than one level down
*/
PFExport bool HasEncapsulatedIntegrator(IPFIntegrator* integrator);
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFINTEGRATOR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFINTEGRATOR_INTERFACE); }
/*! \fn friend PFExport IPFIntegrator* GetPFIntegrator();
* \brief Friend function declarations
*/
friend PFExport IPFIntegrator* GetPFIntegrator();
/*! \fn friend PFExport void ReleasePFIntegrator(IPFIntegrator*);
* \brief Friend function declarations
*/
friend PFExport void ReleasePFIntegrator(IPFIntegrator*);
protected:
static Tab<IObject*> m_objs;
};
// this method gets a system PF Integrator interface
PFExport IPFIntegrator* GetPFIntegrator();
// when the developer is done with the PFIntegrator interface acquired via GetPFIntegrator()
// they should call this method to release it.
PFExport void ReleasePFIntegrator(IPFIntegrator* integrator);
#endif // _IPFINTEGRATOR_H_

View File

@ -0,0 +1,158 @@
/*! \file IPFOperator.h
\brief Operator-generic interface IPFOperator
This is a part of every PF Operator
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-12-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFOPERATOR_H_
#define _IPFOPERATOR_H_
#include "Max.h"
#include "PFExport.h"
#include "IPFIntegrator.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFOPERATOR_INTERFACE Interface_ID(0x74f93d01, 0x1eb34500)
#define GetPFOperatorInterface(obj) ((IPFOperator*)((GetPFObject(obj))->GetInterface(PFOPERATOR_INTERFACE)))
class IPFOperator : public FPMixinInterface
{
public:
// function IDs
enum { kProceed
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_7(kProceed, TYPE_bool, Proceed, TYPE_IOBJECT, TYPE_TIMEVALUE, TYPE_TIMEVALUE_BR, TYPE_OBJECT, TYPE_INODE, TYPE_INODE, TYPE_INTERFACE);
END_FUNCTION_MAP
/** @defgroup IPFOperator IPFOperator.h
* @{
*/
/*! \fn Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd, Object* pSystem, INode* pNode, INode* actioNode, IPFIntegrator* integrator) = 0;
* \brief Returns true if the operation has been proceeded successfully.
methods' signatures are presented in two forms: one is compact, and the other one
is for function-publishing where PreciseTimeValue is presented as a pair (int,float).
\param pCont: particleContainer timeStart: the time for particle to start from the simulation. Each particle
may have its own current valid time greater than timeStart. In this
case the operator should consider the current particle time and
timeEnd parameter. Some operators (like Birth) may not consider
current particle time since it works with timeStart and timeEnd
parameters only.
\param timeEnd: the time for particles to come to; each particle may have its
own current valid time; the parameter sets the time for all
particles to synchronize to.
If current particle time is greater than timeEnd it means that the
particle doesn't require processing at all; the particle has been already
updated beyond the interval ]timeStart, timeEnd] of the current operator.
Sometimes the operator may not be able to proceed all the
particles to the given timeEnd. In this case the operator proceeds
the particles as far as possible and set the parameter to the
time achieved. All the following operators will be given the new
timeEnd value as a time value for particles to come to,
and the particle system will run another round of operator stack
modification in the attempt to proceed all the particles to the
initially set time.
\param pSystem: the particle system that generates the particle stream;
the same operator may get calls from different particle systems; if the
result varies according to the particle system that generates
particles, then this parameter is useful.
\param pNode:INode of the particle system that generates the particles.
\param actionNode: INode of the operator (if any; can be NULL)
\param integrator: an operator to proceed particles according to "inertia" rules.
The operator updates time, speed, position, spin, orientation channels
on the basis of time, acceleration, speed, angular acceleration and
spin channels. Each particle system has a default inertia operator.
When an operator want to update current time for particles, it
uses the "inertia" operator. An Action in the ActionList stack my "switch"
the suggested "inertia" operator by its own if the Action support
the "inertial" operator interface. The particle system recognizes
such an Action as a holder of "inertia" interface, and use it
for "inertia" purposes later on.
If the parameter is NULL then the particle system doesn't allow
the operator to advance particles in the time channel.
*/
virtual bool Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd, Object* pSystem, INode* pNode, INode* actioNode, IPFIntegrator* integrator) = 0;
/*! \fn PFExport bool Proceed(IObject* pCont, TimeValue timeStart, TimeValue& timeEnd, Object* pSystem, INode* pNode, INode* actionNode, FPInterface* integrator);
* \brief "function publishing" alternative for the method above
*/
PFExport bool Proceed(IObject* pCont, TimeValue timeStart, TimeValue& timeEnd, Object* pSystem, INode* pNode, INode* actionNode, FPInterface* integrator);
/*! \fn virtual bool HasPreProceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { return false; }
* \brief Three methods apply the Proceed method as a pre-procedure before the
regular proceed for all operators starts. It is not recommended to modify particle container.
The call is mostly used to give an operator opportunity to snapshot the state of particle container
before any operator modifies it.
The Proceed method is called in between PretProceedBegin and PreProceedEnd methods if
HasPreProceed method returns "true".
Those methods are not supported in MaxScript intentionally.
*/
virtual bool HasPreProceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { return false; }
/*! \fn virtual void PreProceedBegin(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { ; }
* \brief See virtual bool HasPreProceed(}
*/
virtual void PreProceedBegin(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { ; }
/*! \fn virtual void PreProceedEnd(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { ; }
* \brief See virtual bool HasPreProceed(}
*/
virtual void PreProceedEnd(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { ; }
/*! \fn virtual bool HasPostProceed(IObject* pCont, PreciseTimeValue time) { return false; }
* \brief Three methods apply the Proceed method as a post procedure when the
amount of particles in all particle groups has been established and there won't be any
particle transfers from one particle group to another.
The Proceed method is called again in between PostProceedBegin and PostProceedEnd methods if
HasPostProceed method returns "true".
Since the post proceed methods are applied after everything has established, it is applied to a "time" moment, not
[timeStart, timeEnt] interval. The Proceed method is called with the same value for timeStart and timeEnd.
Those methods are not supported in MaxScript intentionally.
*/
virtual bool HasPostProceed(IObject* pCont, PreciseTimeValue time) { return false; }
/*! \fn virtual void PostProceedBegin(IObject* pCont, PreciseTimeValue time) { ; }
* \brief See virtual bool HasPostProceed(}
*/
virtual void PostProceedBegin(IObject* pCont, PreciseTimeValue time) { ; }
/*! \fn virtual void PostProceedEnd(IObject* pCont, PreciseTimeValue time) { ; }
* \brief See virtual bool HasPostProceed(}
*/
virtual void PostProceedEnd(IObject* pCont, PreciseTimeValue time) { ; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFOPERATOR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFOPERATOR_INTERFACE); }
/*@}*/
};
inline IPFOperator* PFOperatorInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFOperatorInterface(obj));
};
inline IPFOperator* PFOperatorInterface(INode* node) {
return ((node == NULL) ? NULL : PFOperatorInterface(node->GetObjectRef()));
};
#endif // _IPFOPERATOR_H_

View File

@ -0,0 +1,115 @@
/*! \file IPFRender.h
\brief Render related interface for an Operator.
If an Operator has a Render interface
then the Operator is called to supply geometry for render
in the current ActionList.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-29-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFRENDER_H_
#define _IPFRENDER_H_
#include "Max.h"
#include "PFExport.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFRENDER_INTERFACE Interface_ID(0x75aa7a7f, 0x19c66a0a)
#define GetPFRenderInterface(obj) ((IPFRender*)((GetPFObject(obj))->GetInterface(PFRENDER_INTERFACE)))
class IPFRender : public FPMixinInterface
{
public:
/** @defgroup IPFRender IPFRender.h
* @{
*/
/*! \fn virtual int HasRenderableGeometry() { return(1); }
* \brief The following methods are redirected from the particle object level to
a particular ActionList. The first parameter is a particle container of the ActionList.
Returns 0 if the action doesn't render in all frames for any reason, for example a non-animated parameter prevents render.
\param pCont: particle container to render particles from
\param time: current frame to render particles at. It's supposed that the container has been already updated to satisfy this moment
\param pSystem: master particle system shell
\param inode: INode of the particle group
\param view: View as of the GeomObject::GetRenderMesh(...) method
\param needDelete: boolean as of the GeomObject::GetRenderMesh(...) method
*/
virtual int HasRenderableGeometry() { return(1); }
/*! \fn virtual int IsInstanceDependent(IObject* pCont, Object* pSystem) { return 0; }
* \brief If an object creates different meshes depending on the particular instance (view-dependent) it should return 1.
*/
virtual int IsInstanceDependent(IObject* pCont, Object* pSystem) { return 0; }
/*! \fn virtual Mesh* GetRenderMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete) = 0;
* \brief GetRenderMesh should be implemented by all renderable GeomObjects.
Set needDelete to TRUE if the render should delete the mesh, FALSE otherwise.
Primitives that already have a mesh cached can just return a pointer to it (and set needDelete = FALSE).
*/
virtual Mesh* GetRenderMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete) = 0;
/*! \fn virtual int NumberOfRenderMeshes(IObject* pCont, TimeValue t, Object* pSystem) { return 0; } // 0 indicates multiple meshes not supported.
* \brief Objects may now supply multiple render meshes. If this function
returns a positive number, then GetMultipleRenderMesh and GetMultipleRenderMeshTM will be
called for each mesh, instead of calling GetRenderMesh.
*/
virtual int NumberOfRenderMeshes(IObject* pCont, TimeValue t, Object* pSystem) { return 0; } // 0 indicates multiple meshes not supported.
/*! \fn virtual Mesh* GetMultipleRenderMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete, int meshNumber) { return NULL; }
* \brief For multiple render meshes, this method must be implemented.
Set needDelete to TRUE if the render should delete the mesh, FALSE otherwise.
meshNumber specifies which of the multiplie meshes is being asked for.
*/
virtual Mesh* GetMultipleRenderMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete, int meshNumber) { return NULL; }
/*! \fn virtual void GetMultipleRenderMeshTM(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, int meshNumber,
Matrix3& meshTM, Interval& meshTMValid) { return; }
* \brief For multiple render meshes, this method must be implemented.
meshTM should be returned with the transform defining the offset of the particular mesh in object space.
meshTMValid should contain the validity interval of meshTM
*/
virtual void GetMultipleRenderMeshTM(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, int meshNumber,
Matrix3& meshTM, Interval& meshTMValid) { return; }
/*! \fn virtual PatchMesh* GetRenderPatchMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete) { return NULL; }
* \brief If this returns NULL, then GetRenderMesh will be called
*/
virtual PatchMesh* GetRenderPatchMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete) { return NULL; }
/*! \fn virtual Class_ID PreferredCollapseType(IObject* pCont, Object* pSystem) { return triObjectClassID; }
* \brief
*/
virtual Class_ID PreferredCollapseType(IObject* pCont, Object* pSystem) { return triObjectClassID; }
/*! \fn virtual BOOL CanDoDisplacementMapping(IObject* pCont, Object* pSystem) { return 0; }
* \brief
*/
virtual BOOL CanDoDisplacementMapping(IObject* pCont, Object* pSystem) { return 0; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFRENDER_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFRENDER_INTERFACE); }
};
inline IPFRender* PFRenderInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFRenderInterface(obj));
};
inline IPFRender* PFRenderInterface(INode* node) {
return ((node == NULL) ? NULL : PFRenderInterface(node->GetObjectRef()));
};
#endif // _IPFRENDER_H_

View File

@ -0,0 +1,235 @@
/*! \file IPFSystem.h
\brief Interface for Event-Driven Particle System. PF System has a system-specific parameters like a
maximum number of particles in the system, integration
step size etc. Operators and Tests may request values
of those parameters through the interface.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-22-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFSYSTEM_H_
#define _IPFSYSTEM_H_
#include "Max.h"
#include "PFExport.h"
#include "IPViewManager.h"
// interface ID
#define PFSYSTEM_INTERFACE Interface_ID(0x74f93d00, 0x1eb34700)
#define GetPFSystemInterface(obj) ((IPFSystem*)((GetPFObject(obj))->GetInterface(PFSYSTEM_INTERFACE)))
class IPFSystem : public FPMixinInterface
{
public:
// function IDs
enum { kGetMultiplier,
kGetBornAllowance,
kHasEmitter,
kGetEmitterType,
kGetEmitterDimensions,
kGetEmitterGeometry,
kIsEmitterGeometryAnimated,
kSetRenderState,
kIsRenderState,
kGetIntegrationStep,
kGetUpdateType,
kNumParticlesSelected,
kGetSelectedParticleID,
kIsParticleSelected,
kNumActionListsSelected,
kGetSelectedActionList,
kIsActionListSelected,
kIsRunningScript,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetMultiplier, TYPE_FLOAT, GetMultiplier, TYPE_TIMEVALUE );
FN_0(kGetBornAllowance, TYPE_INT, GetBornAllowance );
FN_0(kHasEmitter, TYPE_bool, HasEmitter);
FN_1(kGetEmitterType, TYPE_INT, GetEmitterType, TYPE_TIMEVALUE );
VFN_2(kGetEmitterDimensions, GetEmitterDimensions, TYPE_TIMEVALUE, TYPE_FLOAT_TAB_BR );
FN_1(kGetEmitterGeometry, TYPE_MESH, GetEmitterGeometry, TYPE_TIMEVALUE);
FN_0(kIsEmitterGeometryAnimated, TYPE_bool, IsEmitterGeometryAnimated);
VFN_1(kSetRenderState, SetRenderState, TYPE_bool);
FN_0(kIsRenderState, TYPE_bool, IsRenderState);
FN_0(kGetIntegrationStep, TYPE_TIMEVALUE, GetIntegrationStep);
FN_0(kGetUpdateType, TYPE_INT, GetUpdateType);
FN_0(kNumParticlesSelected, TYPE_INT, NumParticlesSelected);
FN_1(kGetSelectedParticleID, TYPE_INDEX, GetSelectedParticleID, TYPE_INDEX);
FN_1(kIsParticleSelected, TYPE_bool, IsParticleSelected, TYPE_INDEX);
FN_0(kNumActionListsSelected, TYPE_INT, NumActionListsSelected);
FN_1(kGetSelectedActionList, TYPE_INODE, GetSelectedActionList, TYPE_INDEX);
FN_1(kIsActionListSelected, TYPE_bool, IsActionListSelected, TYPE_INODE);
FN_0(kIsRunningScript, TYPE_bool, IsRunningScript);
END_FUNCTION_MAP
/** @defgroup IPFSystem IPFSystem.h
* @{
*/
/*! \fn virtual float GetMultiplier(TimeValue time) = 0;
* \brief Returns multiplier coefficient to generate particles. Value 1.0f means that
an operator produces particles at 100% rate. Value 0.5f means that an operator
produces only half of particles that it supposed to be generating, i.e. if
a Birth operator is set to produce 1000 particles total, then under multiplier = 0.5f
the operator produces only 500 particles.
*/
virtual float GetMultiplier(TimeValue time) = 0;
/*! \fn virtual int GetBornAllowance() = 0;
* \brief Returns number of particles allowed to be generated at current time. Particle system has
an upper limit of a total number of particles in the system. At each moment of time
particle system is able to calculate the current number of particle in the system and
how many particles are allowed to be generated to not exceed the limit threshold. Birth and
Spawn Operators use this method to find out how many particles they are allowed to generate.
*/
virtual int GetBornAllowance() = 0;
/*! \fn virtual bool HasEmitter() { return false; }
* \brief PF System has an icon that can be used as an emitter for particles. For Operators to use
the icon as an emitter the following five methods should be supported. If PF System doesn't
support emitter icon then it returns "false" in the first method. The default implementation
of the following five methods is if PF System doesn't support icon emission.
*/
virtual bool HasEmitter() { return false; }
// emitter types
enum { kEmitterType_none = -1,
kEmitterType_rectangle = 0,
kEmitterType_circle,
kEmitterType_box,
kEmitterType_sphere,
kEmitterType_mesh
};
/*! \fn virtual int GetEmitterType(TimeValue time) { return kEmitterType_none; }
* \brief
*/
virtual int GetEmitterType(TimeValue time) { return kEmitterType_none; }
/*! \fn virtual void GetEmitterDimensions(TimeValue time, Tab<float>& dimensions) { }
* \brief Returns spacial dimensions of the emitter icon. It may have less or more than three
as emitter type requires. For example, sphere emitter type has only one dimension.
*/
virtual void GetEmitterDimensions(TimeValue time, Tab<float>& dimensions) { }
/*! \fn virtual Mesh* GetEmitterGeometry(TimeValue time) { return NULL; }
* \brief Returns emitter geometry in form of mesh.
*/
virtual Mesh* GetEmitterGeometry(TimeValue time) { return NULL; }
/*! \fn virtual bool IsEmitterGeometryAnimated() { return false; }
* \brief If the emitter mesh is geometry-animated, return "true" in the following method.
*/
virtual bool IsEmitterGeometryAnimated() { return false; }
/*! \fn virtual void SetRenderState(bool renderState=true) = 0;
* \brief PF System has two states: render and viewport. At any given moment PF System
is exclusively in one state or the other. PF System may have different parameters
during render and viewport (i.e. Multiplier value, or emitter geometry etc.)
therefore it's important to know what state the PF System is in. It's also
possible to alterate the state of PF System. PF System alterates its state
automatically when the rendering starts and when the rendering ends.
*/
virtual void SetRenderState(bool renderState=true) = 0;
/*! \fn virtual bool IsRenderState() const = 0;
* \brief Works with SetRenderState.
*/
virtual bool IsRenderState() const = 0;
/*! \fn virtual TimeValue GetIntegrationStep() const = 0;
* \brief PF System has an integration step parameter that defines granularity in proceeding
particles in time. An PF System may have different integration steps for viewports
and for render.
*/
virtual TimeValue GetIntegrationStep() const = 0;
/*! \fn virtual int GetUpdateType() const { return GetPFUpdateType(); } // uses global UpdateType method from IPViewManager
* \brief PF system has different modes for update.
Forward mode: particles aren't updated right away. At playback time the particle history is
not recalculated. Only new events that will happen with the particles have new settings
Complete mode: the whole particle animation is recalculated.
*/
enum { kPFUpdateType_complete, kPFUpdateType_forward };
virtual int GetUpdateType() const { return GetPFUpdateType(); } // uses global UpdateType method from IPViewManager
/*! \fn virtual int NumParticlesSelected() const { return 0; }
* \brief PF system may select sub-components. There are two types of sub-components: particles and
action lists. Returns amount of selected particles.
*/
virtual int NumParticlesSelected() const { return 0; }
/*! \fn virtual int GetSelectedParticleID(int i) const { return 0; }
* \brief Returns born ID of the i-th selected particle
*/
virtual int GetSelectedParticleID(int i) const { return 0; }
/*! \fn virtual bool IsParticleSelected(int id) const { return false; }
* \brief Verifies if a particle with the given born ID is selected or not
*/
virtual bool IsParticleSelected(int id) const { return false; }
/*! \fn virtual int NumActionListsSelected() const { return 0; }
* \brief Returns amount of selected action lists
*/
virtual int NumActionListsSelected() const { return 0; }
/*! \fn virtual INode* GetSelectedActionList(int i) const { return NULL; }
* \brief Returns node of the i-th selected action list
*/
virtual INode* GetSelectedActionList(int i) const { return NULL; }
/*! \fn virtual bool IsActionListSelected(INode* inode) const { return false; }
* \brief Verifies if an action list is selected or not
*/
virtual bool IsActionListSelected(INode* inode) const { return false; }
/*! \fn virtual bool IsRunningScript() const { return false; }
* \brief Returns true if the particle system is in the process of runnint Every Step or Final Step scripts
*/
virtual bool IsRunningScript() const { return false; }
/*! \fn virtual bool IsCopyClone() const { return true; }
* \brief For internal use.
*/
virtual bool IsCopyClone() const { return true; }
/*! \fn virtual void ResetCopyClone() { ; }
* \brief Works with IsCopyClone.
*/
virtual void ResetCopyClone() { ; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFSYSTEM_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFSYSTEM_INTERFACE); }
/*@}*/
};
inline IPFSystem* PFSystemInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFSystemInterface(obj));
};
inline IPFSystem* PFSystemInterface(INode* node) {
return ((node == NULL) ? NULL : PFSystemInterface(node->GetObjectRef()));
};
#endif // _IPFSYSTEM_H_

View File

@ -0,0 +1,117 @@
/*! \file IPFSystemPool.h
\brief The interface and a method are used to access a list
of all PF particle systems in the current scene.
It is possible to register notification with the object
thus getting notification each time when the set of
all PF particle systems is changing (create, clone, delete).
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 08-20-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFSYSTEMPOOL_H_
#define _IPFSYSTEMPOOL_H_
#include "Max.h"
#include "notify.h"
#include "PFExport.h"
// interface ID
#define PFSYSTEMPOOL_INTERFACE Interface_ID(0x74f93d0a, 0x1eb34500)
#define GetPFSystemPoolInterface(obj) ((IPFSystemPool*)obj->GetInterface(PFSYSTEMPOOL_INTERFACE))
class IPFSystemPool : public FPMixinInterface
{
public:
// function IDs
enum { kNumPFSystems,
kGetPFSystem,
kHasPFSystem,
kHasPFSystemByHandle,
kRegisterNotification,
kUnRegisterNotification
};
BEGIN_FUNCTION_MAP
FN_0(kNumPFSystems, TYPE_INT, NumPFSystems );
FN_1(kGetPFSystem, TYPE_INODE, GetPFSystem, TYPE_INDEX );
FN_1(kHasPFSystem, TYPE_bool, HasPFSystem, TYPE_INODE );
FN_1(kHasPFSystemByHandle, TYPE_bool, HasPFSystemByHandle, TYPE_INT );
END_FUNCTION_MAP
/** @defgroup IPFSystemPool IPFSystemPool.h
* @{
*/
/*! \fn virtual int NumPFSystems() = 0;
* \brief returns number of PFSystems in the current scene
*/
virtual int NumPFSystems() = 0;
/*! \fn virtual INode* GetPFSystem(int i) = 0;
* \brief Returns i-th PFSystem in the scene
* \param i: PFSystem index
*/
virtual INode* GetPFSystem(int i) = 0;
/*! \fn virtual bool HasPFSystem(INode* node) = 0;
* \brief Checks if the given PFSystem node is present in the scene
* \param node: PFSystem node
*/
virtual bool HasPFSystem(INode* node) = 0;
/*! \fn virtual bool HasPFSystemByHandle(int handle) = 0;
* \brief Check if the scene has a PFSystem with the given node handle
*/
virtual bool HasPFSystemByHandle(int handle) = 0;
/*! \fn virtual int RegisterNotification(NOTIFYPROC proc, void *param) = 0;
* \brief Register notification with the PFSystem pool.
The given function is called each time the set of all PFSystems is changing.
Returns nonzero if the event was registered; otherwise zero.
* \param proc: The callback function called when the event occurs.
*/
virtual int RegisterNotification(NOTIFYPROC proc, void *param) = 0;
/*! \fn virtual int UnRegisterNotification(NOTIFYPROC proc, void *param) = 0;
* \brief Unregister notification with the PFSystem pool.
This function is called to break the connection between the event and the callback.
After this function executes the callback is no longer invoked when the event occurs.
Returns nonzero if the event was unregistered; otherwise zero.
* \param proc: The callback function called when the event occurs.
*/
virtual int UnRegisterNotification(NOTIFYPROC proc, void *param) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFSYSTEMPOOL_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFSYSTEMPOOL_INTERFACE); }
/*! \fn friend PFExport IPFSystemPool* GetPFSystemPool();
* \brief Friend function declarations
*/
friend PFExport IPFSystemPool* GetPFSystemPool();
protected:
PFExport IPFSystemPool();
static IPFSystemPool* m_pool; // the one and only PFSystem Pool in the scene
};
/*! \fn PFExport IPFSystemPool* GetPFSystemPool();
* \brief Gets PFSystemPool from the scene
*/
PFExport IPFSystemPool* GetPFSystemPool();
/*@}*/
#endif // _IPFSYSTEMPOOL_H_

View File

@ -0,0 +1,190 @@
/*! \file IPFTest.h
\brief Test-generic interface IPFTest. This is a part of every PF Test.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-12-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFTEST_H_
#define _IPFTEST_H_
#include "Max.h"
#include "IPFIntegrator.h"
#include "IPFArrow.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFTEST_INTERFACE Interface_ID(0x74f93d02, 0x1eb34500)
#define GetPFTestInterface(obj) ((IPFTest*)((GetPFObject(obj))->GetInterface(PFTEST_INTERFACE)))
class IPFTest : public FPMixinInterface
{
public:
// function IDs
enum { kProceedStep1,
kProceedStep2,
kGetNextActionList,
kSetNextActionList,
kSetLinkActive,
kClearNextActionList
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_5(kProceedStep1, ProceedStep1, TYPE_IOBJECT, TYPE_OBJECT, TYPE_INODE, TYPE_INODE, TYPE_INTERFACE);
FN_6(kProceedStep2, TYPE_bool, ProceedStep2, TYPE_TIMEVALUE, TYPE_FLOAT, TYPE_TIMEVALUE_BR, TYPE_FLOAT_BR, TYPE_BITARRAY_BR, TYPE_FLOAT_TAB_BR);
FN_2(kGetNextActionList, TYPE_INODE, GetNextActionList, TYPE_INODE, TYPE_bool_BP );
FN_2(kSetNextActionList, TYPE_bool, SetNextActionListMXS, TYPE_INODE, TYPE_INODE);
FN_2(kSetLinkActive, TYPE_bool, SetLinkActive, TYPE_bool, TYPE_INODE);
FN_1(kClearNextActionList, TYPE_bool, ClearNextActionList, TYPE_INODE);
END_FUNCTION_MAP
/** @defgroup IPFTest IPFTest.h
* @{
*/
/*! \fn PFExport IPFTest();
* \brief
*/
PFExport IPFTest();
/*! \fn virtual bool Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd,
Object* pSystem, INode* pNode, INode* actionNode, IPFIntegrator* integrator,
BitArray& testResult, Tab<float>& testTime) = 0;
* \brief Returns true if the test has been proceeded successfully. Verifies the test condition and may change particle channels;
particle (that satisfy the condition) may be advanced to the time of the condition
satisfaction according to the inertia operator "integrator". If ptr to the integrator
is set to NULL then particles are not advanced in time.
\param timeStart: the time for a particle to start the simulation. Each particle
may have its own current valid time greater than timeStart. In this
case the test should consider the current particle time and
timeEnd parameter.
\param timeEnd: the time for particles to come to; each particle may have its
own current valid time; the parameter sets the time for all
particles to synchronize to.
Sometimes the test may not be able to proceed all the
particles to the given timeEnd. In this case the operator proceeds
the particles as far as possible and set the parameter to the
time achieved. All the following actions will be given the new
timeEnd value as a time value for particles to come to,
and the particle system will run another round of action stack
modification in the attempt to proceed all the particles to the
initially set time.
\param pSystem: the particle system that generates the particle stream;
the same operator may get calls from different particle systems; if the
result varies according to the particle system that generates
particles, then this parameter is useful
\param pNode: INode of the particle system that generates the particles.
\param actionNode: INode of the test
\param integrator: an operator to proceed particles according to "inertia" rules.
The operator updates time, speed, position, spin, orientation channels
on the basis of time, acceleration, speed, angular acceleration and
spin channels. Each particle system has a default inertia operator.
When an action want to update current time for particles, it
uses the "inertia" operator. An Action in the ActionList stack my "switch"
the suggested "inertia" operator by its own if the Action support
the "inertial" operator interface. The particle system recognizes
such an Action as a holder of "inertia" interface, and use it
for "inertia" purposes later on.
If the parameter is NULL then the particle system doesn't allow
the test to advance particles in the time channel
\param testResult: a bit array to indicate which particles satisfy the test condition
\param testTime: for particles that satisfy the condition, the list of time moments when
a particle satisfies the condifion. The tab has the same number of entry as
particles in the container. Only for particles that satisfy the condition
the entry is set.
*/
virtual bool Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd,
Object* pSystem, INode* pNode, INode* actionNode, IPFIntegrator* integrator,
BitArray& testResult, Tab<float>& testTime) = 0;
/*! \fn virtual void ProceedStep1(IObject* pCont, Object* pSystem, INode* pNode, INode* actionNode, FPInterface* integrator) = 0;
* \brief FnPub alternative to virtual bool Proceed() above. FnPub doesn't allow having more than 7 parameters; therefore the method consists of two parts. The methods
should be called successively: Step1 and then Step2.
*/
virtual void ProceedStep1(IObject* pCont, Object* pSystem, INode* pNode, INode* actionNode, FPInterface* integrator) = 0;
/*! \fn virtual bool ProceedStep2(TimeValue timeStartTick, float timeStartFraction,
TimeValue& timeEndTick, float& timeEndFraction,
BitArray& testResult, Tab<float>& testTime) = 0;
* \brief FnPub alternative to virtual bool Proceed() above. FnPub doesn't allow having more than 7 parameters; therefore the method consists of two parts. The methods
should be called successively: Step1 and then Step2.
*/
virtual bool ProceedStep2(TimeValue timeStartTick, float timeStartFraction,
TimeValue& timeEndTick, float& timeEndFraction,
BitArray& testResult, Tab<float>& testTime) = 0;
/*! \fn PFExport INode* GetNextActionList(INode* test, bool* linkActive=NULL);
* \brief Gets INode of the next ActionList. If particle satisfies the test then it is directed
to this ActionList. Since a test may have several INode instances with different next events,
it is necessary to define the INode the method returns activity status of the link to the next ActionList.
*/
PFExport INode* GetNextActionList(INode* test, bool* linkActive=NULL);
/*! \fn PFExport bool SetNextActionList(INode* nextAL, INode* test);
* \brief Modifies the next ActionList for the test. Returns true if the next actionList has been set successfully.
The nextAL node can be rejected if it is not real actionList.
*/
PFExport bool SetNextActionList(INode* nextAL, INode* test);
/*! \fn PFExport bool SetNextActionListMXS(INode* nextAL, INode* test);
* \brief FnPub alternative for the method above; used by maxscript to set the next action list
*/
PFExport bool SetNextActionListMXS(INode* nextAL, INode* test);
/*! \fn PFExport bool SetLinkActive(bool active, INode* test);
* \brief Modifies activity status for the link to the next ActionList. Returns true if the modification has been done successfully
*/
PFExport bool SetLinkActive(bool active, INode* test);
/*! \fn PFExport bool ClearNextActionList(INode* test);
* \brief Deletes the wire going to the nextActionList for the test. Returns true if the wire was deleted successfully.
The test node can be rejected if it is not a real test action.
*/
PFExport bool ClearNextActionList(INode* test);
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFTEST_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFTEST_INTERFACE); }
/*! \fn inline void updateNextActionListValue(INode* nextAL) { m_nextActionList = nextAL; }
* \brief for internal use only
*/
inline void updateNextActionListValue(INode* nextAL) { m_nextActionList = nextAL; }
/*! \fn inline void updateArrowValue(Object* arrow) { m_arrow = arrow; }
* \brief for internal use only
*/
inline void updateArrowValue(Object* arrow) { m_arrow = arrow; }
/*! \fn inline void updateLinkActiveValue(bool linkActive) { m_linkActive = linkActive; }
* \brief for internal use only
*/
inline void updateLinkActiveValue(bool linkActive) { m_linkActive = linkActive; }
protected:
INode* m_nextActionList; // an actionList node for the next event.
Object* m_arrow; // an arrow object that controls the gate to the next ActionList
bool m_linkActive; // status of the link to the next ActionList
};
inline IPFTest* PFTestInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFTestInterface(obj));
};
inline IPFTest* PFTestInterface(INode* node) {
return ((node == NULL) ? NULL : PFTestInterface(node->GetObjectRef()));
};
#endif // _IPFTEST_H_

View File

@ -0,0 +1,92 @@
/*! \file IPFViewport.h
\brief Viewport related interface for an Operator
If an Operator has a Viewport interface
then the Operator is called to draw particles
in the current ActionList
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-07-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFVIEWPORT_H_
#define _IPFVIEWPORT_H_
#include "Max.h"
#include "PFExport.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFVIEWPORT_INTERFACE Interface_ID(0x1a340cb9, 0x26d12e01)
#define GetPFViewportInterface(obj) ((IPFViewport*)((GetPFObject(obj))->GetInterface(PFVIEWPORT_INTERFACE)))
class IPFViewport : public FPMixinInterface
{
public:
/** @defgroup IPFViewport IPFViewport.h
* @{
*/
/*! \fn virtual int Display(IObject* pCont, TimeValue time, Object* pSystem, INode* psNode, INode* pgNode, ViewExp *vpt, int flags) = 0;
* \brief The following methods are redirected from the particle object level to
a particular ActionList. The first parameter is a particle container of the ActionList.
\param pCont: particle container to draw particles from
\param time: current frame to draw particles at. It's supposed that the container has been already updated to satisfy this moment
\param pSystem: particle system that makes the call
\param psNode: INode of the particle system.
\param pgNode: INode of particle group. Particle system may have several particle groups according to number of ActionLists
\param vpt: viewport as of the BaseObject::Display(...) method
\param flags: flags as of the BaseObject::Display(...) method
*/
virtual int Display(IObject* pCont, TimeValue time, Object* pSystem, INode* psNode, INode* pgNode, ViewExp *vpt, int flags) = 0;
/*! \fn virtual int HitTest(IObject* pCont, TimeValue time, Object* pSystem, INode* psNode, INode* pgNode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt) = 0;
* \brief See virtual int Display()
*/
virtual int HitTest(IObject* pCont, TimeValue time, Object* pSystem, INode* psNode, INode* pgNode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt) = 0;
/*! \fn virtual void GetWorldBoundBox(IObject* pCont, TimeValue time, Object* pSystem, INode* pgNode, ViewExp* vp, Box3& box ) = 0;
* \brief See virtual int Display()
*/
virtual void GetWorldBoundBox(IObject* pCont, TimeValue time, Object* pSystem, INode* pgNode, ViewExp* vp, Box3& box ) = 0;
/*! \fn virtual void GetLocalBoundBox(IObject* pCont, TimeValue time, Object* pSystem, INode* pgNode, ViewExp* vp, Box3& box ) = 0;
* \brief See virtual int Display()
*/
virtual void GetLocalBoundBox(IObject* pCont, TimeValue time, Object* pSystem, INode* pgNode, ViewExp* vp, Box3& box ) = 0;
/*! \fn virtual DWORD GetWireColor() const = 0;
* \brief See virtual int Display()
*/
virtual DWORD GetWireColor() const = 0;
/*! \fn virtual void SetWireColor(DWORD color) = 0;
* \brief See virtual int Display()
*/
virtual void SetWireColor(DWORD color) = 0;
/*! \fn virtual void MaybeEnlargeViewportRect(IObject* pCont, TimeValue time, GraphicsWindow *gw, Rect &rect) { ; }
* \brief See virtual int Display()
*/
virtual void MaybeEnlargeViewportRect(IObject* pCont, TimeValue time, GraphicsWindow *gw, Rect &rect) { ; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFVIEWPORT_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFVIEWPORT_INTERFACE); }
};
inline IPFViewport* PFViewportInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFViewportInterface(obj));
};
inline IPFViewport* PFViewportInterface(INode* node) {
return ((node == NULL) ? NULL : PFViewportInterface(node->GetObjectRef()));
};
#endif // _IPFVIEWPORT_H_

View File

@ -0,0 +1,201 @@
/*! \file IPViewItem.h
\brief Interface for PViewItem. An Action should implement
the interface to be modifiable in Particle View.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 02-21-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPVIEWITEM_H_
#define _IPVIEWITEM_H_
#include "Max.h"
#include "PFExport.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PVIEWITEM_INTERFACE Interface_ID(0x74f93d08, 0x1eb34500)
#define GetPViewItemInterface(obj) ((IPViewItem*)((GetPFObject(obj))->GetInterface(PVIEWITEM_INTERFACE)))
// operator/test icon size in particle view
enum { kActionImageWidth=22, kActionImageHeight=22 }; // in pixels
class IPViewItem : public FPMixinInterface
{
public:
// function IDs
enum { kNumPViewParamBlocks,
kGetPViewParamBlock,
kHasComments,
kGetComments,
kSetComments,
kGetWireExtension,
kSetWireExtension
};
BEGIN_FUNCTION_MAP
FN_0(kNumPViewParamBlocks, TYPE_INT, NumPViewParamBlocks );
FN_1(kGetPViewParamBlock, TYPE_REFTARG, GetPViewParamBlock, TYPE_INDEX );
FN_1(kHasComments, TYPE_bool, HasComments, TYPE_INODE );
FN_1(kGetComments, TYPE_STRING, GetComments, TYPE_INODE );
VFN_2(kSetComments, SetComments, TYPE_INODE, TYPE_STRING );
FN_2(kGetWireExtension, TYPE_INT, GetWireExtension, TYPE_INODE, TYPE_INT );
VFN_3(kSetWireExtension, SetWireExtension, TYPE_INODE, TYPE_INT, TYPE_INT );
END_FUNCTION_MAP
/** @defgroup IPViewItem IPViewItem.h
* @{
*/
// constructor: inherited as a base class constructor
IPViewItem() { m_numInstances = 1; }
/*! \fn virtual int NumPViewParamBlocks() const = 0;
* \brief
*/
virtual int NumPViewParamBlocks() const = 0;
/*! \fn virtual IParamBlock2* GetPViewParamBlock(int i) const = 0;
* \brief
*/
virtual IParamBlock2* GetPViewParamBlock(int i) const = 0;
/*! \fn PFExport int NumPViewParamMaps() const;
* \brief
*/
PFExport int NumPViewParamMaps() const;
/*! \fn PFExport IParamMap2* GetPViewParamMap(int i) const;
* \brief
*/
PFExport IParamMap2* GetPViewParamMap(int i) const;
/*! \fn PFExport void AddPViewParamMap(IParamMap2* map);
* \brief
*/
PFExport void AddPViewParamMap(IParamMap2* map);
/*! \fn PFExport void RemovePViewParamMap(IParamMap2* map);
* \brief
*/
PFExport void RemovePViewParamMap(IParamMap2* map);
/*! \fn bool HasCustomPViewIcons() { return false; }
* \brief Implement if you want your operator/test to be shown with a custom icon in ParticleView.
*/
virtual bool HasCustomPViewIcons() { return false; }
/*! \fn HBITMAP GetActivePViewIcon() { return NULL; }
* \brief Implement if you want your operator/test to be shown with a custom icon in ParticleView. For operator/test when in active state.
*/
virtual HBITMAP GetActivePViewIcon() { return NULL; }
/*! \fn HBITMAP GetInactivePViewIcon() { return NULL; }
* \brief Implement if you want your operator/test to be shown with a custom icon in ParticleView. For operator when in disabled state.
*/
virtual HBITMAP GetInactivePViewIcon() { return NULL; }
/*! \fn HBITMAP GetTruePViewIcon() { return NULL; }
* \brief Implement if you want your operator/test to be shown with a custom icon in ParticleView. For test when in "always true" state.
*/
virtual HBITMAP GetTruePViewIcon() { return NULL; }
/*! \fn HBITMAP GetFalsePViewIcon() { return NULL; }
* \brief Implement if you want your operator/test to be shown with a custom icon in ParticleView. For test when in "always false" state.
*/
virtual HBITMAP GetFalsePViewIcon() { return NULL; }
/*! \fn PFExport int GetNumInstances() const;
* \brief Used to track instanced actions. An action may have several instances, which PView shows in italic font.
*/
PFExport int GetNumInstances() const;
/*! \fn PFExport void SetNumInstances(int num);
* \brief Used to track instanced actions. An action may have several instances, which PView shows in italic font.
*/
PFExport void SetNumInstances(int num);
/*! \fn PFExport void IncNumInstances();
* \brief Used to track instanced actions. An action may have several instances, which PView shows in italic font.
*/
PFExport void IncNumInstances();
/*! \fn PFExport bool HasComments(INode* itemNode) const;
* \brief A PView item can have comments.
Comments are also shown and edited via right-click above the PView item.
*/
PFExport bool HasComments(INode* itemNode) const;
/*! \fn PFExport TSTR GetComments(INode* itemNode) const;
* \brief See HasComments().
*/
PFExport TSTR GetComments(INode* itemNode) const;
/*! \fn PFExport void SetComments(INode* itemNode, TSTR comments);
* \brief See HasComments().
*/
PFExport void SetComments(INode* itemNode, TSTR comments);
/*! \fn PFExport void EditComments(INode* itemNode, HWND parentWnd, long x, long y);
* \brief See HasComments().
*/
PFExport void EditComments(INode* itemNode, HWND parentWnd, long x, long y);
/*! \fn PFExport LRESULT CALLBACK commentsProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
* \brief For internal use
*/
PFExport LRESULT CALLBACK commentsProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
/*! \fn virtual bool HasDynamicName(TSTR& nameSuffix) { return false; }
* \brief For dynamic names support; if the action has a dynamic name then it supplies the name suffix
*/
virtual bool HasDynamicName(TSTR& nameSuffix) { return false; }
/*! \fn PFExport static int GetWireExtension(INode* node, int& wireHeight);
* \brief To read/modify the length/height of the wire nub extended from an emitter, or an action list, or a test.
You must supply the node of the item. This method returns wire length.
*/
PFExport static int GetWireExtension(INode* node, int& wireHeight);
/*! \fn PFExport static void SetWireExtension(INode* node, int wireLen, int wireHight);
* \brief Sets wire length. See GetWireExtension().
*/
PFExport static void SetWireExtension(INode* node, int wireLen, int wireHight);
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWITEM_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWITEM_INTERFACE); }
/*@}*/
private:
void add(INode* itemNode, HWND hWnd);
INode* node(HWND hWnd);
HWND hWnd(INode* itemNode);
void erase(HWND hWnd);
protected:
Tab<IParamMap2*> m_paramMaps;
int m_numInstances;
Tab<INode*> m_nodes;
Tab<HWND> m_hWnds;
};
inline IPViewItem* PViewItemInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPViewItemInterface(obj));
};
inline IPViewItem* PViewItemInterface(INode* node) {
return ((node == NULL) ? NULL : PViewItemInterface(node->GetObjectRef()));
};
#endif // _IPVIEWITEM_H_

View File

@ -0,0 +1,48 @@
/*! \file IPViewItemCreator.h
\brief Interface for PViewItemCreator. A ClassDesc2 should implement
the interface to be able to create PViewItems in the Pview.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-11-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPVIEWITEMCREATOR_H_
#define _IPVIEWITEMCREATOR_H_
#include "Max.h"
// interface ID
#define PVIEWITEMCREATOR_INTERFACE Interface_ID(0x74f93d0b, 0x1eb34500)
#define GetPViewItemCreatorInterface(obj) (IPViewItemCreator*)(obj->GetInterface(PVIEWITEMCREATOR_INTERFACE))
class IPViewItemCreator : public FPMixinInterface
{
public:
/** @defgroup IPViewItemCreator IPViewItemCreator.h
* @{
*/
/*! \fn virtual bool CreateItem(int pviewX, int pviewY, Tab<INode*> *anchorNodes, Tab<INode*> *showNodes) { return false; }
* \brief A PView item may have its own creation routine.
If so, then the item is given an opportunity to create itself when the item is created in Pview.
sourceNodes is a list of anchor nodes for PViews, showNodes is a list of all
additional nodes that are added to PView to show.
*/
virtual bool CreateItem(int pviewX, int pviewY, Tab<INode*> *anchorNodes, Tab<INode*> *showNodes) { return false; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWITEMCREATOR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWITEMCREATOR_INTERFACE); }
};
/*@}*/
#endif // _IPVIEWITEMCREATOR_H_

View File

@ -0,0 +1,499 @@
/*! \file IPViewManager.h
\brief Interface for ParticleView manager and an access method
to get the PViewManager from the scene.
There is a single PViewManager in the scene that
gives us access to all Particle Views
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-11-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPVIEWMANAGER_H_
#define _IPVIEWMANAGER_H_
#include "Max.h"
#include "PFExport.h"
#include "iparamb2.h"
// interface ID
#define PVIEWMANAGER_INTERFACE Interface_ID(0x74f93d07, 0x1eb34500)
#define GetPViewManagerInterface(obj) ((IPViewManager*)obj->GetInterface(PVIEWMANAGER_INTERFACE))
class IPViewManager : public FPMixinInterface
{
public:
// function IDs
enum { kOpenParticleView,
kUpdateParticleViews,
kPreUpdateParticleViews,
kPostUpdateParticleViews,
kUpdateOnHold,
kNumActionClasses,
kActionClass,
kActionName,
kNumPViewItemClasses,
kPViewItemClass,
kPViewItemName,
kParticleViewOpenCloseToggle,
kParticleFlowActivationToggle
};
BEGIN_FUNCTION_MAP
FN_1(kOpenParticleView, TYPE_bool, OpenParticleView, TYPE_OBJECT);
FN_1(kUpdateParticleViews, TYPE_bool, UpdateParticleViews, TYPE_bool);
FN_1(kPreUpdateParticleViews, TYPE_bool, PreUpdateParticleViews, TYPE_bool);
FN_1(kPostUpdateParticleViews, TYPE_bool, PostUpdateParticleViews, TYPE_bool);
FN_0(kUpdateOnHold, TYPE_bool, UpdateOnHold);
FN_0(kNumActionClasses, TYPE_INT, NumActionClasses );
FN_1(kActionClass, TYPE_CLASS, ActionClass, TYPE_INT);
FN_1(kActionName, TYPE_STRING, ActionName, TYPE_INT);
FN_0(kNumPViewItemClasses, TYPE_INT, NumPViewItemClasses );
FN_1(kPViewItemClass, TYPE_CLASS, PViewItemClass, TYPE_INT);
FN_1(kPViewItemName, TYPE_STRING, PViewItemName, TYPE_INT);
FN_0(kParticleViewOpenCloseToggle, TYPE_bool, ParticleViewOpenCloseToggle);
FN_1(kParticleFlowActivationToggle, TYPE_bool, ParticleFlowActivationToggle, TYPE_bool);
END_FUNCTION_MAP
/** @defgroup IPViewManager IPViewManager.h
* @{
*/
/*! \fn virtual bool OpenParticleView(Object* engine) = 0;
* \brief Opens ParticleView for a given PFEngine.
If there are several ParticleViews with the given PFEngine,
a dialog pops up to make a choice.
\param engine: PFEngine to open particle view for
*/
virtual bool OpenParticleView(Object* engine) = 0;
/*! \fn virtual bool UpdateParticleViews(bool additionsOnly=false) = 0;
* \brief If nothing was delete from PView then additionsOnly is set to true
*/
virtual bool UpdateParticleViews(bool additionsOnly=false) = 0;
/*! \fn virtual bool PreUpdateParticleViews(bool additionsOnly=false) = 0;
* \brief If procedures between Pre.. and Post.. involve additions of new items only then
set "additionsOnly" to "true". The rollup panel won't be updated.
*/
virtual bool PreUpdateParticleViews(bool additionsOnly=false) = 0;
/*! \fn virtual bool PostUpdateParticleViews(bool additionsOnly=false) = 0;
* \brief If procedures between Pre.. and Post.. involve additions of new items only then
set "additionsOnly" to "true". The rollup panel won't be updated.
*/
virtual bool PostUpdateParticleViews(bool additionsOnly=false) = 0;
/*! \fn virtual bool CancelUpdateParticleViews() = 0;
* \brief Not supported for maxscript
*/
virtual bool CancelUpdateParticleViews() = 0;
/*! \fn virtual bool UpdateOnHold() = 0;
* \brief Return true when in between PreUpdate and PostUpdate
*/
virtual bool UpdateOnHold() = 0;
/*! \fn virtual void UpdateParticleAmountShown() { ; }
* \brief Updates particle amount shown in PViews
*/
virtual void UpdateParticleAmountShown() { ; }
/*! \fn virtual void ActionProceedBegin(INode* actionNode) { ; }
* \brief Shows that an action starts the proceed
*/
virtual void ActionProceedBegin(INode* actionNode) { ; }
/*! \fn virtual void ActionProceedEnd(INode* actionNode) { ; }
* \brief Shows that an action ends the proceed
*/
virtual void ActionProceedEnd(INode* actionNode) { ; }
/*! \fn virtual bool IsParticleViewInForeground() { return false; }
* \brief Check if any ParticleView is a foreground window
*/
virtual bool IsParticleViewInForeground() { return false; }
/*! \fn PFExport static int NumActionClasses();
* \brief Public classes only.
*/
PFExport static int NumActionClasses(); // public classes only
/*! \fn PFExport static ClassDesc* ActionClass(int index);
* \brief
*/
PFExport static ClassDesc* ActionClass(int index);
/*! \fn PFExport static TCHAR* ActionName(int index);
* \brief
*/
PFExport static TCHAR* ActionName(int index);
/*! \fn PFExport static int NumPViewItemClasses();
* \brief Public classes only.
*/
PFExport static int NumPViewItemClasses();
/*! \fn PFExport static ClassDesc* PViewItemClass(int index);
* \brief
*/
PFExport static ClassDesc* PViewItemClass(int index);
/*! \fn PFExport static TCHAR* PViewItemName(int index);
* \brief
*/
PFExport static TCHAR* PViewItemName(int index);
/*! \fn virtual bool ParticleViewOpenCloseToggle() = 0;
* \brief Used for CUI shortcuts.
*/
virtual bool ParticleViewOpenCloseToggle() = 0;
/*! \fn virtual bool ParticleFlowActivationToggle(bool selectedOnly=false) = 0;
* \brief Used for CUI shortcuts.
*/
virtual bool ParticleFlowActivationToggle(bool selectedOnly=false) = 0;
/*! \fn virtual int GetVacantSpace() = 0;
* \brief Returns X coordinate of half-plane of space free from any PF item.
The method is usually used to calculate (x,y) location of newly created PF systems.
*/
virtual int GetVacantSpace() = 0;
/*! \fn virtual void KeepMaterial(Mtl* mtl) = 0;
* \brief The method is used to prevent automatic removal of non-used materials from the scene.
The method is used by Shape Instance operator. The operator creates combined materials on-the-fly
to be assigned to particles. When the reference object for the operator is changed, the material
is changed. The old material could be deleted because it doesn't have any more references in the
scene. This may create a problem for undo/redo operations. To prevent that this method creates
a reference dependency between PViewManager and the Material. Since PViewManager is not
saved with the scene, the materials won't be saved either.
*/
virtual void KeepMaterial(Mtl* mtl) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWMANAGER_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWMANAGER_INTERFACE); }
/*! \fn friend PFExport IPViewManager* GetPViewManager();
friend PFExport void ReleasePViewManager();
* \brief Friend function declarations
*/
friend PFExport IPViewManager* GetPViewManager();
friend PFExport void ReleasePViewManager();
/*@}*/
protected:
PFExport IPViewManager();
PFExport virtual ~IPViewManager();
virtual void releaseManager() = 0;
static IPViewManager* m_manager; // the one and only PViewManager in the scene
static Tab<ClassEntry*> m_actionClasses;
static Tab<ClassEntry*> m_pViewItemClasses;
};
/** @defgroup IPViewManager IPViewManager.h
* @{
*/
/*! \fn PFExport IPViewManager* GetPViewManager();
* \brief Gets PViewManager from the scene
*/
PFExport IPViewManager* GetPViewManager();
/*! \fn PFExport INode *CreatePFNode( Object *obj);
* \brief Creates an INode used by ParticleFlow objects (actions, engines etc.)
The ParticleFlow INode has some properties that are different from a regular INode.
*/
PFExport INode *CreatePFNode( Object *obj);
/*! \fn PFExport void DeletePFNode(INode* node);
* \brief Deletes a PF-type INode. The ParticleFlow INode has some properties that are
different from a regular INode. Also, deleting a node by the methods cleans up
the scene from associated elements, for example deleting a PF emitter also
removes all global actions and exclusive actionLists downstream.
There won't be any harm done if a regular INode is deleted by the method.
The plug-in is able to classify the given node to choose the appropriate way of action.
*/
PFExport void DeletePFNode(INode* node);
/*! \fn PFExport bool AppendPFAction(INode* actionList, INode* action);
* \brief There is a special relationship between an action list and an action.
The following four methods ensure the consistency in this relationship.
Since PF particle system has a list of global action, the system can also
be considered as an action list.
*/
PFExport bool AppendPFAction(INode* actionList, INode* action);
/*! \fn PFExport bool InsertPFAction(INode* actionList, INode* action, int indexAt);
* \brief Ensures consistency in relationship between action list and action. See AppendPFAction();
*/
PFExport bool InsertPFAction(INode* actionList, INode* action, int indexAt);
/*! \fn PFExport bool RemovePFAction(INode* actionList, int index);
* \brief Ensures consistency in relationship between action list and action. See AppendPFAction();
*/
PFExport bool RemovePFAction(INode* actionList, int index);
/*! \fn PFExport bool RemovePFAction(INode* actionList, INode* action);
* \brief Ensures consistency in relationship between action list and action. See AppendPFAction();
*/
PFExport bool RemovePFAction(INode* actionList, INode* action);
/*! \fn PFExport int GetPViewVacantSpace(INode* excludeNode=NULL);
* \brief Returns X coordinate of half-plane of space free from any PF item.
The method is usually used to calculate (x,y) location of newly created PF systems.
If given node is not NULL, then the node is excluded from consideration while looking
for free PView space.
*/
PFExport int GetPViewVacantSpace(INode* excludeNode=NULL);
/*! \fn PFExport int GetPViewMaximumZOrderIndex(INode* excludeNode=NULL);
* \brief All items in PView are shown according to their Z order index.
Returns the highest Z order index amongst all particle systems and action lists.
*/
PFExport int GetPViewMaximumZOrderIndex(INode* excludeNode=NULL);
/*! \fn PFExport bool CompactPViewZOrder();
* \brief The Z order sequence may have some "holes". The method makes the sequence to
be more compact by eliminating these "holes".
Returns true if there were "holes"; and false if it is already compact.
*/
PFExport bool CompactPViewZOrder();
/*! \fn PFExport void RegisterParticleFlowNotification();
* \brief ParticleFlow has to track creation of new PF items.
For ParticleFlow Shell: the system creates a default configuration and sets PView location.
For ActionList: the system sets PView location.
For Action: the system creates an ActionList that includes the Action, and sets PView location.
To avoid this extra effort from the system side, use Suspend/Resume methods.
*/
PFExport void RegisterParticleFlowNotification();
/*! \fn PFExport void SuspendParticleFlowNotification();
* \brief Avoids extra effort for tracking. See RegisterParticleFlowNotification();
*/
PFExport void SuspendParticleFlowNotification();
/*! \fn PFExport void ResumeParticleFlowNotification();
* \brief Avoids extra effort for tracking. See RegisterParticleFlowNotification();
*/
PFExport void ResumeParticleFlowNotification();
/*! \fn PFExport bool IsParticleFlowNotificationSuspended();
* \brief Avoids extra effort for tracking. See RegisterParticleFlowNotification();
*/
PFExport bool IsParticleFlowNotificationSuspended();
/*! \fn PFExport void ReleasePViewManager();
* \brief The method is used to release PViewManager when a scene is closed.
For internal use only.
*/
PFExport void ReleasePViewManager();
/*! \fn PFExport int GetPFInt(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
* \brief GetPFInt, GetPFFloat and GetPFTimeValue reinforce value boundaries set for parameter values.
Can be used instead of pblock()->GetInt and pblock()->GetFloat to be
sure that the result values are stay inside the parameter boundaries no matter what.
*/
PFExport int GetPFInt(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
/*! \fn PFExport float GetPFFloat(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
* \brief See GetPFInt();
*/
PFExport float GetPFFloat(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
/*! \fn PFExport TimeValue GetPFTimeValue(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
* \brief See GetPFInt();
*/
PFExport TimeValue GetPFTimeValue(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
/*! \fn PFExport bool ValidateParticleFlows();
* \brief For internal use. The method is used to make all ParticleFlow elements valid.
The method traverses the scene to collect all ParticleFlow elements
then it removes the invalid ones and fixes elements that are fixable.
Returns true is the scene was valid, and false if the scene was invalid.
*/
PFExport bool ValidateParticleFlows();
enum { kPFDefaultDisplay_global, kPFDefaultDisplay_local };
/*! \fn PFExport int GetPFDefaultDisplay();
* \brief
*/
PFExport int GetPFDefaultDisplay();
/*! \fn PFExport void SetPFDefaultDisplay(int type);
* \brief
*/
PFExport void SetPFDefaultDisplay(int type);
/*! \fn PFExport void InitPFDefaultDisplay(int type);
* \brief
*/
PFExport void InitPFDefaultDisplay(int type);
enum { kPFActionOrder_globalsFirst, kPFActionOrder_localsFirst };
/*! \fn PFExport int GetPFActionOrder();
* \brief
*/
PFExport int GetPFActionOrder();
/*! \fn PFExport void SetPFActionOrder(int order);
* \brief
*/
PFExport void SetPFActionOrder(int order);
/*! \fn PFExport void InitPFActionOrder(int order);
* \brief
*/
PFExport void InitPFActionOrder(int order);
// PF particle system has different modes for update.
// Forward mode: particles aren't updated right away. At playback time the particle history is
// not recalculated. Only new events that will happen with the particles have new settings
// Complete mode: the whole particle animation is recalculated.
enum { kPFUpdateType_complete, kPFUpdateType_forward };
/*! \fn PFExport int GetPFUpdateType();
* \brief
*/
PFExport int GetPFUpdateType();
/*! \fn PFExport void SetPFUpdateType(int type);
* \brief
*/
PFExport void SetPFUpdateType(int type);
/*! \fn PFExport void InitPFUpdateType(int type);
* \brief
*/
PFExport void InitPFUpdateType(int type);
// names of actions in PView may have a dynamic suffix to reflect the most important settings of the action
enum { kPFDynamicNames_no, kPFDynamicNames_yes };
/*! \fn PFExport int GetPFDynamicNames();
* \brief Names of actions in PView may have a dynamic suffix to reflect the most important settings of the action.
*/
PFExport int GetPFDynamicNames();
/*! \fn PFExport void SetPFDynamicNames(int type);
* \brief Names of actions in PView may have a dynamic suffix to reflect the most important settings of the action.
*/
PFExport void SetPFDynamicNames(int type);
/*! \fn PFExport void InitPFDynamicNames(int type);
* \brief Names of actions in PView may have a dynamic suffix to reflect the most important settings of the action.
*/
PFExport void InitPFDynamicNames(int type);
/*! \fn PFExport void DisableParticleInvalidation();
* \brief Particle system and operators/tests may have reference object (i.e. define an emitting area).
An operator may require TM of a reference object at different moments. If the reference object
has a complex controller, the action of requesting the state of the reference object, if the time
is different from the current time, may inflict REFMSG_CHANGE message thus provoking invalidation
of the whole particle system. To prevent that, at the moment of acquiring the reference object TMs,
the operator should disable particle invalidation, and then enable the invalidation when it is done
with the reference object.
*/
PFExport void DisableParticleInvalidation();
/*! \fn PFExport void EnableParticleInvalidation();
* \brief See DisableParticleInvalidation();
*/
PFExport void EnableParticleInvalidation();
/*! \fn PFExport bool IsAbleInvalidateParticles();
* \brief See DisableParticleInvalidation();
*/
PFExport bool IsAbleInvalidateParticles();
/*! \fn PFExport void SetIgnoreEmitterTMChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void SetIgnoreEmitterTMChange();
/*! \fn PFExport void ClearIgnoreEmitterTMChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void ClearIgnoreEmitterTMChange();
/*! \fn PFExport bool IsIgnoringEmitterTMChange();
* \brief See DisableParticleInvalidation();
*/
PFExport bool IsIgnoringEmitterTMChange();
/*! \fn PFExport void SetIgnoreEmitterPropChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void SetIgnoreEmitterPropChange();
/*! \fn PFExport void ClearIgnoreEmitterPropChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void ClearIgnoreEmitterPropChange();
/*! \fn PFExport bool IsIgnoringEmitterPropChange();
* \brief For more selective tuning in notification change
*/
PFExport bool IsIgnoringEmitterPropChange();
/*! \fn PFExport void SetIgnoreRefNodeChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void SetIgnoreRefNodeChange();
/*! \fn PFExport void ClearIgnoreRefNodeChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void ClearIgnoreRefNodeChange();
/*! \fn PFExport bool IsIgnoringRefNodeChange();
* \brief See DisableParticleInvalidation();
*/
PFExport bool IsIgnoringRefNodeChange();
/*! \fn PFExport void SetPFProceedStatus();
* \brief When a particle system is in the process of calculation/evaluation, it is not advisable to invalidate
particle containers. This method sets the proceed status.
*/
PFExport void SetPFProceedStatus();
/*! \fn PFExport void ClearPFProceedStatus();
* \brief When a particle system is in the process of calculation/evaluation, it is not advisable to invalidate
particle containers. This method clears the proceed status.
*/
PFExport void ClearPFProceedStatus();
/*! \fn PFExport bool IsPFProceeding();
* \brief When a particle system is in the process of calculation/evaluation, it is not advisable to invalidate
particle containers. This method checks if PF is proceeding.
*/
PFExport bool IsPFProceeding();
/*! \fn PFExport Object* GetPFObject(Object* obj);
* \brief ParticleFlow relays on presence of specific interfaces in PF objects. Sometimes the objects are
hidden behind layers of XRef objects and WSM modifiers. To reach the real PF object underneath,
use this method.
*/
PFExport Object* GetPFObject(Object* obj);
// constants for particle view spacement and location
enum { kPViewActionListHorSpace=20 };
/*@}*/
#endif // _IPFINTEGRATOR_H_

View File

@ -0,0 +1,266 @@
/*! \file IParticleChannel.h
\brief Channel-generic interfaces IParticleChannel
This is a part of every particle channel.
Helps to determine read/write category of the given
particle interface and to manage memory deallocation
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-09-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNEL_H_
#define _IPARTICLECHANNEL_H_
#include "Max.h"
#include "PFExport.h"
// interface ID
#define PARTICLECHANNEL_INTERFACE Interface_ID(0x74f93b00, 0x1eb34400)
#define GetParticleChannelInterface(obj) ((IParticleChannel*)obj->GetInterface(PARTICLECHANNEL_INTERFACE))
class IParticleChannel : public FPMixinInterface
{
public:
// function IDs
enum { kClone,
kIsSimilarChannel,
kIsTransferable,
kSetTransferable,
kIsPrivateChannel,
kGetPrivateOwner,
kSetPrivateOwner,
kGetCreatorAction,
kSetCreatorAction,
kGetReadID_PartA,
kGetReadID_PartB,
kGetWriteID_PartA,
kGetWriteID_PartB,
kSetReadID,
kSetWriteID
};
// chunk IDs for saving and loading
// developer: you may have your own chunk IDs
// they are factored here for convenience
enum { kChunkCount = 1000,
kChunkData = 1010,
kChunkGlobalCount = 1020,
kChunkSharedCount = 1021,
kChunkGlobalValue = 1030,
kChunkSharedValue = 1031,
kChunkReadID = 1040,
kChunkWriteID = 1050,
kChunkTransferable = 1055,
kChunkPrivate = 1056,
kChunkActionHandle = 1057,
kChunkValue1 = 1061,
kChunkValue2 = 1062,
kChunkValue3 = 1063,
kChunkValue4 = 1064,
kChunkValue5 = 1065,
kChunkValue6 = 1066,
kChunkValue7 = 1067
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_0(kClone, TYPE_IOBJECT, Clone);
FN_1(kIsSimilarChannel, TYPE_bool, IsSimilarChannel, TYPE_IOBJECT);
FN_0(kIsTransferable, TYPE_bool, IsTransferable);
VFN_1(kSetTransferable, SetTransferable, TYPE_bool);
FN_0(kIsPrivateChannel, TYPE_bool, IsPrivateChannel);
FN_0(kGetPrivateOwner, TYPE_OBJECT, GetPrivateOwner);
VFN_1(kSetPrivateOwner, SetPrivateOwner, TYPE_OBJECT);
FN_0(kGetCreatorAction, TYPE_INODE, GetCreatorAction);
VFN_1(kSetCreatorAction, SetCreatorAction, TYPE_INODE);
FN_0(kGetReadID_PartA, TYPE_DWORD, GetReadID_PartA);
FN_0(kGetReadID_PartB, TYPE_DWORD, GetReadID_PartB);
FN_0(kGetWriteID_PartA, TYPE_DWORD, GetWriteID_PartA);
FN_0(kGetWriteID_PartB, TYPE_DWORD, GetWriteID_PartB);
VFN_2(kSetReadID, SetReadID, TYPE_DWORD, TYPE_DWORD);
VFN_2(kSetWriteID, SetWriteID, TYPE_DWORD, TYPE_DWORD);
END_FUNCTION_MAP
/** @defgroup IParticleChannel IParticleChannel.h
* @{
*/
/*! \fn PFExport IParticleChannel();
* \brief
*/
PFExport IParticleChannel();
/*! \fn PFExport IParticleChannel(const Interface_ID& readID, const Interface_ID&
* \brief
*/
PFExport IParticleChannel(const Interface_ID& readID, const Interface_ID& writeID);
/*! \fn virtual Class_ID GetClassID() const = 0;
* \brief Returns the unique ID for the channel class. The ID is used for constructing the channel when loading since the channel class is not inherited from class Animatable.
*/
virtual Class_ID GetClassID() const = 0;
/*! \fn virtual IObject* Clone() const = 0;
* \brief cloning; make a copy of the channel
*/
virtual IObject* Clone() const = 0;
/*! \fn virtual IOResult Save(ISave* isave) const = 0;
* \brief saving content of the channel to file
*/
virtual IOResult Save(ISave* isave) const = 0;
/*! \fn virtual IOResult Load(ILoad* iload) = 0;
* \brief loading content of the channel from file
*/
virtual IOResult Load(ILoad* iload) = 0;
/*! \fn PFExport bool IsSimilarChannel(IObject* channel) const;
* \brief checks if the given IObject is a similar particle channel
*/
PFExport bool IsSimilarChannel(IObject* channel) const;
/*! \fn PFExport bool IsTransferable() const;
* \brief Get "transferable" status. If particle channel is transferable then it is transferred from one event to another; the data in the channel are glued to particles if particle channel is not transferable then while particles moves to another event, the particle channel is not
*/
PFExport bool IsTransferable() const;
/*! \fn PFExport void SetTransferable(bool status);
* \brief Set "transferable" status.
*/
PFExport void SetTransferable(bool status);
/*! \fn PFExport bool IsPrivateChannel() const;
* \brief A channel can be declared "private" by an action.
when a channel is declared as a "private" a reference on a "private owner" is given
then only the "private owner" action will be given access to this channel.
the technique allows creating several channels with the same data-type (for example,
position) in the container by different "private owner" actions
Because of access to particle container, onle an action that created the channel
can declare itself as a private owner.
*/
PFExport bool IsPrivateChannel() const;
/*! \fn PFExport Object* GetPrivateOwner() const;
* \brief returns a "private owner" action of the channel
*/
PFExport Object* GetPrivateOwner() const;
/*! \fn PFExport void SetPrivateOwner(Object* action);
* \brief sets a "private owner" action of the channel
*/
PFExport void SetPrivateOwner(Object* action);
/*! \fn PFExport INode* GetCreatorAction() const;
* \brief channel data can be viewed by different actions. however an action that created the channel is responsible for data initialization. therefore the action has to keep track
how (by what action) the channel was created
*/
PFExport INode* GetCreatorAction() const;
/*! \fn PFExport void SetCreatorAction(INode* actionNode);
* \brief channel data can be viewed by different actions. however an action that created the channel is responsible for data initialization. therefore the action has to keep track
how (by what action) the channel was created
*/
PFExport void SetCreatorAction(INode* actionNode);
/*! \fn PFExport DWORD GetReadID_PartA() const;
* \brief Set/get a concrete channel ID for a generic data particle channel. Access read-interface ID of the wrapping channel.
*/
PFExport DWORD GetReadID_PartA() const;
/*! \fn PFExport DWORD GetReadID_PartB() const;
* \brief Set/get a concrete channel ID for a generic data particle channel. Access read-interface ID of the wrapping channel.
*/
PFExport DWORD GetReadID_PartB() const;
/*! \fn PFExport DWORD GetWriteID_PartA() const;
* \brief access write-interface ID of the wrapping channel
*/
PFExport DWORD GetWriteID_PartA() const;
/*! \fn PFExport DWORD GetWriteID_PartB() const;
* \brief access write-interface ID of the wrapping channel
*/
PFExport DWORD GetWriteID_PartB() const;
/*! \fn PFExport void SetReadID(DWORD interfaceID_PartA, DWORD interfaceID_PartB);
* \brief set up read-interface ID of the wrapping channel
*/
PFExport void SetReadID(DWORD interfaceID_PartA, DWORD interfaceID_PartB);
/*! \fn PFExport void SetWriteID(DWORD interfaceID_PartA, DWORD interfaceID_PartB);
* \brief set up write-interface ID of the wrapping channel
*/
PFExport void SetWriteID(DWORD interfaceID_PartA, DWORD interfaceID_PartB);
/*! \fn PFExport const Interface_ID& GetReadID() const;
* \brief methods that are not in FnPub interface. Access read-interface ID of the wrapping channel.
*/
PFExport const Interface_ID& GetReadID() const;
/*! \fn PFExport const Interface_ID& GetWriteID() const;
* \brief access write-interface ID of the wrapping channel
*/
PFExport const Interface_ID& GetWriteID() const;
/*! \fn PFExport void SetReadID(const Interface_ID& id);
* \brief set up read-interface ID of the wrapping channel
*/
PFExport void SetReadID(const Interface_ID& id);
/*! \fn PFExport void SetWriteID(const Interface_ID& id);
* \brief set up write-interface ID of the wrapping channel
*/
PFExport void SetWriteID(const Interface_ID& id);
/*! \fn PFExport void CloneChannelCore(IParticleChannel* getFrom);
* \brief when cloning a channel, data about transferable, privateOwner, creatorAction, readID & write ID should be cloned. the following method does that: it clones the core data from the given channel
*/
PFExport void CloneChannelCore(IParticleChannel* getFrom);
/*! \fn PFExport void UpdateCreatorHandle(IMergeManager* pMM);
* \brief when cached channel data are merged the stored action creator handle could be invalid.
the method lets the channel to update the action handle to the proper one
*/
PFExport void UpdateCreatorHandle(IMergeManager* pMM);
/*! \fn virtual int MemoryUsed() const = 0;
* \brief returns amount of memory used (in bytes) by the channel to store the information
*/
virtual int MemoryUsed() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNEL_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNEL_INTERFACE); }
protected:
bool m_isTransferable;
bool m_isPrivate;
mutable Object* m_privateOwner; // could be derived from creatorAction
mutable INode* m_creatorAction; // could be derived from creatorHandle
ULONG m_creatorHandle;
// wrapper ids
Interface_ID m_readID, m_writeID;
int numRefs() const { return m_numRefs; }
int& _numRefs() { return m_numRefs; }
private:
int m_numRefs;
};
#endif // _IPARTICLECHANNEL_H_

View File

@ -0,0 +1,35 @@
/*! \file IParticleChannelAcceleration.h
\brief Channel-specific interface for ParticleChannelAcceleration
Acceleration is stored in absolute world coordianates
The acceleration is in units per tick<63>
The channel is a wrap around ParticleChannelPoint3
The acceleration values are set to zero (Point3::Origin)
after each integration step. Therefore an operator that
modifies the channel has to repeat the modification on
every 'Proceed' call even if the value to be set is the
same.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-19-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELACCELERATION_H_
#define _IPARTICLECHANNELACCELERATION_H_
#include "IParticleChannelPoint3.h"
// standard particle channel "Acceleration"
// interface ID
#define PARTICLECHANNELACCELERATIONR_INTERFACE Interface_ID(0x74f93b08, 0x1eb34500)
#define PARTICLECHANNELACCELERATIONW_INTERFACE Interface_ID(0x74f93b08, 0x1eb34501)
#define GetParticleChannelAccelerationRInterface(obj) ((IParticleChannelPoint3R*)obj->GetInterface(PARTICLECHANNELACCELERATIONR_INTERFACE))
#define GetParticleChannelAccelerationWInterface(obj) ((IParticleChannelPoint3W*)obj->GetInterface(PARTICLECHANNELACCELERATIONW_INTERFACE))
#endif // _IPARTICLECHANNELACCELERATION_H_

View File

@ -0,0 +1,156 @@
/*! \file IParticleChannelAmount.h
\brief Channel-generic interfaces ParticleChannelAmount
This is a part of every particle channel and
particle container
ParticleChannelAmount is a two-part interface:
for read (R) and write (W)
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-05-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELAMOUNT_H_
#define _IPARTICLECHANNELAMOUNT_H_
#include "Max.h"
// interface ID
#define PARTICLECHANNELAMOUNTR_INTERFACE Interface_ID(0x74f93b00, 0x1eb34500)
#define PARTICLECHANNELAMOUNTW_INTERFACE Interface_ID(0x74f93b00, 0x1eb34501)
#define GetParticleChannelAmountRInterface(obj) ((IParticleChannelAmountR*)obj->GetInterface(PARTICLECHANNELAMOUNTR_INTERFACE))
#define GetParticleChannelAmountWInterface(obj) ((IParticleChannelAmountW*)obj->GetInterface(PARTICLECHANNELAMOUNTW_INTERFACE))
class IParticleChannelAmountR : public FPMixinInterface
{
public:
// function IDs Read
enum { kCount
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_0(kCount, TYPE_INT, Count);
END_FUNCTION_MAP
/** @defgroup IParticleChannelAmount IParticleChannelAmount.h
* @{
*/
/*! \fn virtual int Count() const = 0;
* \brief Particle count management; number of particles in the channel
*/
virtual int Count() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELAMOUNTR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELAMOUNTR_INTERFACE); }
};
class IParticleChannelAmountW : public FPMixinInterface
{
public:
// function IDs Write
enum { kZeroCount,
kSetCount,
kDeleteByIndex,
kDeleteByArray,
kSplit,
kSpawn,
kAppendNum,
kAppend
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_0(kZeroCount, ZeroCount);
FN_1(kSetCount, TYPE_bool, SetCount, TYPE_INT);
FN_2(kDeleteByIndex, TYPE_INT, Delete, TYPE_INT, TYPE_INT);
FN_1(kDeleteByArray, TYPE_INT, Delete, TYPE_BITARRAY_BR);
FN_1(kSplit, TYPE_IOBJECT, Split, TYPE_BITARRAY_BR);
FN_1(kSpawn, TYPE_bool, Spawn, TYPE_INT_TAB_BR);
FN_1(kAppendNum, TYPE_bool, AppendNum, TYPE_INT);
FN_1(kAppend, TYPE_bool, Append, TYPE_IOBJECT);
END_FUNCTION_MAP
/** @defgroup IParticleChannelAmount IParticleChannelAmount.h
* @{
*/
/*! \fn virtual void ZeroCount() = 0;
* \brief set number of particles in the channel to zero
*/
virtual void ZeroCount() = 0;
/*! \fn virtual bool SetCount(int n) = 0;
* \brief set number of particles in the channel to n
*/
virtual bool SetCount(int n) = 0;
/*! \fn virtual int Delete(int start,int num) = 0;
* \brief Delete num particles from start index. Returns number of particles left in the channel.
*/
virtual int Delete(int start,int num) = 0;
/*! \fn virtual int Delete(BitArray& toRemove) = 0;
* \brief Delete particles according to the BitArray (bit set == remove). Returns number of particles left in the channel
*/
virtual int Delete(BitArray& toRemove) = 0;
/*! \fn virtual IObject* Split(BitArray& toSplit) = 0;
* \brief To new "split" particle channel. Returns new particle channel; IObject type is chosen to be
compatible with the available return types. All "bit-set" particles are moved.
*/
virtual IObject* Split(BitArray& toSplit) = 0;
/*! \fn virtual bool Spawn( Tab<int>& spawnTable ) = 0;
* \brief Spawn particles according to the spawnTable. Returns true if the operation is successful.
Size of the table equals to number of particles in the channel. Table value is how many particles are cloned from the index particle.
*/
virtual bool Spawn( Tab<int>& spawnTable ) = 0;
/*! \fn virtual bool AppendNum(int num) = 0;
* \brief Append num particles to the channel(s). Returns true if the operation is successful.
*/
virtual bool AppendNum(int num) = 0;
/*! \fn virtual bool Append(IObject* obj) = 0;
* \brief Append all particles of another channel/container, then the input channel/container is deleted.
Returns true if the operation is successful.
*/
virtual bool Append(IObject* obj) = 0;
/*! \fn virtual void ResetAddedAmount() { ; }
* \brief For internal use; no need to implement
*/
virtual void ResetAddedAmount() { ; }
/*! \fn virtual int GetAddedAmount() { return 0; }
* \brief For internal use; no need to implement
*/
virtual int GetAddedAmount() { return 0; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELAMOUNTW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELAMOUNTW_INTERFACE); }
};
#endif // _IPARTICLECHANNELAMOUNT_H_

View File

@ -0,0 +1,115 @@
/*! \file IParticleChannelAngAxis.h
\brief Channel-generic interfaces for particle channels that
store angle/axis data.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-09-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELANGAXIS_H_
#define _IPARTICLECHANNELANGAXIS_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "AngAxis"
// interface ID
#define PARTICLECHANNELANGAXISR_INTERFACE Interface_ID(0x74f93c0d, 0x1eb34500)
#define PARTICLECHANNELANGAXISW_INTERFACE Interface_ID(0x74f93c0d, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelAngAxisRInterface(obj) ((IParticleChannelAngAxisR*)obj->GetInterface(PARTICLECHANNELANGAXISR_INTERFACE))
//#define GetParticleChannelAngAxisWInterface(obj) ((IParticleChannelAngAxisW*)obj->GetInterface(PARTICLECHANNELANGAXISW_INTERFACE))
class IParticleChannelAngAxisR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_ANGAXIS_BR, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_ANGAXIS_BR, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelAngAxis IParticleChannelAngAxis.h
* @{
*/
/*! \fn virtual const AngAxis& GetValue(int index) const = 0;
* \brief Get property for particle with index
*/
virtual const AngAxis& GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief Verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual const AngAxis& GetValue() const = 0;
* \brief If channel is global returns the global value. If channel is not global returns value of the first particle.
Returns bounding box for all particles.
*/
virtual const AngAxis& GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELANGAXISR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELANGAXISR_INTERFACE); }
};
class IParticleChannelAngAxisW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_ANGAXIS_BR);
VFN_1(kSetValueGlobal, SetValue, TYPE_ANGAXIS_BR);
END_FUNCTION_MAP
/** @defgroup IParticleChannelAngAxis IParticleChannelAngAxis.h
* @{
*/
/*! \fn virtual void SetValue(int index, const AngAxis& v) = 0;
* \brief Set property for particle with index
*/
virtual void SetValue(int index, const AngAxis& v) = 0;
/*! \fn virtual void SetValue(const AngAxis& v) = 0;
* \brief Set property for all particles at once thus making the channel global
*/
virtual void SetValue(const AngAxis& v) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELANGAXISW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELANGAXISW_INTERFACE); }
};
#endif // _IPARTICLECHANNELANGAXIS_H_

View File

@ -0,0 +1,30 @@
/*! \file IParticleChannelBirthTime.h
\brief Channel-specific interfaces for ParticleChannelBirthTime
The channel is used to store time of birth for a particle
The channel is a wrap around ParticleChannelPTV
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-29-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELBIRTHTIME_H_
#define _IPARTICLECHANNELBIRTHTIME_H_
#include "IParticleChannelPTV.h"
// standard particle channel "BirthTime"
// interface ID
#define PARTICLECHANNELBIRTHTIMER_INTERFACE Interface_ID(0x74f93b04, 0x1eb34500)
#define PARTICLECHANNELBIRTHTIMEW_INTERFACE Interface_ID(0x74f93b04, 0x1eb34501)
#define GetParticleChannelBirthTimeRInterface(obj) ((IParticleChannelPTVR*)obj->GetInterface(PARTICLECHANNELBIRTHTIMER_INTERFACE))
#define GetParticleChannelBirthTimeWInterface(obj) ((IParticleChannelPTVW*)obj->GetInterface(PARTICLECHANNELBIRTHTIMEW_INTERFACE))
#endif // _IPARTICLECHANNELBIRTHSTART_H_

View File

@ -0,0 +1,113 @@
/*! \file IParticleChannelBool.h
\brief Channel-generic interfaces for particle channels that store bool data.
*/
/**********************************************************************
*<
CREATED BY: Chung-An Lin
HISTORY: created 02-20-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELBOOL_H_
#define _IPARTICLECHANNELBOOL_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "bool"
// interface ID
#define PARTICLECHANNELBOOLR_INTERFACE Interface_ID(0x74f93c04, 0x1eb34500)
#define PARTICLECHANNELBOOLW_INTERFACE Interface_ID(0x74f93c04, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelBoolRInterface(obj) ((IParticleChannelBoolR*)obj->GetInterface(PARTICLECHANNELBOOLR_INTERFACE))
//#define GetParticleChannelBoolWInterface(obj) ((IParticleChannelBoolW*)obj->GetInterface(PARTICLECHANNELBOOLW_INTERFACE))
class IParticleChannelBoolR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_bool, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_bool, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelBool IParticleChannelBool.h
* @{
*/
/*! \fn virtual bool GetValue(int index) const = 0;
* \brief get property for particle with index
*/
virtual bool GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual bool GetValue() const = 0;
* \brief if channel is global returns the global value. if channel is not global returns value of the first particle
*/
virtual bool GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELBOOLR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELBOOLR_INTERFACE); }
};
class IParticleChannelBoolW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_bool);
VFN_1(kSetValueGlobal, SetValue, TYPE_bool);
END_FUNCTION_MAP
/** @defgroup IParticleChannelBool IParticleChannelBool.h
* @{
*/
/*! \fn virtual void SetValue(int index, bool value) = 0;
* \brief set property for particle with index
*/
virtual void SetValue(int index, bool value) = 0;
/*! \fn virtual void SetValue(bool value) = 0;
* \brief set property for all particles at once thus making the channel global
*/
virtual void SetValue(bool value) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELBOOLW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELBOOLW_INTERFACE); }
};
#endif // _IPARTICLECHANNELBOOL_H_

View File

@ -0,0 +1,30 @@
/*! \file IParticleChannelDeathTime.h
\brief Channel-specific interfaces for ParticleChannelDeathTime
The channel is used to store time of death for a particle
The channel is a wrap around ParticleChannelPTV
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 09-27-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELDEATHTIME_H_
#define _IPARTICLECHANNELDEATHTIME_H_
#include "IParticleChannelPTV.h"
// standard particle channel "DeathTime"
// interface ID
#define PARTICLECHANNELDEATHTIMER_INTERFACE Interface_ID(0x74f93b18, 0x1eb34500)
#define PARTICLECHANNELDEATHTIMEW_INTERFACE Interface_ID(0x74f93b18, 0x1eb34501)
#define GetParticleChannelDeathTimeRInterface(obj) ((IParticleChannelPTVR*)obj->GetInterface(PARTICLECHANNELDEATHTIMER_INTERFACE))
#define GetParticleChannelDeathTimeWInterface(obj) ((IParticleChannelPTVW*)obj->GetInterface(PARTICLECHANNELDEATHTIMEW_INTERFACE))
#endif // _IPARTICLECHANNELDEATHSTART_H_

View File

@ -0,0 +1,30 @@
/*! \file IParticleChannelEventStart.h
\brief Channel-specific interfaces for ParticleChannelEventStart
The channel is used to store a moment of entering current Event
The channel is a wrap around ParticleChannelPTV
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-30-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELEVENTSTART_H_
#define _IPARTICLECHANNELEVENTSTART_H_
#include "IParticleChannelPTV.h"
// standard particle channel "EventStart"
// interface ID
#define PARTICLECHANNELEVENTSTARTR_INTERFACE Interface_ID(0x74f93b05, 0x1eb34500)
#define PARTICLECHANNELEVENTSTARTW_INTERFACE Interface_ID(0x74f93b05, 0x1eb34501)
#define GetParticleChannelEventStartRInterface(obj) ((IParticleChannelPTVR*)obj->GetInterface(PARTICLECHANNELEVENTSTARTR_INTERFACE))
#define GetParticleChannelEventStartWInterface(obj) ((IParticleChannelPTVW*)obj->GetInterface(PARTICLECHANNELEVENTSTARTW_INTERFACE))
#endif // _IPARTICLECHANNELEVENTSTART_H_

View File

@ -0,0 +1,113 @@
/*! \file IParticleChannelFloat.h
\brief Channel-generic interfaces for particle channels that store float data.
*/
/**********************************************************************
*<
CREATED BY: Chung-An Lin
HISTORY: created 01-24-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELFLOAT_H_
#define _IPARTICLECHANNELFLOAT_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "Float"
// interface ID
#define PARTICLECHANNELFLOATR_INTERFACE Interface_ID(0x74f93c00, 0x1eb34500)
#define PARTICLECHANNELFLOATW_INTERFACE Interface_ID(0x74f93c00, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelFloatRInterface(obj) ((IParticleChannelFloatR*)obj->GetInterface(PARTICLECHANNELFLOATR_INTERFACE))
//#define GetParticleChannelFloatWInterface(obj) ((IParticleChannelFloatW*)obj->GetInterface(PARTICLECHANNELFLOATW_INTERFACE))
class IParticleChannelFloatR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_FLOAT, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_FLOAT, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelFloat IParticleChannelFloat.h
* @{
*/
/*! \fn virtual float GetValue(int index) const = 0;
* \brief get property for particle with index
*/
virtual float GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual float GetValue() const = 0;
* \brief if channel is global returns the global value. if channel is not global returns value of the first particle.
*/
virtual float GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELFLOATR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELFLOATR_INTERFACE); }
};
class IParticleChannelFloatW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_FLOAT);
VFN_1(kSetValueGlobal, SetValue, TYPE_FLOAT);
END_FUNCTION_MAP
/** @defgroup IParticleChannelFloat IParticleChannelFloat.h
* @{
*/
/*! \fn virtual void SetValue(int index, float value) = 0;
* \brief set property for particle with index
*/
virtual void SetValue(int index, float value) = 0;
/*! \fn virtual void SetValue(float value) = 0;
* \brief set property for all particles at once thus making the channel global
*/
virtual void SetValue(float value) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELFLOATW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELFLOATW_INTERFACE); }
};
#endif // _IPARTICLECHANNELFLOAT_H_

View File

@ -0,0 +1,132 @@
/*! \file IParticleChannelID.h
\brief Channel-specific interfaces for ParticleChannelID. The channel is used to identify particles.
Particle ID consists of two integers: particleIndex and
particleBorn. ParticleIndex gives relative correspondense
to the whole amount of particles. If PF ParticleAmountMultiplier
is set to 100% then the given particleIndex are successive
ordinal numbers. If it's set to 50% then the given particle indeces
are 0, 2, 4, 6 etc. If it is a Birth by Total Number then the
last particle born has an index of the total number whatever
multiplier is. ParticleBorn number always are successive
ordinal numbers when particles were born: 0, 1, 2, 3 etc.
If ParticleAmountMultiplier equals 100% then for a
particular particle particleIndex and particleBorn are the
same number. If ParticleAmountMultiplier is greater then
100% then you may have several particles with the same
particleIndex. It is recommended to link non-random properties to
particleIndex and random properties to particleBorn.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-04-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELID_H_
#define _IPARTICLECHANNELID_H_
// standard particle channel "particleID"
// interface ID
#define PARTICLECHANNELIDR_INTERFACE Interface_ID(0x74f93b02, 0x1eb34500)
#define PARTICLECHANNELIDW_INTERFACE Interface_ID(0x74f93b02, 0x1eb34501)
#define GetParticleChannelIDRInterface(obj) ((IParticleChannelIDR*)obj->GetInterface(PARTICLECHANNELIDR_INTERFACE))
#define GetParticleChannelIDWInterface(obj) ((IParticleChannelIDW*)obj->GetInterface(PARTICLECHANNELIDW_INTERFACE))
// function IDs Read
enum { particleChannelID_getID,
particleChannelID_getParticleIndex,
particleChannelID_getParticleBorn
};
// function IDs Write
enum { particleChannelID_setID
};
struct ParticleID {
int index;
int born;
};
class IParticleChannelIDR : public FPMixinInterface
{
BEGIN_FUNCTION_MAP
VFN_3(particleChannelID_getID, GetID, TYPE_INT, TYPE_INT_BR, TYPE_INT_BR);
FN_1(particleChannelID_getParticleIndex, TYPE_INT, GetParticleIndex, TYPE_INT);
FN_1(particleChannelID_getParticleBorn, TYPE_INT, GetParticleBorn, TYPE_INT);
END_FUNCTION_MAP
public:
/** @defgroup IParticleChannelID IParticleChannelID.h
* @{
*/
/*! \fn virtual void GetID(int index, int& particleIndex, int& particleBorn) const = 0;
* \brief
*/
virtual void GetID(int index, int& particleIndex, int& particleBorn) const = 0;
/*! \fn virtual int GetParticleIndex(int index) const = 0;
* \brief Returns particleIndex
*/
virtual int GetParticleIndex(int index) const = 0; // returns particleIndex
/*! \fn virtual int GetParticleBorn(int index) const = 0;
* \brief Returns particleBorn
*/
virtual int GetParticleBorn(int index) const = 0; // returns particleBorn
/*! \fn virtual const ParticleID& GetID(int index) const = 0;
* \brief Methods not in the mapped interface
*/
virtual const ParticleID& GetID(int index) const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELIDR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELIDR_INTERFACE); }
};
class IParticleChannelIDW : public FPMixinInterface
{
BEGIN_FUNCTION_MAP
VFN_3(particleChannelID_setID, SetID, TYPE_INT, TYPE_INT, TYPE_INT);
END_FUNCTION_MAP
public:
/** @defgroup IParticleChannelID IParticleChannelID.h
* @{
*/
/*! \fn virtual void SetID(int index, int particleIndex, int particleBorn) = 0;
* \brief Set particle property
*/
virtual void SetID(int index, int particleIndex, int particleBorn) = 0;
/*! \fn virtual void SetID(int index, const ParticleID& id) = 0;
* \brief Methods not in the mapped interface
*/
virtual void SetID(int index, const ParticleID& id) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELIDW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELIDW_INTERFACE); }
};
/*@}*/
#endif // _IPARTICLECHANNELID_H_

View File

@ -0,0 +1,113 @@
/*! \file IParticleChannelINode.h
\brief Channel-generic interfaces for particle channels that store pointers on INode objects.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 07-08-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELINODE_H_
#define _IPARTICLECHANNELINODE_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "INodePtr"
// interface ID
#define PARTICLECHANNELINODER_INTERFACE Interface_ID(0x74f93c09, 0x1eb34500)
#define PARTICLECHANNELINODEW_INTERFACE Interface_ID(0x74f93c09, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelINodeRInterface(obj) ((IParticleChannelINodeR*)obj->GetInterface(PARTICLECHANNELINODER_INTERFACE))
//#define GetParticleChannelINodeWInterface(obj) ((IParticleChannelINodeW*)obj->GetInterface(PARTICLECHANNELINODEW_INTERFACE))
class IParticleChannelINodeR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_INODE, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_INODE, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelINode IParticleChannelINode.h
* @{
*/
/*! \fn virtual INode* GetValue(int index) const = 0;
* \brief get property for particle with index
*/
virtual INode* GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual INode* GetValue() const = 0;
* \brief if channel is global returns the global value. if channel is not global returns value of the first particle.
*/
virtual INode* GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINODER_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINODER_INTERFACE); }
};
class IParticleChannelINodeW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_INODE);
VFN_1(kSetValueGlobal, SetValue, TYPE_INODE);
END_FUNCTION_MAP
/** @defgroup IParticleChannelINode IParticleChannelINode.h
* @{
*/
/*! \fn virtual void SetValue(int index, INode* value) = 0;
* \brief set property for particle with index
*/
virtual void SetValue(int index, INode* value) = 0;
/*! \fn virtual void SetValue(INode* value) = 0;
* \brief set property for all particles at once thus making the channel global
*/
virtual void SetValue(INode* value) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINODEW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINODEW_INTERFACE); }
};
#endif // _IPARTICLECHANNELINODE_H_

View File

@ -0,0 +1,113 @@
/*! \file IParticleChannelInt.h
\brief Channel-generic interfaces for particle channels that store int data.
*/
/**********************************************************************
*<
CREATED BY: Chung-An Lin
HISTORY: created 01-16-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELINT_H_
#define _IPARTICLECHANNELINT_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "Int"
// interface ID
#define PARTICLECHANNELINTR_INTERFACE Interface_ID(0x74f93c01, 0x1eb34500)
#define PARTICLECHANNELINTW_INTERFACE Interface_ID(0x74f93c01, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelIntRInterface(obj) ((IParticleChannelIntR*)obj->GetInterface(PARTICLECHANNELINTR_INTERFACE))
//#define GetParticleChannelIntWInterface(obj) ((IParticleChannelIntW*)obj->GetInterface(PARTICLECHANNELINTW_INTERFACE))
class IParticleChannelIntR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_INT, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_INT, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelInt IParticleChannelInt.h
* @{
*/
/*! \fn virtual int GetValue(int index) const = 0;
* \brief get property for particle with index
*/
virtual int GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual int GetValue() const = 0;
* \brief if channel is global returns the global value. if channel is not global returns value of the first particle
*/
virtual int GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINTR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINTR_INTERFACE); }
};
class IParticleChannelIntW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_INT);
VFN_1(kSetValueGlobal, SetValue, TYPE_INT);
END_FUNCTION_MAP
/** @defgroup IParticleChannelInt IParticleChannelInt.h
* @{
*/
/*! \fn virtual void SetValue(int index, int value) = 0;
* \brief set property for particle with index
*/
virtual void SetValue(int index, int value) = 0;
/*! \fn virtual void SetValue(int value) = 0;
* \brief set property for all particles at once thus making the channel global
*/
virtual void SetValue(int value) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINTW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINTW_INTERFACE); }
};
#endif // _IPARTICLECHANNELINT_H_

View File

@ -0,0 +1,30 @@
/*! \file IParticleChannelLifespan.h
\brief Channel-specific interfaces for ParticleChannelLifespan.
The channel is used to store maximal age a particle can live up to.
The channel is a wrap around ParticleChannelPTV.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-24-03
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELLIFESPAN_H_
#define _IPARTICLECHANNELLIFESPAN_H_
#include "IParticleChannelPTV.h"
// standard particle channel "Lifespan"
// interface ID
#define PARTICLECHANNELLIFESPANR_INTERFACE Interface_ID(0x74f93b19, 0x1eb34500)
#define PARTICLECHANNELLIFESPANW_INTERFACE Interface_ID(0x74f93b19, 0x1eb34501)
#define GetParticleChannelLifespanRInterface(obj) ((IParticleChannelPTVR*)obj->GetInterface(PARTICLECHANNELLIFESPANR_INTERFACE))
#define GetParticleChannelLifespanWInterface(obj) ((IParticleChannelPTVW*)obj->GetInterface(PARTICLECHANNELLIFESPANW_INTERFACE))
#endif // _IPARTICLECHANNELLIFESPANT_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelMXSFloat.h
\brief Channel-specific interface for ParticleChannelMXSFloat
The channel stores float value for script operators/tests
The channel is a wrap around ParticleChannelFloat
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 07-27-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMXSFLOAT_H_
#define _IPARTICLECHANNELMXSFLOAT_H_
#include "IParticleChannelFloat.h"
// standard particle channel "MXSFloat"
// interface ID
#define PARTICLECHANNELMXSFLOATR_INTERFACE Interface_ID(0x74f93b15, 0x1eb34500)
#define PARTICLECHANNELMXSFLOATW_INTERFACE Interface_ID(0x74f93b15, 0x1eb34501)
#define GetParticleChannelMXSFloatRInterface(obj) ((IParticleChannelFloatR*)obj->GetInterface(PARTICLECHANNELMXSFLOATR_INTERFACE))
#define GetParticleChannelMXSFloatWInterface(obj) ((IParticleChannelFloatW*)obj->GetInterface(PARTICLECHANNELMXSFLOATW_INTERFACE))
#endif // _IPARTICLECHANNELMXSFLOAT_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelMXSInteger.h
\brief Channel-specific interface for ParticleChannelMXSInteger
The channel stores integer value for script operators/tests
The channel is a wrap around ParticleChannelInt
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 07-27-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMXSINTEGER_H_
#define _IPARTICLECHANNELMXSINTEGER_H_
#include "IParticleChannelInt.h"
// standard particle channel "MXSInteger"
// interface ID
#define PARTICLECHANNELMXSINTEGERR_INTERFACE Interface_ID(0x74f93b14, 0x1eb34500)
#define PARTICLECHANNELMXSINTEGERW_INTERFACE Interface_ID(0x74f93b14, 0x1eb34501)
#define GetParticleChannelMXSIntegerRInterface(obj) ((IParticleChannelIntR*)obj->GetInterface(PARTICLECHANNELMXSINTEGERR_INTERFACE))
#define GetParticleChannelMXSIntegerWInterface(obj) ((IParticleChannelIntW*)obj->GetInterface(PARTICLECHANNELMXSINTEGERW_INTERFACE))
#endif // _IPARTICLECHANNELMXSINTEGER_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelMXSMatrix.h
\brief Channel-specific interface for ParticleChannelMXSMatrix
The channel stores Matrix3 value for script operators/tests
The channel is a wrap around ParticleChannelMatrix3
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 07-27-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMXSMATRIX_H_
#define _IPARTICLECHANNELMXSMATRIX_H_
#include "IParticleChannelMatrix3.h"
// standard particle channel "MXSMatrix"
// interface ID
#define PARTICLECHANNELMXSMATRIXR_INTERFACE Interface_ID(0x74f93b17, 0x1eb34500)
#define PARTICLECHANNELMXSMATRIXW_INTERFACE Interface_ID(0x74f93b17, 0x1eb34501)
#define GetParticleChannelMXSMatrixRInterface(obj) ((IParticleChannelMatrix3R*)obj->GetInterface(PARTICLECHANNELMXSMATRIXR_INTERFACE))
#define GetParticleChannelMXSMatrixWInterface(obj) ((IParticleChannelMatrix3W*)obj->GetInterface(PARTICLECHANNELMXSMATRIXW_INTERFACE))
#endif // _IPARTICLECHANNELMXSMATRIX_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelMXSVector.h
\brief Channel-specific interface for ParticleChannelMXSVector
The channel stores Point3 value for script operators/tests
The channel is a wrap around ParticleChannelPoint3
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 07-27-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMXSVECTOR_H_
#define _IPARTICLECHANNELMXSVECTOR_H_
#include "IParticleChannelPoint3.h"
// standard particle channel "MXSVector"
// interface ID
#define PARTICLECHANNELMXSVECTORR_INTERFACE Interface_ID(0x74f93b16, 0x1eb34500)
#define PARTICLECHANNELMXSVECTORW_INTERFACE Interface_ID(0x74f93b16, 0x1eb34501)
#define GetParticleChannelMXSVectorRInterface(obj) ((IParticleChannelPoint3R*)obj->GetInterface(PARTICLECHANNELMXSVECTORR_INTERFACE))
#define GetParticleChannelMXSVectorWInterface(obj) ((IParticleChannelPoint3W*)obj->GetInterface(PARTICLECHANNELMXSVECTORW_INTERFACE))
#endif // _IPARTICLECHANNELMXSVECTOR_H_

View File

@ -0,0 +1,273 @@
/*! \file IParticleChannelMap.h
\brief Channel-generic interface for particle channels
that store data in "map" form
A map consists of Tab<UVVert> and Tab<TVFace> information
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 06-17-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMAP_H_
#define _IPARTICLECHANNELMAP_H_
#include "max.h"
#include "PFExport.h"
// interface for map channel; Mesh Map object may contain several map channels
// interface ID
#define PARTICLECHANNELMAPR_INTERFACE Interface_ID(0x74f93c16, 0x1eb34500)
#define PARTICLECHANNELMAPW_INTERFACE Interface_ID(0x74f93c16, 0x1eb34501)
#define GetParticleChannelMapRInterface(obj) ((IParticleChannelMapR*)obj->GetInterface(PARTICLECHANNELMAPR_INTERFACE))
#define GetParticleChannelMapWInterface(obj) ((IParticleChannelMapW*)obj->GetInterface(PARTICLECHANNELMAPW_INTERFACE))
#include "IParticleChannelTabUVVert.h"
#include "IParticleChannelTabTVFace.h"
class IParticleChannelMapR : public FPMixinInterface
{
public:
/** @defgroup IParticleChannelMap IParticleChannelMap.h
* @{
*/
/*! \fn bool IsShared() const { return (IsUVVertShared() || IsTVFaceShared()); }
* \brief check out if some particles have shared mapping data. if it's true then there is no need to get a mapping for each particle
*/
bool IsShared() const { return (IsUVVertShared() || IsTVFaceShared()); }
/*! \fn virtual bool IsUVVertShared() const = 0;
* \brief check out if some particles have shared UVVert data. if it's true then there is no need to get a UVVert data for each particle
*/
virtual bool IsUVVertShared() const = 0;
/*! \fn virtual bool IsTVFaceShared() const = 0;
* \brief check out if some particles have shared TVFace data. if it's true then there is no need to get a TVFace data for each particle
*/
virtual bool IsTVFaceShared() const = 0;
/*! \fn virtual int GetUVVertCount() const = 0;
* \brief get total number of actual TabUVVert values in the channel
*/
virtual int GetUVVertCount() const = 0;
/*! \fn virtual int GetUVVertIndex(int particleIndex) const = 0;
* \brief get the TabUVVert value index of a particle
*/
virtual int GetUVVertIndex(int particleIndex) const = 0;
/*! \fn virtual const TabUVVert* GetUVVertByIndex(int valueIndex) const = 0;
* \brief get TabUVVert of the valueIndex-th value
*/
virtual const TabUVVert* GetUVVertByIndex(int valueIndex) const = 0;
/*! \fn virtual const TabUVVert* GetUVVert(int particleIndex) const = 0;
* \brief get TabUVVert of a particle with the specified index
*/
virtual const TabUVVert* GetUVVert(int particleIndex) const = 0;
/*! \fn virtual const TabUVVert* GetUVVert() const = 0;
* \brief get global TabUVVert value for all particles. the method returns the TabUVVert value of the first particle if it is local or shared
*/
virtual const TabUVVert* GetUVVert() const = 0;
/*! \fn virtual int GetTVFaceCount() const = 0;
* \brief get total number of actual TabTVFace values in the channel
*/
virtual int GetTVFaceCount() const = 0;
/*! \fn virtual int GetTVFaceIndex(int particleIndex) const = 0;
* \brief may return NULL. for different TabUVVert values it has different meanings.
if TabUVVert has a single UVVert value then the particle has a planar TVFace data and all vertices of the particles
have the same UVVert value. if TabUVVert has the same number of UVVert values as the particle mesh vertices number
then the particle has a planar TVFace data and there is one-to-one correspondence between UVVerts and vertices of the particle.
get the TabTVFace value index of a particle.
*/
virtual int GetTVFaceIndex(int particleIndex) const = 0;
/*! \fn virtual const TabTVFace* GetTVFaceByIndex(int valueIndex) const = 0;
* \brief get TabTVFace of the valueIndex-th value. See GetTVFaceIndex(int particleIndex).
*/
virtual const TabTVFace* GetTVFaceByIndex(int valueIndex) const = 0;
/*! \fn virtual const TabTVFace* GetTVFace(int particleIndex) const = 0;
* \brief get TabTVFace of a particle with the specified index. See GetTVFaceIndex(int particleIndex).
*/
virtual const TabTVFace* GetTVFace(int particleIndex) const = 0;
/*! \fn virtual const TabTVFace* GetTVFace() const = 0;
* \brief get global TabTVFace value for all particles. the method returns the TabTVFace value of the first particle if it is local or shared. See GetTVFaceIndex(int particleIndex).
*/
virtual const TabTVFace* GetTVFace() const = 0;
/*! \fn virtual void Apply(Mesh* mesh, int particleIndex, int mp) const = 0;
* \brief apply content of the channel to the mesh [mesh] at mapping channel [mp]
*/
virtual void Apply(Mesh* mesh, int particleIndex, int mp) const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMAPR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMAPR_INTERFACE); }
};
class IParticleChannelMapW : public FPMixinInterface
{
public:
/** @defgroup IChannelContainer IChannelContainer.h
* @{
*/
/*! \fn virtual bool SetUVVert(int particleIndex, const UVVert& value) = 0;
* \brief sets all vertices of the particle have the same UVVert value. returns true if successful.
*/
virtual bool SetUVVert(int particleIndex, const UVVert& value) = 0;
/*! \fn virtual bool SetUVVert(int particleIndex, const TabUVVert* tab) = 0;
* \brief copies UVVert data to be texture mapping for the particle. returns true if successful.
*/
virtual bool SetUVVert(int particleIndex, const TabUVVert* tab) = 0;
/*! \fn virtual bool SetUVVert(Tab<int>& particleIndices, const UVVert& value) = 0;
* \brief copies UVVert data to be a shared value with indices in "particleIndeces"
*/
virtual bool SetUVVert(Tab<int>& particleIndices, const UVVert& value) = 0;
/*! \fn virtual bool SetUVVert(Tab<int>& particleIndices, const TabUVVert* tab) = 0;
* \brief copies UVVert data to be a shared value with indices in "particleIndeces"
*/
virtual bool SetUVVert(Tab<int>& particleIndices, const TabUVVert* tab) = 0;
/*! \fn virtual bool SetUVVert(const UVVert& value) = 0;
* \brief copies UVVert data to a global value for all particles
*/
virtual bool SetUVVert(const UVVert& value) = 0;
/*! \fn virtual bool SetUVVert(const TabUVVert* tab) = 0;
* \brief copies UVVert data to a global value for all particles
*/
virtual bool SetUVVert(const TabUVVert* tab) = 0;
/*! \fn virtual bool CopyUVVert(int fromParticle, int toParticle) = 0;
* \brief copy UVVert data from fromParticle to toParticle
*/
virtual bool CopyUVVert(int fromParticle, int toParticle) = 0;
/*! \fn virtual bool CopyUVVert(int fromParticle, Tab<int>& toParticles) = 0;
* \brief copy UVVert data from fromParticle to toParticles
*/
virtual bool CopyUVVert(int fromParticle, Tab<int>& toParticles) = 0;
/*! \fn virtual bool CopyUVVert(int fromParticle) = 0;
* \brief copy UVVert data from fromParticle to all particles
*/
virtual bool CopyUVVert(int fromParticle) = 0;
/*! \fn virtual bool SetTVFace(int particleIndex, const TabTVFace* tab) = 0;
* \brief copies TVFace data to be texture facing for the particle. returns true if successful.
*/
virtual bool SetTVFace(int particleIndex, const TabTVFace* tab) = 0;
/*! \fn virtual bool SetTVFace(Tab<int>& particleIndices, const TabTVFace* tab) = 0;
* \brief copies TVFace data to be a shared value with indices in "particleIndeces"
*/
virtual bool SetTVFace(Tab<int>& particleIndices, const TabTVFace* tab) = 0;
/*! \fn virtual bool SetTVFace(const TabTVFace* tab) = 0;
* \brief copies TVFace data to a global value for all particles
*/
virtual bool SetTVFace(const TabTVFace* tab) = 0;
/*! \fn virtual bool CopyTVFace(int fromParticle, int toParticle) = 0;
* \brief copy TVFace data from fromParticle to toParticle
*/
virtual bool CopyTVFace(int fromParticle, int toParticle) = 0;
/*! \fn virtual bool CopyTVFace(int fromParticle, Tab<int>& toParticles) = 0;
* \brief copy TVFace data from fromParticle to toParticles
*/
virtual bool CopyTVFace(int fromParticle, Tab<int>& toParticles) = 0;
/*! \fn virtual bool CopyTVFace(int fromParticle) = 0;
* \brief copy TVFace data from fromParticle to all particles
*/
virtual bool CopyTVFace(int fromParticle) = 0;
/*! \fn virtual IObject* GetUVVertChannel() const = 0;
* \brief returns an object of TabUVVert channel
*/
virtual IObject* GetUVVertChannel() const = 0;
/*! \fn virtual IObject* GetTVFaceChannel() const = 0;
* \brief returns an object of TabTVFace channel
*/
virtual IObject* GetTVFaceChannel() const = 0;
/*! \fn bool SetMap(int particleIndex, const UVVert& value)
* \brief sets all vertices of the particle have the same map value. returns true if successful.
*/
bool SetMap(int particleIndex, const UVVert& value)
{ return (SetUVVert(particleIndex, value) && SetTVFace(NULL)); }
/*! \fn bool SetMap(int particleIndex, const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
* \brief copies map data to be texture mapping for the particle. returns true if successful.
*/
bool SetMap(int particleIndex, const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
{ return (SetUVVert(particleIndex, tabUVVert) && SetTVFace(particleIndex, tabTVFace)); }
/*! \fn bool SetMap(Tab<int>& particleIndices, const UVVert& value)
* \brief copies map data to be a shared value with indices in "particleIndeces"
*/
bool SetMap(Tab<int>& particleIndices, const UVVert& value)
{ return (SetUVVert(particleIndices, value) && SetTVFace(particleIndices, NULL)); }
/*! \fn bool SetMap(Tab<int>& particleIndices, const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
* \brief copies map data to be a shared value with indices in "particleIndeces"
*/
bool SetMap(Tab<int>& particleIndices, const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
{ return (SetUVVert(particleIndices, tabUVVert) && SetTVFace(particleIndices, tabTVFace)); }
/*! \fn bool SetMap(const UVVert& value)
* \brief copies map data to a global value for all particles
*/
bool SetMap(const UVVert& value)
{ return (SetUVVert(value) && SetTVFace(NULL)); }
/*! \fn bool SetMap(const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
* \brief copies map data to a global value for all particles
*/
bool SetMap(const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
{ return (SetUVVert(tabUVVert) && SetTVFace(tabTVFace)); }
/*! \fn bool CopyMap(int fromParticle, int toParticle)
* \brief copy map data from fromParticle to toParticle
*/
bool CopyMap(int fromParticle, int toParticle)
{ return (CopyUVVert(fromParticle, toParticle) && CopyTVFace(fromParticle, toParticle)); }
/*! \fn bool CopyMap(int fromParticle, Tab<int>& toParticles)
* \brief copy map data from fromParticle to toParticles
*/
bool CopyMap(int fromParticle, Tab<int>& toParticles)
{ return (CopyUVVert(fromParticle, toParticles) && CopyTVFace(fromParticle, toParticles)); }
/*! \fn bool CopyMap(int fromParticle)
* \brief copy map data from fromParticle to all particles
*/
bool CopyMap(int fromParticle)
{ return (CopyUVVert(fromParticle) && CopyTVFace(fromParticle)); }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMAPW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMAPW_INTERFACE); }
};
#endif // _IPARTICLECHANNELMESHMAP_H_

View File

@ -0,0 +1,33 @@
/*! \file IParticleChannelMaterialIndex.h
\brief Channel-specific interfaces for ParticleChannelMaterialIndex
The channel is used to store material index information
The channel is a wrap around ParticleChannelInt
If the channel is present in the particle container
then the index information overrides any material index information
in mesh channel with one exception: if index value is -1 then
the mesh channel information is kept intact.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-23-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMATERIALINDEX_H_
#define _IPARTICLECHANNELMATERIALINDEX_H_
#include "IParticleChannelInt.h"
// standard particle channel "MaterialIndex"
// interface ID
#define PARTICLECHANNELMTLINDEXR_INTERFACE Interface_ID(0x74f93b12, 0x1eb34500)
#define PARTICLECHANNELMTLINDEXW_INTERFACE Interface_ID(0x74f93b12, 0x1eb34501)
#define GetParticleChannelMtlIndexRInterface(obj) ((IParticleChannelIntR*)obj->GetInterface(PARTICLECHANNELMTLINDEXR_INTERFACE))
#define GetParticleChannelMtlIndexWInterface(obj) ((IParticleChannelIntW*)obj->GetInterface(PARTICLECHANNELMTLINDEXW_INTERFACE))
#endif // _IPARTICLECHANNELMTLINDEX_H_

View File

@ -0,0 +1,115 @@
/*! \file IParticleChannelMatrix3.h
\brief Channel-generic interfaces for particle channels that store matrix data.
*/
/**********************************************************************
*<
CREATED BY: Chung-An Lin
HISTORY: created 02-03-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMATRIX3_H_
#define _IPARTICLECHANNELMATRIX3_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "Matrix3"
// interface ID
#define PARTICLECHANNELMATRIX3R_INTERFACE Interface_ID(0x74f93c0a, 0x1eb34500)
#define PARTICLECHANNELMATRIX3W_INTERFACE Interface_ID(0x74f93c0a, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelMatrix3RInterface(obj) ((IParticleChannelMatrix3R*)obj->GetInterface(PARTICLECHANNELMATRIX3R_INTERFACE))
//#define GetParticleChannelMatrix3WInterface(obj) ((IParticleChannelMatrix3W*)obj->GetInterface(PARTICLECHANNELMATRIX3W_INTERFACE))
class IParticleChannelMatrix3R : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_MATRIX3_BR, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_MATRIX3_BR, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelMatrix3 IParticleChannelMatrix3.h
* @{
*/
/*! \fn virtual const Matrix3& GetValue(int index) const = 0;
* \brief Get property for particle with index
*/
virtual const Matrix3& GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief Verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual const Matrix3& GetValue() const = 0;
* \brief If channel is global returns the global value
If channel is not global returns value of the first particle
Returns bounding box for all particles
*/
virtual const Matrix3& GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMATRIX3R_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMATRIX3R_INTERFACE); }
};
class IParticleChannelMatrix3W : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_MATRIX3_BR);
VFN_1(kSetValueGlobal, SetValue, TYPE_MATRIX3_BR);
END_FUNCTION_MAP
/** @defgroup IParticleChannelMatrix3 IParticleChannelMatrix3.h
* @{
*/
/*! \fn virtual void SetValue(int index, const Matrix3& v) = 0;
* \brief Set property for particle with index
*/
virtual void SetValue(int index, const Matrix3& v) = 0;
/*! \fn virtual void SetValue(const Matrix3& v) = 0;
* \brief Set property for all particles at once thus making the channel global
*/
virtual void SetValue(const Matrix3& v) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMATRIX3W_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMATRIX3W_INTERFACE); }
};
#endif // _IPARTICLECHANNELMATRIX3_H_

View File

@ -0,0 +1,129 @@
/*! \file IParticleChannelMesh.h
\brief Channel-generic interface for particle channels
that store data in "mesh" form
The channel can be local (each particle has its own mesh)
global (all particles have the same mesh) and shared
(particles are sharing a limited set of meshes)
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-28-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMESH_H_
#define _IPARTICLECHANNELMESH_H_
#include "max.h"
#include "PFExport.h"
// standard particle channel "Mesh"
// interface ID
#define PARTICLECHANNELMESHR_INTERFACE Interface_ID(0x74f93c11, 0x1eb34500)
#define PARTICLECHANNELMESHW_INTERFACE Interface_ID(0x74f93c11, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelMeshRInterface(obj) ((IParticleChannelMeshR*)obj->GetInterface(PARTICLECHANNELMESHR_INTERFACE))
//#define GetParticleChannelMeshWInterface(obj) ((IParticleChannelMeshW*)obj->GetInterface(PARTICLECHANNELMESHW_INTERFACE))
class IParticleChannelMeshR : public FPMixinInterface
{
public:
// function IDs Read
enum { kIsShared,
kGetValueCount,
kGetValueIndex,
kGetValueByIndex,
kGetValue,
kGetValueFirst,
kGetMaxBoundingBox
};
BEGIN_FUNCTION_MAP
FN_0(kIsShared, TYPE_bool, IsShared);
FN_0(kGetValueCount, TYPE_INT, GetValueCount);
FN_1(kGetValueIndex, TYPE_INT, GetValueIndex, TYPE_INT);
FN_1(kGetValueByIndex, TYPE_MESH, GetValueByIndex, TYPE_INT);
FN_1(kGetValue, TYPE_MESH, GetValue, TYPE_INT);
FN_0(kGetValueFirst, TYPE_MESH, GetValue);
VFN_2(kGetMaxBoundingBox, GetMaxBoundingBox, TYPE_POINT3_BR, TYPE_POINT3_BR);
END_FUNCTION_MAP
// check out if some particles have shared mesh
// if it's true then there is no need to get a shape for each particle
virtual bool IsShared() const = 0;
// get total number of actual meshes (values) in the channel
virtual int GetValueCount() const = 0;
// get the value index of a particle
virtual int GetValueIndex(int particleIndex) const = 0;
// get shape of the valueIndex-th value
virtual const Mesh* GetValueByIndex(int valueIndex) const = 0;
// get shape for particle with index
virtual const Mesh* GetValue(int particleIndex) const = 0;
// get global shape for all particles
// the method returns the mesh of the first particle if it is local or shared
virtual const Mesh* GetValue() const = 0;
// returns maximal bounding box
virtual const Box3& GetMaxBoundingBox() const = 0;
// FnPub alternative for the method above
PFExport void GetMaxBoundingBox(Point3& corner1, Point3& corner2) const;
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHR_INTERFACE); }
};
class IParticleChannelMeshW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueMany,
kSetValueAll,
kCopyValue,
kCopyValueMany,
kCopyValueAll,
kBuildMaxBoundingBox
};
BEGIN_FUNCTION_MAP
FN_2(kSetValue, TYPE_bool, SetValue, TYPE_INT, TYPE_MESH);
FN_2(kSetValueMany, TYPE_bool, SetValue, TYPE_INT_TAB_BR, TYPE_MESH);
FN_1(kSetValueAll, TYPE_bool, SetValue, TYPE_MESH);
FN_2(kCopyValue, TYPE_bool, CopyValue, TYPE_INT, TYPE_INT);
FN_2(kCopyValueMany, TYPE_bool, CopyValue, TYPE_INT, TYPE_INT_TAB_BR);
FN_1(kCopyValueAll, TYPE_bool, CopyValue, TYPE_INT);
VFN_0(kBuildMaxBoundingBox, BuildMaxBoundingBox);
END_FUNCTION_MAP
// copies mesh to be a local value for particle with index "particleIndex"
// returns true if successful
virtual bool SetValue(int particleIndex, Mesh* mesh) = 0;
// copies mesh to be a shared value with indices in "particleIndices"
// returns true if successful
virtual bool SetValue(Tab<int>& particleIndices, Mesh* mesh) = 0;
// copies mesh to be a global values for all particles
// returns true if successful
virtual bool SetValue(Mesh* mesh) = 0;
// copy mesh value from fromParticle to toParticle
virtual bool CopyValue(int fromParticle, int toParticle) = 0;
// copy mesh value from fromParticle to toParticles
virtual bool CopyValue(int fromParticle, Tab<int>& toParticles) = 0;
// copy mesh value from fromParticle to all particles
virtual bool CopyValue(int fromParticle) = 0;
// build maximal bounding box for the set of all shapes
virtual void BuildMaxBoundingBox() = 0;
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHW_INTERFACE); }
};
#endif // _IPARTICLECHANNELMESH_H_

View File

@ -0,0 +1,135 @@
/*! \file IParticleChannelMeshMap.h
\brief Channel-generic interface for particle channels
that store data in "mesh map" form
The channel store a set of MeshMapChannels
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 06-17-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMESHMAP_H_
#define _IPARTICLECHANNELMESHMAP_H_
#include "max.h"
#include "PFExport.h"
#include "IParticleChannelMap.h"
// standard particle channel "Mesh Map"
// interface ID
#define PARTICLECHANNELMESHMAPR_INTERFACE Interface_ID(0x74f93c17, 0x1eb34500)
#define PARTICLECHANNELMESHMAPW_INTERFACE Interface_ID(0x74f93c17, 0x1eb34501)
#define GetParticleChannelMeshMapRInterface(obj) ((IParticleChannelMeshMapR*)obj->GetInterface(PARTICLECHANNELMESHMAPR_INTERFACE))
#define GetParticleChannelMeshMapWInterface(obj) ((IParticleChannelMeshMapW*)obj->GetInterface(PARTICLECHANNELMESHMAPW_INTERFACE))
class IParticleChannelMeshMapR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetNumMaps,
kMapSupport,
kGetMapReadChannel
};
BEGIN_FUNCTION_MAP
FN_0(kGetNumMaps, TYPE_INT, GetNumMaps);
FN_1(kMapSupport, TYPE_bool, MapSupport, TYPE_INT);
FN_1(kGetMapReadChannel, TYPE_INTERFACE, GetMapReadChannel, TYPE_INT);
END_FUNCTION_MAP
/** @defgroup IParticleChannelMeshMap IParticleChannelMeshMap.h
* @{
*/
/*! \fn virtual int GetNumMaps() const = 0;
* \brief returns the number of mapping channels in use.
*/
virtual int GetNumMaps() const = 0;
/*! \fn virtual bool MapSupport(int mp) const = 0;
* \brief returns true if the specified mapping channel is supported; otherwise false
\param int mp: specifies the channel. See List of Mapping Channel Index Values.
*/
virtual bool MapSupport(int mp) const = 0;
/*! \fn virtual IParticleChannelMapR* GetMapReadChannel(int mp) = 0;
* \brief returns an interface if the specified mapping channel is supported; otherwise NULL
\param int mp: specifies the channel. See List of Mapping Channel Index Values.
*/
virtual IParticleChannelMapR* GetMapReadChannel(int mp) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHMAPR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHMAPR_INTERFACE); }
};
class IParticleChannelMeshMapW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetNumMaps,
kSetMapSupport,
kGetMapChannel,
kGetMapChannelObject
};
BEGIN_FUNCTION_MAP
VFN_2(kSetNumMaps, SetNumMaps, TYPE_INT, TYPE_bool);
VFN_2(kSetMapSupport, SetMapSupport, TYPE_INT, TYPE_bool);
FN_1(kGetMapChannel, TYPE_INTERFACE, GetMapChannel, TYPE_INT);
FN_1(kGetMapChannelObject, TYPE_IOBJECT, GetMapChannelObject, TYPE_INT);
END_FUNCTION_MAP
/** @defgroup IParticleChannelMeshMap IParticleChannelMeshMap.h
* @{
*/
/*! \fn virtual void SetNumMaps(int ct, bool keep=false) = 0;
* \brief sets the number of texture maps used. Note that this call is made automatically if SetMapSupport() is called.
\param int ct: the number of texture maps to use. This is a value between 0 and MAX_MESHMAPS-1.
\param bool keep: true to keep the old mapping information after the resize; false to discard it.
*/
virtual void SetNumMaps(int ct, bool keep=false) = 0;
/*! \fn virtual void SetMapSupport(int mp, bool support=true) = 0;
* \brief sets whether the specified mapping channels is supported or not.
\param int mp: specifies the channel. See List of Mapping Channel Index Values.
\param bool support: true to indicate the channel is supported; otherwise false.
*/
virtual void SetMapSupport(int mp, bool support=true) = 0;
/*! \fn virtual IParticleChannelMapW* GetMapChannel(int mp) = 0;
* \brief returns an interface if the specified mapping channel is supported; otherwise NULL
\param int mp: specifies the channel. See List of Mapping Channel Index Values.
*/
virtual IParticleChannelMapW* GetMapChannel(int mp) = 0;
/*! \fn virtual IObject* GetMapChannelObject(int mp) const = 0;
* \brief returns an object if the specified mapping channel is supported; otherwise NULL
\param int mp: specifies the channel. See List of Mapping Channel Index Values.
*/
virtual IObject* GetMapChannelObject(int mp) const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHMAPW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHMAPW_INTERFACE); }
};
#endif // _IPARTICLECHANNELMESHMAP_H_

View File

@ -0,0 +1,130 @@
/*! \file IParticleChannelNew.h
\brief Channel-specific interfaces for ParticleChannelNew.
The channel is used to mark particles that have just
come to the current event (either via birth or a jump from
another event
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-03-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELNEW_H_
#define _IPARTICLECHANNELNEW_H_
// standard particle channel "New"
// interface ID
#define PARTICLECHANNELNEWR_INTERFACE Interface_ID(0x74f93b01, 0x1eb34500)
#define PARTICLECHANNELNEWW_INTERFACE Interface_ID(0x74f93b01, 0x1eb34501)
#define GetParticleChannelNewRInterface(obj) ((IParticleChannelNewR*)obj->GetInterface(PARTICLECHANNELNEWR_INTERFACE))
#define GetParticleChannelNewWInterface(obj) ((IParticleChannelNewW*)obj->GetInterface(PARTICLECHANNELNEWW_INTERFACE))
// function IDs Read
enum { particleChannelNew_isNew,
particleChannelNew_isAllNew,
particleChannelNew_isAllOld
};
// function IDs Write
enum { particleChannelNew_setNew,
particleChannelNew_setOld,
particleChannelNew_setAllNew,
particleChannelNew_setAllOld
};
class IParticleChannelNewR : public FPMixinInterface
{
BEGIN_FUNCTION_MAP
FN_1(particleChannelNew_isNew, TYPE_bool, IsNew, TYPE_INT);
FN_0(particleChannelNew_isAllNew, TYPE_bool, IsAllNew);
FN_0(particleChannelNew_isAllOld, TYPE_bool, IsAllOld);
END_FUNCTION_MAP
public:
/** @defgroup IParticleChannelNew IParticleChannelNew.h
* @{
*/
// get particle property
/*! \fn virtual bool IsNew(int index) const = 0;
* \brief Checks if particle with index is new
*/
virtual bool IsNew(int index) const = 0; // is particle with the index is new
/*! \fn virtual bool IsAllNew() const = 0;
* \brief Checks if all particles are new
*/
virtual bool IsAllNew() const = 0; // all particles are new
/*! \fn virtual bool IsAllOld() const = 0;
* \brief Checks if all particles are old
*/
virtual bool IsAllOld() const = 0; // all particles are old
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELNEWR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELNEWR_INTERFACE); }
};
class IParticleChannelNewW : public FPMixinInterface
{
BEGIN_FUNCTION_MAP
VFN_1(particleChannelNew_setNew, SetNew, TYPE_INT);
VFN_1(particleChannelNew_setOld, SetOld, TYPE_INT);
VFN_0(particleChannelNew_setAllNew, SetAllNew);
VFN_0(particleChannelNew_setAllOld, SetAllOld);
END_FUNCTION_MAP
public:
/** @defgroup IParticleChannelNew IParticleChannelNew.h
* @{
*/
// get/set particle property
/*! \fn virtual void SetNew(int index) = 0;
* \brief Sets particle as new, returns true if success
*/
virtual void SetNew(int index) = 0;
/*! \fn virtual void SetOld(int index) = 0;
* \brief Sets particle as old, returns true if success
*/
virtual void SetOld(int index) = 0;
/*! \fn virtual void SetAllNew() = 0;
* \brief Sets all particles as "new"
*/
virtual void SetAllNew() = 0;
/*! \fn virtual void SetAllOld() = 0;
* \brief Sets all particles as "old"
*/
virtual void SetAllOld() = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELNEWW_INTERFACE); }
* \brief
*/
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELNEWW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELNEWW_INTERFACE); }
};
#endif // _IPARTICLECHANNELNEW_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelOrientation.h
\brief Channel-specific interface for ParticleChannelOrientation
Particle orientation is stored in quaternion form
The channel is a wrap around ParticleChannelQuat
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-09-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELORIENTATION_H_
#define _IPARTICLECHANNELORIENTATION_H_
#include "IParticleChannelQuat.h"
// standard particle channel "Orientation"
// interface ID
#define PARTICLECHANNELORIENTATIONR_INTERFACE Interface_ID(0x74f93b09, 0x1eb34500)
#define PARTICLECHANNELORIENTATIONW_INTERFACE Interface_ID(0x74f93b09, 0x1eb34501)
#define GetParticleChannelOrientationRInterface(obj) ((IParticleChannelQuatR*)obj->GetInterface(PARTICLECHANNELORIENTATIONR_INTERFACE))
#define GetParticleChannelOrientationWInterface(obj) ((IParticleChannelQuatW*)obj->GetInterface(PARTICLECHANNELORIENTATIONW_INTERFACE))
#endif // _IPARTICLECHANNELORIENTATION_H_

View File

@ -0,0 +1,128 @@
/*! \file IParticleChannelPTV.h
\brief Channel-generic interfaces for particle channels that keep time data.
For precision reasons the time is kept in two
components: TimeValue FrameTime and float FractionTime ]-0.5, 0.5]
The result time is a sum of these two components.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-29-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELPTV_H_
#define _IPARTICLECHANNELPTV_H_
#include "PreciseTimeValue.h"
// generic particle channel "PTV" : PreciseTimeValue
// interface ID
#define PARTICLECHANNELPTVR_INTERFACE Interface_ID(0x74f93c07, 0x1eb34500)
#define PARTICLECHANNELPTVW_INTERFACE Interface_ID(0x74f93c07, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelPTVRInterface(obj) ((IParticleChannelPTVR*)obj->GetInterface(PARTICLECHANNELPTVR_INTERFACE))
//#define GetParticleChannelPTVWInterface(obj) ((IParticleChannelPTVW*)obj->GetInterface(PARTICLECHANNELPTVW_INTERFACE))
class IParticleChannelPTVR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetTick,
kGetFraction,
kGetTickFraction,
kIsSync
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetTick, TYPE_TIMEVALUE, GetTick, TYPE_INT);
FN_1(kGetFraction, TYPE_FLOAT, GetFraction, TYPE_INT);
VFN_3(kGetTickFraction, GetTickFraction, TYPE_INT, TYPE_TIMEVALUE_BR, TYPE_FLOAT_BR);
FN_0(kIsSync, TYPE_bool, IsSync);
END_FUNCTION_MAP
/** @defgroup IParticleChannelPTV IParticleChannelPTV.h
* @{
*/
/*! \fn virtual TimeValue GetTick(int index) const = 0;
* \brief Get particle property
*/
virtual TimeValue GetTick(int index) const = 0;
/*! \fn virtual float GetFraction(int index) const = 0;
* \brief Returns true if "index" particle exists
*/
virtual float GetFraction(int index) const = 0;
/*! \fn virtual void GetTickFraction(int index, TimeValue& tick, float& fraction) const = 0;
* \brief
*/
virtual void GetTickFraction(int index, TimeValue& tick, float& fraction) const = 0;
/*! \fn virtual bool IsSync() const = 0;
* \brief Returns true if all particles have the same time
*/
virtual bool IsSync() const = 0;
/*! \fn virtual const PreciseTimeValue& GetValue(int index) const = 0;
* \brief Methods not in the mapped interface
*/
virtual const PreciseTimeValue& GetValue(int index) const = 0;
/*! \fn virtual const PreciseTimeValue& GetValue() const = 0;
* \brief Get synchronized time for all particles; if timing isn't
synchronized then return time for the first particle in the container
*/
virtual const PreciseTimeValue& GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELPTVR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELPTVR_INTERFACE); }
/*@}*/
};
class IParticleChannelPTVW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetTick,
kSetFraction,
kSetTickFraction,
};
BEGIN_FUNCTION_MAP
VFN_2(kSetTick, SetTick, TYPE_INT, TYPE_TIMEVALUE);
VFN_2(kSetFraction, SetFraction, TYPE_INT, TYPE_FLOAT);
VFN_3(kSetTickFraction, SetTickFraction, TYPE_INT, TYPE_TIMEVALUE, TYPE_FLOAT);
END_FUNCTION_MAP
// set particle property
virtual void SetTick(int index, TimeValue time) = 0;
virtual void SetFraction(int index, float time) = 0;
virtual void SetTickFraction(int index, TimeValue tick, float fraction) = 0;
// methods not in the mapped interface
virtual void SetValue(int index, const PreciseTimeValue& time) = 0;
// set synchronized time for all particles
virtual void SetValue(const PreciseTimeValue& time) = 0;
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELPTVW_INTERFACE); }
};
#endif // _IPARTICLECHANNELPTV_H_

View File

@ -0,0 +1,105 @@
/*! \file IParticleChannelPoint3.h
\brief Channel-generic interfaces for particle channels that store 3D vector data.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-29-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELPOINT3_H_
#define _IPARTICLECHANNELPOINT3_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "Point3"
// interface ID
#define PARTICLECHANNELPOINT3R_INTERFACE Interface_ID(0x74f93c03, 0x1eb34500)
#define PARTICLECHANNELPOINT3W_INTERFACE Interface_ID(0x74f93c03, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelPoint3RInterface(obj) ((IParticleChannelPoint3R*)obj->GetInterface(PARTICLECHANNELPOINT3R_INTERFACE))
//#define GetParticleChannelPoint3WInterface(obj) ((IParticleChannelPoint3W*)obj->GetInterface(PARTICLECHANNELPOINT3W_INTERFACE))
class IParticleChannelPoint3R : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal,
kGetBoundingBox,
kGetMaxLengthValue
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_POINT3_BR, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_POINT3_BR, GetValue);
VFN_2(kGetBoundingBox, GetBoundingBox, TYPE_POINT3_BR, TYPE_POINT3_BR);
FN_0(kGetMaxLengthValue, TYPE_FLOAT, GetMaxLengthValue);
END_FUNCTION_MAP
// get property for particle with index
virtual const Point3& GetValue(int index) const = 0;
// verify if the channel is global
virtual bool IsGlobal() const = 0;
// if channel is global returns the global value
// if channel is not global returns value of the first particle
virtual const Point3& GetValue() const = 0;
// returns bounding box for all particles
virtual const Box3& GetBoundingBox() const = 0;
// FnPub alternative for the method above
PFExport void GetBoundingBox(Point3& corner1, Point3& corner2) const;
// returns maximum length of 3D vector of all particles
virtual float GetMaxLengthValue() const = 0;
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELPOINT3R_INTERFACE); }
};
class IParticleChannelPoint3W : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
kBuildBoundingBox,
kUpdateMaxLengthValue
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_POINT3_BR);
VFN_1(kSetValueGlobal, SetValue, TYPE_POINT3_BR);
VFN_0(kBuildBoundingBox, BuildBoundingBox);
VFN_0(kUpdateMaxLengthValue, UpdateMaxLengthValue);
END_FUNCTION_MAP
// set property for particle with index
virtual void SetValue(int index, const Point3& v) = 0;
// set property for all particles at once thus making the channel global
virtual void SetValue(const Point3& v) = 0;
// build bounding box for 3D vector data of all particles
virtual void BuildBoundingBox() = 0;
// update maximum length value for 3d vector data of all particles
virtual void UpdateMaxLengthValue() = 0;
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELPOINT3W_INTERFACE); }
};
#endif // _IPARTICLECHANNELPOINT3_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelPosition.h
\brief Channel-specific interface for ParticleChannelPosition
Particle position is stored in absolute world coordianates
The channel is a wrap around ParticleChannelPoint3
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-19-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELPOSITION_H_
#define _IPARTICLECHANNELPOSITION_H_
#include "IParticleChannelPoint3.h"
// standard particle channel "Position"
// interface ID
#define PARTICLECHANNELPOSITIONR_INTERFACE Interface_ID(0x74f93b06, 0x1eb34500)
#define PARTICLECHANNELPOSITIONW_INTERFACE Interface_ID(0x74f93b06, 0x1eb34501)
#define GetParticleChannelPositionRInterface(obj) ((IParticleChannelPoint3R*)obj->GetInterface(PARTICLECHANNELPOSITIONR_INTERFACE))
#define GetParticleChannelPositionWInterface(obj) ((IParticleChannelPoint3W*)obj->GetInterface(PARTICLECHANNELPOSITIONW_INTERFACE))
#endif // _IPARTICLECHANNELPOSITION_H_

View File

@ -0,0 +1,119 @@
/*! \file IParticleChannelQuat.h
\brief Channel-generic interfaces for particle channels that store quaternion data.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-09-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELQUAT_H_
#define _IPARTICLECHANNELQUAT_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "Quat"
// interface ID
#define PARTICLECHANNELQUATR_INTERFACE Interface_ID(0x74f93c0e, 0x1eb34500)
#define PARTICLECHANNELQUATW_INTERFACE Interface_ID(0x74f93c0e, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelQuatRInterface(obj) ((IParticleChannelQuatR*)obj->GetInterface(PARTICLECHANNELQUATR_INTERFACE))
//#define GetParticleChannelQuatWInterface(obj) ((IParticleChannelQuatW*)obj->GetInterface(PARTICLECHANNELQUATW_INTERFACE))
class IParticleChannelQuatR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_QUAT_BR, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_QUAT_BR, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelQuat IParticleChannelQuat.h
* @{
*/
/*! \fn virtual const Quat& GetValue(int index) const = 0;
* \brief Get property for particle with index
*/
virtual const Quat& GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief Verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual const Quat& GetValue() const = 0;
* \brief If channel is global, returns the global value. If channel is not global, returns value of the first particle.
*/
virtual const Quat& GetValue() const = 0;
// returns bounding box for all particles
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELQUATR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELQUATR_INTERFACE); }
};
class IParticleChannelQuatW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_QUAT_BR);
VFN_1(kSetValueGlobal, SetValue, TYPE_QUAT_BR);
END_FUNCTION_MAP
/** @defgroup IParticleChannelQuat IParticleChannelQuat.h
* @{
*/
/*! \fn virtual void SetValue(int index, const Quat& v) = 0;
* \brief Set property for particle with index
*/
virtual void SetValue(int index, const Quat& v) = 0;
/*! \fn virtual void SetValue(const Quat& v) = 0;
* \brief Set property for all particles at once thus making the channel global
*/
virtual void SetValue(const Quat& v) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELQUATW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELQUATW_INTERFACE); }
/*@}*/
};
#endif // _IPARTICLECHANNELQUAT_H_

View File

@ -0,0 +1,30 @@
/*! \file IParticleChannelScale.h
\brief Channel-specific interface for ParticleChannelScale
The channel stores scaling factor for each particle as
Point3 value.
The channel is a wrap around ParticleChannelPoint3
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-04-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELSCALE_H_
#define _IPARTICLECHANNELSCALE_H_
#include "IParticleChannelPoint3.h"
// standard particle channel "Scale"
// interface ID
#define PARTICLECHANNELSCALER_INTERFACE Interface_ID(0x74f93b0b, 0x1eb34500)
#define PARTICLECHANNELSCALEW_INTERFACE Interface_ID(0x74f93b0b, 0x1eb34501)
#define GetParticleChannelScaleRInterface(obj) ((IParticleChannelPoint3R*)obj->GetInterface(PARTICLECHANNELSCALER_INTERFACE))
#define GetParticleChannelScaleWInterface(obj) ((IParticleChannelPoint3W*)obj->GetInterface(PARTICLECHANNELSCALEW_INTERFACE))
#endif // _IPARTICLECHANNELSCALE_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelSelection.h
\brief Channel-specific interfaces for ParticleChannelSelection
The channel is used to track selection status of particles
The channel is a wrap around ParticleChannelBool
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 02-19-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELSELECTION_H_
#define _IPARTICLECHANNELSELECTION_H_
#include "IParticleChannelBool.h"
// standard particle channel "Selection"
// interface ID
#define PARTICLECHANNELSELECTIONR_INTERFACE Interface_ID(0x74f93b13, 0x1eb34500)
#define PARTICLECHANNELSELECTIONW_INTERFACE Interface_ID(0x74f93b13, 0x1eb34501)
#define GetParticleChannelSelectionRInterface(obj) ((IParticleChannelBoolR*)obj->GetInterface(PARTICLECHANNELSELECTIONR_INTERFACE))
#define GetParticleChannelSelectionWInterface(obj) ((IParticleChannelBoolW*)obj->GetInterface(PARTICLECHANNELSELECTIONW_INTERFACE))
#endif // _IPARTICLECHANNELSELECTION_H_

View File

@ -0,0 +1,30 @@
/*! \file IParticleChannelShape.h
\brief Channel-specific interfaces for ParticleChannelShape
The channel is used to store particle representation
in mesh form for viewports and during render
The channel is a wrap around ParticleChannelMesh
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 12-04-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELSHAPE_H_
#define _IPARTICLECHANNELSHAPE_H_
#include "IParticleChannelMesh.h"
// standard particle channel "Shape"
// interface ID
#define PARTICLECHANNELSHAPER_INTERFACE Interface_ID(0x74f93b0c, 0x1eb34500)
#define PARTICLECHANNELSHAPEW_INTERFACE Interface_ID(0x74f93b0c, 0x1eb34501)
#define GetParticleChannelShapeRInterface(obj) ((IParticleChannelMeshR*)obj->GetInterface(PARTICLECHANNELSHAPER_INTERFACE))
#define GetParticleChannelShapeWInterface(obj) ((IParticleChannelMeshW*)obj->GetInterface(PARTICLECHANNELSHAPEW_INTERFACE))
#endif // _IPARTICLECHANNELSHAPE_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelShapeTexture.h
\brief Channel-specific interfaces for ParticleChannelShapeTexture
The channel is used to store particle mapping
The channel is a wrap around ParticleChannelMeshMap
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 06-21-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELSHAPETEXTURE_H_
#define _IPARTICLECHANNELSHAPETEXTURE_H_
#include "IParticleChannelMeshMap.h"
// standard particle channel "Shape Texture"
// interface ID
#define PARTICLECHANNELSHAPETEXTURER_INTERFACE Interface_ID(0x74f93b10, 0x1eb34500)
#define PARTICLECHANNELSHAPETEXTUREW_INTERFACE Interface_ID(0x74f93b10, 0x1eb34501)
#define GetParticleChannelShapeTextureRInterface(obj) ((IParticleChannelMeshMapR*)obj->GetInterface(PARTICLECHANNELSHAPETEXTURER_INTERFACE))
#define GetParticleChannelShapeTextureWInterface(obj) ((IParticleChannelMeshMapW*)obj->GetInterface(PARTICLECHANNELSHAPETEXTUREW_INTERFACE))
#endif // _IPARTICLECHANNELSHAPETEXTURE_H_

View File

@ -0,0 +1,30 @@
/*! \file IParticleChannelSpeed.h
\brief Channel-specific interface for ParticleChannelSpeed.
Particle speed is stored in absolute world coordianates.
The speed is in units per tick.
The channel is a wrap around ParticleChannelPoint3.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-19-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELSPEED_H_
#define _IPARTICLECHANNELSPEED_H_
#include "IParticleChannelPoint3.h"
// standard particle channel "Speed"
// interface ID
#define PARTICLECHANNELSPEEDR_INTERFACE Interface_ID(0x74f93b07, 0x1eb34500)
#define PARTICLECHANNELSPEEDW_INTERFACE Interface_ID(0x74f93b07, 0x1eb34501)
#define GetParticleChannelSpeedRInterface(obj) ((IParticleChannelPoint3R*)obj->GetInterface(PARTICLECHANNELSPEEDR_INTERFACE))
#define GetParticleChannelSpeedWInterface(obj) ((IParticleChannelPoint3W*)obj->GetInterface(PARTICLECHANNELSPEEDW_INTERFACE))
#endif // _IPARTICLECHANNELSPEED_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelSpin.h
\brief Channel-specific interface for ParticleChannelSpin.
Particle spin rate is stored in angle/axis form.
The rate is in radians per tick.
The channel is a wrap around ParticleChannelAngAxis.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-09-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELSPIN_H_
#define _IPARTICLECHANNELSPIN_H_
#include "IParticleChannelAngAxis.h"
// standard particle channel "Spin"
// interface ID
#define PARTICLECHANNELSPINR_INTERFACE Interface_ID(0x74f93b0a, 0x1eb34500)
#define PARTICLECHANNELSPINW_INTERFACE Interface_ID(0x74f93b0a, 0x1eb34501)
#define GetParticleChannelSpinRInterface(obj) ((IParticleChannelAngAxisR*)obj->GetInterface(PARTICLECHANNELSPINR_INTERFACE))
#define GetParticleChannelSpinWInterface(obj) ((IParticleChannelAngAxisW*)obj->GetInterface(PARTICLECHANNELSPINW_INTERFACE))
#endif // _IPARTICLECHANNELSPIN_H_

View File

@ -0,0 +1,125 @@
/*! \file IParticleChannelTabTVFace.h
\brief Channel-generic interface for particle channels
that store data in Tab<TVFace> form
The channel can be local (each particle has its own Tab<TVFace>)
global (all particles have the same Tab<TVFace>) and shared
(particles are sharing a limited set of Tab<TVFace>)
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 06-19-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELTABTVFACE_H_
#define _IPARTICLECHANNELTABTVFACE_H_
#include "max.h"
#include "PFExport.h"
#define TabTVFace Tab<TVFace>
// standard particle channel "Tab<TVFace>"
// interface ID
#define PARTICLECHANNELTABTVFACER_INTERFACE Interface_ID(0x74f93c14, 0x1eb34500)
#define PARTICLECHANNELTABTVFACEW_INTERFACE Interface_ID(0x74f93c14, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelTabTVFaceRInterface(obj) ((IParticleChannelTabTVFaceR*)obj->GetInterface(PARTICLECHANNELTABTVFACER_INTERFACE))
//#define GetParticleChannelTabTVFaceWInterface(obj) ((IParticleChannelTabTVFaceW*)obj->GetInterface(PARTICLECHANNELTABTVFACEW_INTERFACE))
class IParticleChannelTabTVFaceR : public FPMixinInterface
{
public:
/** @defgroup IParticleChannelTabTVFace IParticleChannelTabTVFace.h
* @{
*/
/*! \fn virtual bool IsShared() const = 0;
* \brief Check out if some particles have shared Tab<TVFace>. If it's true then there is no need to get a Tab for each particle.
*/
virtual bool IsShared() const = 0;
/*! \fn virtual int GetValueCount() const = 0;
* \brief Get total number of actual Tabs (values) in the channel
*/
virtual int GetValueCount() const = 0;
/*! \fn virtual int GetValueIndex(int particleIndex) const = 0;
* \brief Get the value index of a particle
*/
virtual int GetValueIndex(int particleIndex) const = 0;
/*! \fn virtual const TabTVFace* GetValueByIndex(int valueIndex) const = 0;
* \brief Get Tab of the valueIndex-th value
*/
virtual const TabTVFace* GetValueByIndex(int valueIndex) const = 0;
/*! \fn virtual const TabTVFace* GetValue(int particleIndex) const = 0;
* \brief Get Tab for particle with index
*/
virtual const TabTVFace* GetValue(int particleIndex) const = 0;
/*! \fn virtual const TabTVFace* GetValue() const = 0;
* \brief Get global Tab<TVFace> for all particles. The method returns the Tab of the first particle if it is local or shared.
*/
virtual const TabTVFace* GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELTABTVFACER_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELTABTVFACER_INTERFACE); }
};
class IParticleChannelTabTVFaceW : public FPMixinInterface
{
public:
/** @defgroup IParticleChannelTabTVFace IParticleChannelTabTVFace.h
* @{
*/
/*! \fn virtual bool SetValue(int particleIndex, const TabTVFace* value) = 0;
* \brief Copies Tab to be a local value for particle with index "particleIndex". Returns true if successful.
*/
virtual bool SetValue(int particleIndex, const TabTVFace* value) = 0;
/*! \fn virtual bool SetValue(Tab<int>& particleIndices, const TabTVFace* value) = 0;
* \brief Copies Tab to be a shared value with indices in "particleIndices". Returns true if successful.
*/
virtual bool SetValue(Tab<int>& particleIndices, const TabTVFace* value) = 0;
/*! \fn virtual bool SetValue(const TabTVFace* value) = 0;
* \brief Copies Tab to be a global values for all particles. Returns true if successful.
*/
virtual bool SetValue(const TabTVFace* value) = 0;
/*! \fn virtual bool CopyValue(int fromParticle, int toParticle) = 0;
* \brief Copy tab value from fromParticle to toParticle
*/
virtual bool CopyValue(int fromParticle, int toParticle) = 0;
/*! \fn virtual bool CopyValue(int fromParticle, Tab<int>& toParticles) = 0;
* \brief Copy tab value from fromParticle to toParticles
*/
virtual bool CopyValue(int fromParticle, Tab<int>& toParticles) = 0;
/*! \fn virtual bool CopyValue(int fromParticle) = 0;
* \brief Copy tab value from fromParticle to all particles
*/
virtual bool CopyValue(int fromParticle) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELTABTVFACEW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELTABTVFACEW_INTERFACE); }
};
#endif // _IPARTICLECHANNELTVFACE_H_
/*@}*/

View File

@ -0,0 +1,150 @@
/*! \file IParticleChannelTabUVVert.h
\brief Channel-generic interface for particle channels
that store data in Tab<UVVert> form
The channel can be local (each particle has its own Tab<UVVert>)
global (all particles have the same Tab<UVVert>) and shared
(particles are sharing a limited set of Tab<UVVert>)
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 06-19-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELTABUVVERT_H_
#define _IPARTICLECHANNELTABUVVERT_H_
#include "max.h"
#include "PFExport.h"
#define TabUVVert Tab<UVVert>
// standard particle channel "Tab<UVVert>"
// interface ID
#define PARTICLECHANNELTABUVVERTR_INTERFACE Interface_ID(0x74f93c14, 0x1eb34500)
#define PARTICLECHANNELTABUVVERTW_INTERFACE Interface_ID(0x74f93c14, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelTabUVVertRInterface(obj) ((IParticleChannelTabUVVertR*)obj->GetInterface(PARTICLECHANNELTABUVVERTR_INTERFACE))
//#define GetParticleChannelTabUVVertWInterface(obj) ((IParticleChannelTabUVVertW*)obj->GetInterface(PARTICLECHANNELTABUVVERTW_INTERFACE))
class IParticleChannelTabUVVertR : public FPMixinInterface
{
public:
/** @defgroup IParticleChannelTabUVVert IParticleChannelTabUVVert.h
* @{
*/
/*! \fn virtual bool IsShared() const = 0;
* \brief Check out if some particles have shared Tab<UVVert>.
If it's true, then there is no need to get a Tab for each particle.
*/
virtual bool IsShared() const = 0;
/*! \fn virtual int GetValueCount() const = 0;
* \brief Get total number of actual Tabs (values) in the channel.
*/
virtual int GetValueCount() const = 0;
/*! \fn virtual int GetValueIndex(int particleIndex) const = 0;
* \brief Get the value index of a particle.
*/
virtual int GetValueIndex(int particleIndex) const = 0;
/*! \fn virtual const TabUVVert* GetValueByIndex(int valueIndex) const = 0;
* \brief Get Tab of the valueIndex-th value
virtual const TabUVVert* GetValueByIndex(int valueIndex) const = 0;
*/
/*! \fn virtual const TabUVVert* GetValue(int particleIndex) const = 0;
* \brief Get Tab for particle with index
*/
virtual const TabUVVert* GetValue(int particleIndex) const = 0;
/*! \fn virtual const TabUVVert* GetValue() const = 0;
* \brief Get global Tab<UVVert> for all particles.
The method returns the Tab of the first particle if it is local or shared.
*/
virtual const TabUVVert* GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELTABUVVERTR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELTABUVVERTR_INTERFACE); }
};
class IParticleChannelTabUVVertW : public FPMixinInterface
{
public:
/** @defgroup IParticleChannelTabUVVert IParticleChannelTabUVVert.h
* @{
*/
/*! \fn virtual bool SetValue(int particleIndex, const TabUVVert* value) = 0;
* \brief Copies Tab to be a local value for particle with index "particleIndex".
Returns true if successful.
*/
virtual bool SetValue(int particleIndex, const TabUVVert* value) = 0;
/*! \fn virtual bool SetValue(int particleIndex, UVVert value) = 0;
* \brief Creates a Tab of size one from the UVVert value and
copies the Tab to be a local value for particle with index "particleIndex".
Returns true if successful
*/
virtual bool SetValue(int particleIndex, UVVert value) = 0;
/*! \fn virtual bool SetValue(Tab<int>& particleIndices, const TabUVVert* value) = 0;
* \brief Copies Tab to be a shared value with indices in "particleIndices".
Returns true if successful.
*/
virtual bool SetValue(Tab<int>& particleIndices, const TabUVVert* value) = 0;
/*! \fn virtual bool SetValue(Tab<int>& particleIndices, UVVert value) = 0;
* \brief Creates a Tab of size one from the UVVert value and
copies the Tab to be a shared value with indices in "particleIndices".
Returns true if successful.
*/
virtual bool SetValue(Tab<int>& particleIndices, UVVert value) = 0;
/*! \fn virtual bool SetValue(const TabUVVert* value) = 0;
* \brief Copies Tab to be a global values for all particles.
Returns true if successful
*/
virtual bool SetValue(const TabUVVert* value) = 0;
/*! \fn virtual bool SetValue(UVVert value) = 0;
* \brief Creates a Tab of size one from the UVVert value and
copies the Tab to be a global values for all particles.
Returns true if successful.
*/
virtual bool SetValue(UVVert value) = 0;
/*! \fn virtual bool CopyValue(int fromParticle, int toParticle) = 0;
* \brief Copy tab value from fromParticle to toParticle
*/
virtual bool CopyValue(int fromParticle, int toParticle) = 0;
/*! \fn virtual bool CopyValue(int fromParticle, Tab<int>& toParticles) = 0;
* \brief Copy tab value from fromParticle to toParticles
*/
virtual bool CopyValue(int fromParticle, Tab<int>& toParticles) = 0;
/*! \fn virtual bool CopyValue(int fromParticle) = 0;
* \brief Copy tab value from fromParticle to all particles
*/
virtual bool CopyValue(int fromParticle) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELTABUVVERTW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELTABUVVERTW_INTERFACE); }
/*@}*/
};
#endif // _IPARTICLECHANNELUVVERT_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelTime.h
\brief Channel-specific interfaces for ParticleChannelTime.
The channel is used to trace current particle time.
The channel is a wrap around ParticleChannelPTV.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-04-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELTIME_H_
#define _IPARTICLECHANNELTIME_H_
#include "IParticleChannelPTV.h"
// standard particle channel "Time"
// interface ID
#define PARTICLECHANNELTIMER_INTERFACE Interface_ID(0x74f93b03, 0x1eb34500)
#define PARTICLECHANNELTIMEW_INTERFACE Interface_ID(0x74f93b03, 0x1eb34501)
#define GetParticleChannelTimeRInterface(obj) ((IParticleChannelPTVR*)obj->GetInterface(PARTICLECHANNELTIMER_INTERFACE))
#define GetParticleChannelTimeWInterface(obj) ((IParticleChannelPTVW*)obj->GetInterface(PARTICLECHANNELTIMEW_INTERFACE))
#endif // _IPARTICLECHANNELTIME_H_

View File

@ -0,0 +1,113 @@
/*! \file IParticleChannelVoid.h
\brief Channel-generic interfaces for particle channels that store generic pointers.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 07-08-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELVOID_H_
#define _IPARTICLECHANNELVOID_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "VoidPtr"
// interface ID
#define PARTICLECHANNELVOIDR_INTERFACE Interface_ID(0x74f93c0b, 0x1eb34500)
#define PARTICLECHANNELVOIDW_INTERFACE Interface_ID(0x74f93c0b, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelVoidRInterface(obj) ((IParticleChannelVoidR*)obj->GetInterface(PARTICLECHANNELVOIDR_INTERFACE))
//#define GetParticleChannelVoidWInterface(obj) ((IParticleChannelVoidW*)obj->GetInterface(PARTICLECHANNELVOIDW_INTERFACE))
class IParticleChannelVoidR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_VALUE, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_VALUE, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelVoid IParticleChannelVoid.h
* @{
*/
/*! \fn virtual void* GetValue(int index) const = 0;
* \brief get property for particle with index
*/
virtual void* GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual void* GetValue() const = 0;
* \brief if channel is global returns the global value. if channel is not global returns value of the first particle
*/
virtual void* GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELVOIDR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELVOIDR_INTERFACE); }
};
class IParticleChannelVoidW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_VALUE);
VFN_1(kSetValueGlobal, SetValue, TYPE_VALUE);
END_FUNCTION_MAP
/** @defgroup IParticleChannelVoid IParticleChannelVoid.h
* @{
*/
/*! \fn virtual void SetValue(int index, void* value) = 0;
* \brief set property for particle with index
*/
virtual void SetValue(int index, void* value) = 0;
/*! \fn virtual void SetValue(void* value) = 0;
* \brief set property for all particles at once thus making the channel global
*/
virtual void SetValue(void* value) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELVOIDW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELVOIDW_INTERFACE); }
};
#endif // _IPARTICLECHANNELVOID_H_

View File

@ -0,0 +1,56 @@
/*! \file IParticleChannels.h
\brief Collection of headers of all particle channels.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 5-21-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELS_H_
#define _IPARTICLECHANNELS_H_
#include "IParticleChannel.h"
#include "IParticleChannelAmount.h"
#include "IParticleChannelAngAxis.h"
#include "IParticleChannelBool.h"
#include "IParticleChannelFloat.h"
#include "IParticleChannelINode.h"
#include "IParticleChannelInt.h"
#include "IParticleChannelMatrix3.h"
#include "IParticleChannelMap.h"
#include "IParticleChannelMesh.h"
#include "IParticleChannelMeshMap.h"
#include "IParticleChannelMXSFloat.h"
#include "IParticleChannelMXSInteger.h"
#include "IParticleChannelMXSMatrix.h"
#include "IParticleChannelMXSVector.h"
#include "IParticleChannelPoint3.h"
#include "IParticleChannelPTV.h"
#include "IParticleChannelQuat.h"
#include "IParticleChannelID.h"
#include "IParticleChannelNew.h"
#include "IParticleChannelAcceleration.h"
#include "IParticleChannelBirthTime.h"
#include "IParticleChannelDeathTime.h"
#include "IParticleChannelLifespan.h"
#include "IParticleChannelEventStart.h"
#include "IParticleChannelMaterialIndex.h"
#include "IParticleChannelOrientation.h"
#include "IParticleChannelPosition.h"
#include "IParticleChannelScale.h"
#include "IParticleChannelSelection.h"
#include "IParticleChannelShape.h"
#include "IParticleChannelShapeTexture.h"
#include "IParticleChannelSpeed.h"
#include "IParticleChannelSpin.h"
#include "IParticleChannelTabUVVert.h"
#include "IParticleChannelTabTVFace.h"
#include "IParticleChannelTime.h"
#include "IParticleChannelVoid.h"
#endif // _IPARTICLECHANNELS_H_

View File

@ -0,0 +1,137 @@
/*! \file IParticleContainer.h
\brief An interface class to ParticleContainer. ParticleContainer is a collection of different particle channels.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 9-19-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECONTAINER_H_
#define _IPARTICLECONTAINER_H_
#include "PFExport.h"
#include "IParticleChannelAmount.h"
#include "IChannelContainer.h"
class IParticleContainer: public IObject,
public IChannelContainer,
public IParticleChannelAmountR,
public IParticleChannelAmountW
{
public:
/** @defgroup IParticleContainer IParticleContainer.h
* @{
*/
/*! \fn TCHAR* GetIObjectName();
* \brief Implemented in ParticleContainer as the corresponding interface from IObject interface
*/
// TCHAR* GetIObjectName();
/*! \fn int NumInterfaces();
* \brief Implemented in ParticleContainer as the corresponding interface from IObject interface
*/
// int NumInterfaces();
/*! \fn BaseInterface* GetInterfaceAt(int index);
* \brief Implemented in ParticleContainer as the corresponding interface from IObject interface
*/
// BaseInterface* GetInterfaceAt(int index);
/*! \fn BaseInterface* GetInterface(Interface_ID id);
* \brief Implemented in ParticleContainer as the corresponding interface from IObject interface
*/
// BaseInterface* GetInterface(Interface_ID id);
/*! \fn void AcquireIObject();
* \brief Implemented in ParticleContainer as the corresponding interface from IObject interface
*/
// void AcquireIObject();
/*! \fn void ReleaseIObject();
* \brief Implemented in ParticleContainer as the corresponding interface from IObject interface
*/
// void ReleaseIObject();
/*! \fn void DeleteIObject();
* \brief Implemented in ParticleContainer as the corresponding interface from IObject interface
*/
// void DeleteIObject();
/*! \fn FPInterfaceDesc* GetDescByID(Interface_ID id);
* \brief from FPMixinInterface
*/
// FPInterfaceDesc* GetDescByID(Interface_ID id);
/*! \fn int NumChannels() const;
* \brief from IChannelContainer
*/
// int NumChannels() const;
/*! \fn IObject* GetChannel(int i) const;
* \brief from IChannelContainer
*/
// IObject* GetChannel(int i) const;
/*! \fn bool AddChannel(IObject* channel);
* \brief from IChannelContainer
*/
// bool AddChannel(IObject* channel);
/*! \fn int Count() const;
* \brief from IParticleChannelAmountR
*/
// int Count() const;
/*! \fn void ZeroCount();
* \brief from IParticleChannelAmountW
*/
// void ZeroCount();
/*! \fn bool SetCount(int n);
* \brief from IParticleChannelAmountW
*/
// bool SetCount(int n);
/*! \fn int Delete(int start,int num);
* \brief from IParticleChannelAmountW
*/
// int Delete(int start,int num);
/*! \fn int Delete(BitArray& toRemove);
* \brief from IParticleChannelAmountW
*/
// int Delete(BitArray& toRemove);
/*! \fn FPInterface* Split(BitArray& toSplit);
* \brief from IParticleChannelAmountW
*/
// FPInterface* Split(BitArray& toSplit);
/*! \fn bool Spawn( Tab<int>& spawnTable );
* \brief from IParticleChannelAmountW
*/
// bool Spawn( Tab<int>& spawnTable );
/*! \fn bool AppendNum(int num);
* \brief from IParticleChannelAmountW
*/
// bool AppendNum(int num);
/*! \fn bool AppendChannel(IObject* channel);
* \brief from IParticleChannelAmountW
*/
// bool AppendChannel(IObject* channel);
/*! \fn void DeleteThis() { DeleteIObject(); }
* \brief to make "Delete" interface similar to Animatable
*/
// void DeleteThis() { DeleteIObject(); }
};
#endif // _IPARTICLECONTAINER_H_

View File

@ -0,0 +1,233 @@
/*! \file IParticleGroup.h
\brief Interface for ParticleGroup object.
ParticleGroup is a geometry object that is created
for each interrelated pair of particle system and
action list.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 12-10-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLEGROUP_H_
#define _IPARTICLEGROUP_H_
#include "Max.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PARTICLEGROUP_INTERFACE Interface_ID(0x2c712d9f, 0x7bc54cb0)
#define GetParticleGroupInterface(obj) ((IParticleGroup*)((GetPFObject(obj))->GetInterface(PARTICLEGROUP_INTERFACE)))
class IParticleGroup : public FPMixinInterface
{
public:
/** @defgroup IParticleGroup IParticleGroup.h
* @{
*/
/*! \fn virtual INode* GetParticleSystem() const = 0;
\brief get a master particle system for the particle group
*/
virtual INode* GetParticleSystem() const = 0;
/*! \fn virtual void SetParticleSystem(INode* pSystem) = 0;
\brief set a reference on a master particle system
*/
virtual void SetParticleSystem(INode* pSystem) = 0;
/*! \fn virtualINode* GetActionList() const = 0;
\brief get a master action list for the particle group
*/
virtual INode* GetActionList() const = 0;
/*! \fn virtual void SetActionList(INode* aList) = 0;
\brief set a reference on a master action list
*/
virtual void SetActionList(INode* aList) = 0;
/*! \fn virtual int GetActiveStatus() const = 0;
\brief get activity status of the group; the group can be put into "idle" mode
// if returns zero then the group is in the "idle" mode
*/
virtual int GetActiveStatus() const = 0;
/*! \fn virtual void SetActiveStatus(int status) = 0;
\brief set activity status of the group
*/
virtual void SetActiveStatus(int status) = 0;
/*! \fn virtual int UpdateActiveStatus() = 0;
\brief updates activity status of the group taking into consideration
schematics of the master particle system and master action list
if the group is "fertile" but the master particle system does not
have direct association with the master action list then the group
is put into "idle" mode
returns activity status to be set
*/
virtual int UpdateActiveStatus() = 0;
/*! \fn virtual void UpdateActionSet() = 0;
\brief updates set of actions in the particle group
the set is composed from global actions from the master particle system and
local actions from the associated master actionList
*/
virtual void UpdateActionSet() = 0;
/*! \fn virtual Mtl* GetMaterial() const = 0;
\brief get material from the list of actions
the last action that has a material is the one
*/
virtual Mtl* GetMaterial() const = 0;
/*! \fn virtual DWORD GetWireColor() const = 0;
\brief get wire color from the list of actions
the last action that has a PFViewport interface is the one
*/
virtual DWORD GetWireColor() const = 0;
/*! \fn virtual IObject* GetParticleContainer() const = 0;
\brief get a particle container for the particle group
*/
virtual IObject* GetParticleContainer() const = 0;
/*! \fn virtual const Interval& GetValidityInterval() const = 0;
\brief get validity interval for the particle group
*/
virtual const Interval& GetValidityInterval() const = 0;
/*! \fn virtual void SetValidityInterval(Interval& validInterval) = 0;
\brief set validity interval for the particle group
*/
virtual void SetValidityInterval(Interval& validInterval) = 0;
/*! \fn virtual void Init(TimeValue time) = 0;
\brief set initial state for the particle group with time
*/
virtual void Init(TimeValue time) = 0;
/*! \fn virtual TimeValue GetFertilityTime() = 0;
\brief returns fertility time of the particle group: the first time moment
when the particle group can generate particles from scratch
if the group is not active then it is not "fertile"
*/
virtual TimeValue GetFertilityTime() = 0;
/*! \fn virtual bool Update(TimeValue t) = 0;
\brief advance particles in the group to the given time
*/
virtual bool Update(TimeValue t) = 0;
/*! \fn virtual bool PreUpdate(TimeValue t) = 0;
\brief the following method allows to apply the actions Proceed method as a pre procedure before
any modification to the particle container has been made. It is not recommended to change
the particle container in this method. It is mostly to inquiring particle properties.
*/
virtual bool PreUpdate(TimeValue t) = 0;
/*! \fn virtual bool PostUpdate(TimeValue t) = 0;
\brief the following method allows to apply the actions Proceed method as a post procedure when the
amount of particles in all particle groups has been established and there won't be any
particle transfers from one particle group to another
*/
virtual bool PostUpdate(TimeValue t) = 0;
/*! \fn virtual bool TransferSurplusContainer(IObject*& pCont, INode*& actionListTo) = 0;
\brief returns a ptr at particleContainer to be transferred to another Event
the particle group looses this ptr completely
if the group doesn't have surplus containers then it returns false
*/
virtual bool TransferSurplusContainer(IObject*& pCont, INode*& actionListTo) = 0;
/*! \fn virtual bool AppendSurplusContainer(IObject* pCont) = 0;
\brief appends the given container to the container of the group but first
the given container is advanced in time to be in sync with the container of the group
*/
virtual bool AppendSurplusContainer(IObject* pCont) = 0;
/*! \fn virtual bool IsSync(TimeValue& time) = 0;
\brief returns true if content of the particle group is synchronized in time
if group is in "sync" then it doesn't have surplus containers
if false then the method returns the closest sync time for the particle group
it could be a time of the closest cache moment. The closest time is always
smaller (earlier) then the request time.
*/
virtual bool IsSync(TimeValue& time) = 0;
/*! \fn virtual bool InstantUpdate(TimeValue t) = 0;
\brief set particles in the group to the given time
it should not involve any history dependent operations
if the method is called it implies that the group is able to make
an instant jump to the given time thus there is a cache for that time
*/
virtual bool InstantUpdate(TimeValue t) = 0;
/*! \fn virtual bool SetFinalUpdateTime(TimeValue t) = 0;
\brief inform the group what would be a final time for the series of update calls
*/
virtual bool SetFinalUpdateTime(TimeValue t) = 0;
/*! \fn virtual void SetHandle(ULONG handle) = 0;
\brief Informs the particle group about the handle of the particle group node
the handle is later used to uniquely identify particle container for cache purposes
*/
virtual void SetHandle(ULONG handle) = 0;
/*! \fn virtual void InvalidateContainer(int type=invalidateCurrent) = 0;
\brief clear particle content in the particle group
then enum should be in sync with IPFCache
*/
enum { invalidateCurrent=0, invalidateViewport=1, invalidateRender=2, invalidateBoth=3};
virtual void InvalidateContainer(int type=invalidateCurrent) = 0;
/*! \fn virtual void InvalidateCaches(int type=invalidateCurrent) = 0;
\brief clear caches in the particle group
*/
virtual void InvalidateCaches(int type=invalidateCurrent) = 0;
/*! \fn virtual bool HasDelayedInvalidation() const = 0;
\brief in normal circumstances when a particle group receives a change notification message from
the encapsulated operator/test the particle group should invalidate itself. However if
the particle system is in the stage of proceeding then it is not possible to invalidate
particle group right away. The particle group can know the status of the particle system
by using global IsPFProceeding method (IPViewManager.h). Then if the system has the proceed
status then the particle group should delay the invalidation.
*/
virtual bool HasDelayedInvalidation() const = 0;
/*! \fn virtual bool DoDelayedInvalidation() = 0;
\brief check if the group has a delayed invalidation
*/
virtual bool DoDelayedInvalidation() = 0;
/*! \fn virtual void InvalidateActions() = 0;
\brief Particle Group stores pointers at IPFAction interfaces for efficiency. Those pointers
are maintained automatically. In some circumstances (during Replace) it is necessary to flush
those interfaces because they may become invalid.
*/
virtual void InvalidateActions() = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLEGROUP_INTERFACE); }
\brief perform invalidation that was delayed
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLEGROUP_INTERFACE); }
};
inline IParticleGroup* ParticleGroupInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetParticleGroupInterface(obj));
};
inline IParticleGroup* ParticleGroupInterface(INode* node) {
return ((node == NULL) ? NULL : ParticleGroupInterface(node->GetObjectRef()));
};
#endif // _IPARTICLEGROUP_H_

View File

@ -0,0 +1,57 @@
/*! \file OneClickCreateCallBack.h
\brief MouseCreateCallBack for objects that doesn't have
3D attributes and therefore could be created with
just one click. The callback is used by
SimpleOperator and SimpleTest classes. The class
has Singleton Pattern.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-25-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _ONECLICKCREATECALLBACK_H_
#define _ONECLICKCREATECALLBACK_H_
#include "max.h"
#include "PFExport.h"
class OneClickCreateCallBack : public CreateMouseCallBack {
public:
/** @defgroup OneClickCreateCallBack OneClickCreateCallBack.h
* @{
*/
/*! \fn PFExport static OneClickCreateCallBack* Instance();
* \brief
*/
PFExport static OneClickCreateCallBack* Instance();
/*! \fn PFExport static void DeleteThis();
* \brief
*/
PFExport static void DeleteThis();
/*! \fn PFExport int proc( ViewExp *vpt,int msg, int point, int flags, IPoint2 m, Matrix3& mat);
* \brief
*/
PFExport int proc( ViewExp *vpt,int msg, int point, int flags, IPoint2 m, Matrix3& mat);
/*@}*/
protected:
OneClickCreateCallBack();
static const OneClickCreateCallBack* instance() { return m_instance; }
static OneClickCreateCallBack*& _instance() { return m_instance; }
private:
static OneClickCreateCallBack* m_instance;
};
#endif // _ONECLICKCREATECALLBACK_H_

View File

@ -0,0 +1,33 @@
/*! \file PFActionStateDesc.h
\brief Class Descriptor for PF ActionState objects (declaration)
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 28-10-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _PFACTIONSTATEDESC_H_
#define _PFACTIONSTATEDESC_H_
#include "max.h"
#include "iparamb2.h"
#include "PFExport.h"
// ActionState-generic Descriptor declarations
class PFActionStateDesc: public ClassDesc2 {
public:
PFExport virtual int IsPublic();
virtual void* Create(BOOL loading = FALSE) = 0;
PFExport virtual const TCHAR * ClassName();
PFExport virtual SClass_ID SuperClassID();
PFExport virtual Class_ID SubClassID();
virtual Class_ID ClassID() = 0;
PFExport const TCHAR* Category();
virtual const TCHAR* InternalName() = 0;
};
#endif // _PFACTIONSTATEDESC_H_

View File

@ -0,0 +1,196 @@
/*! \file PFClassIDs.h
\brief Class and SubClass IDs for PF objects and actions.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-23-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _PFCLASSIDS_H_
#define _PFCLASSIDS_H_
#include "plugapi.h"
//==================================================================================//
// PF SubClass IDs //
//==================================================================================//
#define PFSubClassID_PartB PF_SUBCLASS_ID_PARTB
// for classes that should not be directly creatable by maxscript
#define PFSubClassID_PartB_MXS_NonCreatable PF_SUBCLASS_ID_PARTB+1
// SubClassID to identify PF Engine plug-ins
#define PFEngineSubClassID Class_ID(0x74f93a00, PFSubClassID_PartB_MXS_NonCreatable)
// SubClassID to identify particle channel plug-ins
#define ParticleChannelSubClassID Class_ID(0x74f93a01, PFSubClassID_PartB_MXS_NonCreatable)
// SubClassID to identify PF Operator plug-ins that don't have 3D representation (icon)
#define PFOperatorSubClassID Class_ID(PF_OPERATOR_SUBCLASS_ID, PFSubClassID_PartB)
// SubClassID to identify PF Operator plug-ins that have 3D representation (icon)
#define PFOperator3DSubClassID Class_ID(PF_OPERATOR3D_SUBCLASS_ID, PFSubClassID_PartB)
// SubClassID to identify PF Test plug-ins that don't have 3D representation (icon)
#define PFTestSubClassID Class_ID(PF_TEST_SUBCLASS_ID, PFSubClassID_PartB)
// SubClassID to identify PF Test plug-ins that have 3D representation (icon)
#define PFTest3DSubClassID Class_ID(PF_TEST3D_SUBCLASS_ID, PFSubClassID_PartB)
// SubClassID to identify misc PF classes that don't have 3D representation (icon)
#define PFItemSubClassID Class_ID(PF_ITEM_SUBCLASS_ID, PFSubClassID_PartB)
#define PFItemSubClassID_MXS_NonCreatable Class_ID(PF_ITEM_SUBCLASS_ID, PFSubClassID_PartB_MXS_NonCreatable)
// SubClassID to identify misc PF classes that have 3D representation (icon or else)
#define PFObjectSubClassID Class_ID(PF_OBJECT_SUBCLASS_ID, PFSubClassID_PartB)
#define PFObjectSubClassID_MXS_NonCreatable Class_ID(PF_OBJECT_SUBCLASS_ID, PFSubClassID_PartB_MXS_NonCreatable)
// SubClassID to identify classes that represent particle system icons (like ParticleFlow shell)
#define PFSystemSubClassID Class_ID(0x74f93a08, PFSubClassID_PartB)
// SubClassID to identify classes to store action state
#define PFActionStateSubClassID Class_ID(0x74f93a09, PFSubClassID_PartB_MXS_NonCreatable)
// SubClassID to identify classes to store particle container
#define ParticleContainerSubClassID Class_ID(0x74f93a0a, PFSubClassID_PartB_MXS_NonCreatable)
// SubClassID to identify misc PF classes that have their own initialization in PView
#define PViewItemSubClassID Class_ID(0x74f93a0b, PFSubClassID_PartB_MXS_NonCreatable)
//==================================================================================//
// Standard Particle Channels //
//==================================================================================//
#define ParticleChannelClassID_PartB 0x1eb34100
#define ParticleChannelNew_Class_ID Class_ID(0x74f93b01, ParticleChannelClassID_PartB)
#define ParticleChannelID_Class_ID Class_ID(0x74f93b02, ParticleChannelClassID_PartB)
#define ParticleChannelBool_Class_ID Class_ID(0x74f93b03, ParticleChannelClassID_PartB)
#define ParticleChannelInt_Class_ID Class_ID(0x74f93b04, ParticleChannelClassID_PartB)
#define ParticleChannelFloat_Class_ID Class_ID(0x74f93b05, ParticleChannelClassID_PartB)
#define ParticleChannelPoint2_Class_ID Class_ID(0x74f93b06, ParticleChannelClassID_PartB)// NIY
#define ParticleChannelPoint3_Class_ID Class_ID(0x74f93b07, ParticleChannelClassID_PartB)
#define ParticleChannelPTV_Class_ID Class_ID(0x74f93b08, ParticleChannelClassID_PartB)
#define ParticleChannelInterval_Class_ID Class_ID(0x74f93b09, ParticleChannelClassID_PartB)// NIY
#define ParticleChannelAngAxis_Class_ID Class_ID(0x74f93b0a, ParticleChannelClassID_PartB)
#define ParticleChannelQuat_Class_ID Class_ID(0x74f93b0b, ParticleChannelClassID_PartB)
#define ParticleChannelMatrix3_Class_ID Class_ID(0x74f93b0c, ParticleChannelClassID_PartB)
#define ParticleChannelMesh_Class_ID Class_ID(0x74f93b0d, ParticleChannelClassID_PartB)
#define ParticleChannelMeshMap_Class_ID Class_ID(0x74f93b0e, ParticleChannelClassID_PartB)
#define ParticleChannelINode_Class_ID Class_ID(0x74f93b0f, ParticleChannelClassID_PartB)
#define ParticleChannelTabPoint3_Class_ID Class_ID(0x74f93b10, ParticleChannelClassID_PartB)// NIY
#define ParticleChannelTabFace_Class_ID Class_ID(0x74f93b11, ParticleChannelClassID_PartB)// NIY
#define ParticleChannelTabUVVert_Class_ID Class_ID(0x74f93b12, ParticleChannelClassID_PartB)
#define ParticleChannelTabTVFace_Class_ID Class_ID(0x74f93b13, ParticleChannelClassID_PartB)
#define ParticleChannelMap_Class_ID Class_ID(0x74f93b14, ParticleChannelClassID_PartB)
#define ParticleChannelVoid_Class_ID Class_ID(0x74f93b15, ParticleChannelClassID_PartB)
//==================================================================================//
// Standard PF Actions //
//==================================================================================//
#define PFActionClassID_PartB 0x1eb34200
//----------------------------------------------------------------------------------//
// Standard PF Operators //
#define PFOperatorViewportRender_Class_ID Class_ID(0x74f93b01, PFActionClassID_PartB)// retired - Oleg
#define PFOperatorDisplay_Class_ID Class_ID(0x74f93b02, PFActionClassID_PartB)// Oleg
#define PFOperatorRender_Class_ID Class_ID(0x74f93b03, PFActionClassID_PartB)// Oleg
#define PFOperatorViewportMetaball_Class_ID Class_ID(0x74f93b04, PFActionClassID_PartB)// NIY
#define PFOperatorRenderMetaball_Class_ID Class_ID(0x74f93b05, PFActionClassID_PartB)// NIY
#define PFOperatorSimpleBirth_Class_ID Class_ID(0x74f93b06, PFActionClassID_PartB)// Andy
#define PFOperatorSimplePosition_Class_ID Class_ID(0x74f93b07, PFActionClassID_PartB)// Andy
#define PFOperatorSimpleSpeed_Class_ID Class_ID(0x74f93b08, PFActionClassID_PartB)// DavidT
#define PFOperatorSimpleOrientation_Class_ID Class_ID(0x74f93b09, PFActionClassID_PartB)// DavidT
#define PFOperatorSimpleSpin_Class_ID Class_ID(0x74f93b0a, PFActionClassID_PartB)// DavidT
#define PFOperatorSimpleShape_Class_ID Class_ID(0x74f93b0b, PFActionClassID_PartB)// Andy
#define PFOperatorSimpleScale_Class_ID Class_ID(0x74f93b0c, PFActionClassID_PartB)// DavidT
#define PFOperatorSimpleMapping_Class_ID Class_ID(0x74f93b0d, PFActionClassID_PartB)// Oleg
#define PFOperatorMaterial_Class_ID Class_ID(0x74f93b0e, PFActionClassID_PartB)// retired - Oleg
#define PFOperatorInstanceShape_Class_ID Class_ID(0x74f93b0f, PFActionClassID_PartB)// Andy
#define PFOperatorMarkShape_Class_ID Class_ID(0x74f93b10, PFActionClassID_PartB)// Andy
#define PFOperatorFacingShape_Class_ID Class_ID(0x74f93b11, PFActionClassID_PartB)// Andy
#define PFOperatorMetaballShape_Class_ID Class_ID(0x74f93b12, PFActionClassID_PartB)// NIY
#define PFOperatorFragmentShape_Class_ID Class_ID(0x74f93b13, PFActionClassID_PartB)// NIY
#define PFOperatorLongShape_Class_ID Class_ID(0x74f93b14, PFActionClassID_PartB)// NIY
#define PFOperatorExit_Class_ID Class_ID(0x74f93b15, PFActionClassID_PartB)// Andy
#define PFOperatorForceSpaceWarp_Class_ID Class_ID(0x74f93b16, PFActionClassID_PartB)// Watje
#define PFOperatorPositionOnObject_Class_ID Class_ID(0x74f93b17, PFActionClassID_PartB)// Oleg
#define PFOperatorPositionAgglomeration_Class_ID Class_ID(0x74f93b18, PFActionClassID_PartB)// NIY
#define PFOperatorSpeedAvoidCollisions_Class_ID Class_ID(0x74f93b19, PFActionClassID_PartB)// NIY
#define PFOperatorSpeedCopy_Class_ID Class_ID(0x74f93b1a, PFActionClassID_PartB)// Oleg
#define PFOperatorSpeedFollowLeader_Class_ID Class_ID(0x74f93b1b, PFActionClassID_PartB)// NIY
#define PFOperatorSpeedKeepApart_Class_ID Class_ID(0x74f93b1c, PFActionClassID_PartB)// Oleg
#define PFOperatorSpeedSurfaceNormals_Class_ID Class_ID(0x74f93b1d, PFActionClassID_PartB)// Oleg
#define PFOperatorOrientationFollowPath_Class_ID Class_ID(0x74f93b1e, PFActionClassID_PartB)// NIY
#define PFOperatorOrientationFacing_Class_ID Class_ID(0x74f93b1f, PFActionClassID_PartB)// NIY
#define PFOperatorSpinBySpeed_Class_ID Class_ID(0x74f93b20, PFActionClassID_PartB)// NIY
#define PFOperatorBirthByObjectGroup_Class_ID Class_ID(0x74f93b21, PFActionClassID_PartB)// NIY
#define PFOperatorScriptBirth_Class_ID Class_ID(0x74f93b22, PFActionClassID_PartB)// Oleg
#define PFOperatorScript_Class_ID Class_ID(0x74f93b23, PFActionClassID_PartB)// Oleg
#define PFOperatorComments_Class_ID Class_ID(0x74f93b24, PFActionClassID_PartB)// Oleg
#define PFOperatorCache_Class_ID Class_ID(0x74f93b25, PFActionClassID_PartB)// Oleg
#define PFOperatorMaterialStatic_Class_ID Class_ID(0x74f93b26, PFActionClassID_PartB)// Oleg
#define PFOperatorMaterialDynamic_Class_ID Class_ID(0x74f93b27, PFActionClassID_PartB)// Oleg
#define PFOperatorMaterialFrequency_Class_ID Class_ID(0x74f93b28, PFActionClassID_PartB)// Oleg
//----------------------------------------------------------------------------------//
// Standard PF Tests and Test Operators //
#define PFTestDuration_Class_ID Class_ID(0x74f93c01, PFActionClassID_PartB)// Oleg
#define PFTestSpawn_Class_ID Class_ID(0x74f93c02, PFActionClassID_PartB)// Oleg
#define PFTestCollisionSpaceWarp_Class_ID Class_ID(0x74f93c03, PFActionClassID_PartB)// Watje
#define PFTestSpawnCollisionSW_Class_ID Class_ID(0x74f93c04, PFActionClassID_PartB)// Oleg
#define PFTestSpeed_Class_ID Class_ID(0x74f93c05, PFActionClassID_PartB)// Oleg
#define PFTestSpeedGoToTarget_Class_ID Class_ID(0x74f93c06, PFActionClassID_PartB)// Oleg
#define PFTestScale_Class_ID Class_ID(0x74f93c07, PFActionClassID_PartB)// Oleg
#define PFTestProximity_Class_ID Class_ID(0x74f93c08, PFActionClassID_PartB)// NIY
#define PFTestScript_Class_ID Class_ID(0x74f93c09, PFActionClassID_PartB)// Oleg
#define PFTestGoToNextEvent_Class_ID Class_ID(0x74f93c0a, PFActionClassID_PartB)// Oleg
#define PFTestSplitByAmount_Class_ID Class_ID(0x74f93c0b, PFActionClassID_PartB)// Oleg
#define PFTestSplitBySource_Class_ID Class_ID(0x74f93c0c, PFActionClassID_PartB)// Oleg
#define PFTestSplitSelected_Class_ID Class_ID(0x74f93c0d, PFActionClassID_PartB)// Oleg
#define PFTestGoToRotation_Class_ID Class_ID(0x74f93c0e, PFActionClassID_PartB)// Oleg
//==================================================================================//
// PF Actors //
//==================================================================================//
#define PFActorClassID_PartB 0x1eb34300
#define PFEngine_Class_ID Class_ID(0x74f93b01, PFActorClassID_PartB)
#define ParticleGroup_Class_ID Class_ID(0x74f93b02, PFActorClassID_PartB)
#define PFActionList_Class_ID Class_ID(0x74f93b03, PFActorClassID_PartB)
#define PFArrow_Class_ID Class_ID(0x74f93b04, PFActorClassID_PartB)
#define PFIntegrator_Class_ID Class_ID(0x74f93b05, PFActorClassID_PartB)
#define PViewManager_Class_ID Class_ID(0x74f93b06, PFActorClassID_PartB)
#define ParticleView_Class_ID Class_ID(0x74f93b07, PFActorClassID_PartB)
#define PFActionListPool_Class_ID Class_ID(0x74f93b08, PFActorClassID_PartB)
#define PFSystemPool_Class_ID Class_ID(0x74f93b09, PFActorClassID_PartB)
#define PFSimpleActionState_Class_ID Class_ID(0x74f93b0a, PFActorClassID_PartB)
#define ParticleContainer_Class_ID Class_ID(0x74f93b0b, PFActorClassID_PartB)
#define PFNotifyDepCatcher_Class_ID Class_ID(0x74f93b0c, PFActorClassID_PartB)
//==================================================================================//
// PF Materials //
//==================================================================================//
#define PFMaterialClassID_PartB 0x1eb34400
#define ParticleBitmap_Class_ID Class_ID(0x74f93d01, PFMaterialClassID_PartB)
//==================================================================================//
// PF Color Scheme //
//==================================================================================//
#define PFSourceGizmoColorId 0x13597ec7
#define pfSourceGizmoColor RGB(243,180,97)
#define PFOperatorGizmoColorId 0x204449b5
#define pfOperatorGizmoColor RGB(68,115,149)
#define PFTestGizmoColorId 0x0be30545
#define pfTestGizmoColor RGB(253,229,55)
#define PFSubselectionColorId 0x35350e4
#define pfSubselectionColor RGB(255, 0, 0)
#endif // _PFCLASSIDS_H_

View File

@ -0,0 +1,28 @@
/*! \file PFExport.h
\brief defines preprocessor switch for PF.dll
and client application
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 9-28-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _PFEXPORT_H_
#define _PFEXPORT_H_
#ifndef PF_EXPORTS
#define PFExport __declspec( dllimport )
#else
#define PFExport __declspec( dllexport )
#endif
#endif // _PFEXPORT_H_

View File

@ -0,0 +1,156 @@
/*! \file PFMessages.h
\brief list of REFMSG_USER type messages for PF communications
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 12-19-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _PFMESSAGES_H_
#define _PFMESSAGES_H_
#include "PreciseTimeValue.h"
// PF notification messages
enum { kPFMSG_UpdateToTime = REFMSG_USER + 4878, // x1130E
kPFMSG_HasSurplus, // x1130F
kPFMSG_PFShellWiringChanged, // x11310
kPFMSG_ActionListWiringChanged, // x11311
kPFMSG_GetNextActionList, // x11312
kPFMSG_GetNumParticles, // x11313
kPFMSG_GetNumParticlesGenerated, // x11314
kPFMSG_GetUpdateTime,
kPFMSG_GetUpdateInterval,
kPFMSG_GetParticleBornIndex,
kPFMSG_GetParticleIndex,
kPFMSG_GetParticleGroup,
kPFMSG_GetParticleTime,
kPFMSG_SetParticleTime,
kPFMSG_GetParticleAge,
kPFMSG_SetParticleAge,
kPFMSG_GetParticleLifeSpan,
kPFMSG_SetParticleLifeSpan,
kPFMSG_GetParticleEventTime,
kPFMSG_SetParticleEventTime,
kPFMSG_GetParticlePosition,
kPFMSG_SetParticlePosition,
kPFMSG_GetParticleSpeed,
kPFMSG_SetParticleSpeed,
kPFMSG_GetParticleOrientation,
kPFMSG_SetParticleOrientation,
kPFMSG_GetParticleSpin,
kPFMSG_SetParticleSpin,
kPFMSG_GetParticleScale,
kPFMSG_SetParticleScale,
kPFMSG_GetParticleSelected,
kPFMSG_SetParticleSelected,
kPFMSG_GetParticleShape,
kPFMSG_SetParticleShape,
kPFMSG_SetParticleGlobalShape,
kPFMSG_UpdateMaterial,
kPFMSG_ActionListContentChanged,
kPFMSG_OpenParticleView,
kPFMSG_IsDownStream,
kPFMSG_UpdateTypeChanged,
kPFMSG_InvalidateParticles,
kPFMSG_InvalidateViewportParticles,
kPFMSG_InvalidateRenderParticles,
kPFMSG_GetSubObjectCentersRequest,
kPFMSG_GetSubObjectTMsRequest,
kPFMSG_HitTestRequest,
kPFMSG_GetBoundBoxRequest,
kPFMSG_GetNumParticlesActionList,
kPFMSG_GetParticleBornIndexActionList,
kPFMSG_UpdateWireColor,
kPFMSG_GetNodeValue,
kPFMSG_HasUpStreamActionList,
kPFMSG_IsActionActive,
kPFMSG_GetParentActionList,
kPFMSG_PreDeleteNode,
kPFMSG_GetNumParticlesInParticleGroup,
kPFMSG_InvalidateDownStream,
kPFMSG_ActionListActivityChanged,
kPFMSG_SyncRenderState,
kPFMSG_CheckEscape,
kPFMSG_DynamicNameChange,
kPFMSG_ConfirmNotifyCatcherPresence,
kPFMSG_cacheUpdateStart,
kPFMSG_cacheUpdateFinish
};
struct GetSubObjectRequestData {
SubObjAxisCallback* cb;
TimeValue t;
INode* node;
ModContext* mc;
};
struct HitTestRequestData {
TimeValue t;
INode* inode;
int type;
int crossing;
int flags;
IPoint2* p;
ViewExp* vpt;
ModContext* mc;
int hitResult;
};
struct GetBoundBoxRequestData {
TimeValue t;
INode* inode;
ViewExp* vp;
Box3* box;
};
struct GetParticleDataRequest {
int index;
union {
int count;
int bornIndex;
INode* pGroup;
PreciseTimeValue* time;
PreciseTimeValue* age;
PreciseTimeValue* lifeSpan;
PreciseTimeValue* eventTime;
Point3* position;
Point3* speed;
Point3* acceleration;
Quat* orientation;
AngAxis* spin;
Point3* scale;
bool selected;
Mesh* shape;
};
};
struct GetTimeDataRequest {
TimeValue time;
TimeValue start;
TimeValue finish;
};
// the class is used to identify particle group
// and action list the hit particle belongs to
class PFHitData : public HitData {
public:
INode* particleGroupNode;
INode* actionListNode;
PFHitData() { particleGroupNode = NULL; actionListNode = NULL; }
PFHitData(INode* pgroup, INode* alist) { particleGroupNode = pgroup; actionListNode = alist; }
};
// the class is used to retrieve activity status
// of an action item and its parent action list
struct PFActiveActionDataRequest {
INode* actionNode;
int active;
FPMixinInterface* iActionList;
};
#endif // _PFMESSAGES_H_

View File

@ -0,0 +1,167 @@
/*! \file PFSimpleAction.h
\brief PF SimpleAction (abstract class) header
Features that are common for a simplest form of
PF Action. SimpleAction doesn't have a
visual representation in viewports therefore it
cannot depend on its own icon to determine parameters
of the operation. All parameters are defined through
ParamBlock2
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 05-28-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _PFSIMPLEACTION_H_
#define _PFSIMPLEACTION_H_
#include "max.h"
#include "iparamb2.h"
#include "PFExport.h"
#include "IPFAction.h"
#include "IPViewItem.h"
#include "IPFIntegrator.h"
#include "IPFSystem.h"
#include "OneClickCreateCallBack.h"
#include "PFClassIDs.h"
#include "IPViewManager.h"
#include "RandObjLinker.h"
class PFSimpleAction: public HelperObject,
public IPFAction,
public IPViewItem
{
public:
PFExport virtual ~PFSimpleAction();
// From InterfaceServer
PFExport virtual BaseInterface* GetInterface(Interface_ID id);
// From Animatable
PFExport virtual void DeleteThis();
virtual int NumSubs() { return 1; } // the paramBlock
PFExport virtual Animatable* SubAnim(int i);
PFExport virtual TSTR SubAnimName(int i);
PFExport BOOL SelectSubAnim(int subNum);
PFExport virtual ParamDimension* GetParamDimension(int i);
PFExport virtual int SubNumToRefNum(int subNum);
virtual BOOL CanCopyAnim() { return FALSE; }
PFExport virtual int HasSubElements(int type);
virtual BOOL CanDeleteSubAnim(int i) { return FALSE; }
virtual BOOL IsAnimated() { return _pblock()->IsAnimated(); }
virtual void FreeCaches() { ; }
virtual int NumParamBlocks() { return 1; } // the paramBlock
PFExport virtual IParamBlock2* GetParamBlock(int i);
PFExport virtual IParamBlock2* GetParamBlockByID(short id);
// From ReferenceMaker
virtual int NumRefs() { return 1; }
PFExport virtual RefTargetHandle GetReference(int i);
PFExport virtual void SetReference(int i, RefTargetHandle rtarg);
PFExport virtual RefResult NotifyRefChanged(Interval changeInt,RefTargetHandle hTarget,PartID& partID, RefMessage message);
PFExport virtual int RemapRefOnLoad(int iref);
PFExport virtual IOResult Save(ISave *isave);
PFExport virtual IOResult Load(ILoad *iload);
// From BaseObject
virtual CreateMouseCallBack* GetCreateMouseCallBack() { return OneClickCreateCallBack::Instance(); }
virtual BOOL OKToChangeTopology(TSTR &modName) { return FALSE; }
// From Object
virtual void InitNodeName(TSTR& s) { s = GetObjectName(); }
virtual ObjectState Eval(TimeValue t) { return ObjectState(this); }
// --- These methods MUST be implemented by the derived class --- //
// --- These methods have a default virtual implementation to --- //
// --- ease PFExport implementation of Clone(...) method --- //
// constructor: inherited as a base class constructor
PFSimpleAction()
{
_pblock() = NULL;
RegisterParticleFlowNotification();
}
// implement it like this
// {
// GetClassDesc()->MakeAutoParamBlocks(this);
// }
//
// From Animatable
virtual void GetClassName(TSTR& s) { ; }
virtual Class_ID ClassID() { return Class_ID(0,0); }
virtual void BeginEditParams(IObjParam *ip,ULONG flags,Animatable *prev) = 0;
// implement it like this
// {
// GetClassDesc()->BeginEditParams(ip, this, flags, prev);
// }
virtual void EndEditParams(IObjParam *ip, ULONG flags,Animatable *next) = 0;
// {
// GetClassDesc()->EndEditParams(ip, this, flags, next );
// }
// From ReferenceTarget
virtual RefTargetHandle Clone(RemapDir &remap) = 0;
// implement it like this
// {
// PFOperatorXXX* newOp = new PFOperatorXXX();
// newOp->SetReference(0, pblock()->Clone(remap));
// return newOp;
// }
// From BaseObject
virtual TCHAR *GetObjectName() = 0;
// From IPFAction interface
PFExport virtual bool Init(IObject* pCont, Object* pSystem, INode* node, Tab<Object*>& actions, Tab<INode*>& actionNodes);
PFExport virtual bool Release(IObject* pCont);
// SimpleOperator doesn't support randomness
// If you need randomness for the operator please override
// the following four methods
virtual bool SupportRand() const { return false; }
virtual int GetRand() { return 0; }
virtual void SetRand(int seed) { ; }
PFExport virtual int NewRand();
virtual const ParticleChannelMask& ChannelsUsed(const Interval& time) const = 0;
virtual const Interval ActivityInterval() const = 0;
PFExport virtual IObject* GetCurrentState(IObject* pContainer);
PFExport virtual void SetCurrentState(IObject* actionState, IObject* pContainer);
// From IPViewItem interface
virtual int NumPViewParamBlocks() const { return 1; } // the paramBlock
PFExport virtual IParamBlock2* GetPViewParamBlock(int i) const;
// supply ClassDesc descriptor for the concrete implementation of the operator
virtual ClassDesc* GetClassDesc() const = 0;
public:
PFExport void RefreshUI(WPARAM message, IParamMap2* map=NULL) const;
PFExport void UpdatePViewUI(int updateID) const;
// const access to class members
IParamBlock2* pblock() const { return m_pblock; }
const RandObjLinker& randLinker() const { return m_randLinker; }
// access to class members
IParamBlock2*& _pblock() { return m_pblock; }
RandObjLinker& _randLinker() { return m_randLinker; }
protected:
// parameters
IParamBlock2* m_pblock;
// to keep track of client particle systems
// the test may serve several particle systems at once
// each particle system has its own randomization scheme
RandObjLinker m_randLinker;
};
#endif // _PFSIMPLEACTION_H_

View File

@ -0,0 +1,58 @@
/*! \file PFSimpleActionState.h
\brief Implementation of ActionState that has only a single
random generator.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-25-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _PFSIMPLEACTIONSTATE_H_
#define _PFSIMPLEACTIONSTATE_H_
#include "max.h"
#include "PFExport.h"
#include "RandGenerator.h"
#include "IPFActionState.h"
#include "PFClassIDs.h"
class PFSimpleActionState: public IObject,
public IPFActionState
{
public:
// from IObject interface
int NumInterfaces() const { return 1; }
BaseInterface* GetInterfaceAt(int index) const { return ((index == 0) ? (IPFActionState*)this : NULL); }
BaseInterface* GetInterface(Interface_ID id);
void DeleteIObject();
// From IPFActionState
Class_ID GetClassID() { return PFSimpleActionState_Class_ID; }
ULONG GetActionHandle() const { return actionHandle(); }
void SetActionHandle(ULONG handle) { _actionHandle() = handle; }
IOResult Save(ISave* isave) const;
IOResult Load(ILoad* iload);
public:
// const access to class members
const RandGenerator* randGen() const { return &m_randGen; }
// access to class members
RandGenerator* _randGen() { return &m_randGen; }
protected:
// const access to class members
ULONG actionHandle() const { return m_actionHandle; }
// access to class members
ULONG& _actionHandle() { return m_actionHandle; }
private:
ULONG m_actionHandle;
RandGenerator m_randGen;
};
#endif // _PFSIMPLEACTIONSTATE_H_

View File

@ -0,0 +1,60 @@
/*! \file PFSimpleOperator.h
\brief PF SimpleOperator (abstract class) header
Features that are common for a simplest form of
PF Operator. SimpleOperator doesn't have a
visual representation in viewports therefore it
cannot depend on its own icon to determine parameters
of the operation. All parameters are defined through
ParamBlock2
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-23-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _PFSIMPLEOPERATOR_H_
#define _PFSIMPLEOPERATOR_H_
#include "max.h"
#include "iparamb2.h"
#include "PFSimpleAction.h"
#include "IPFOperator.h"
class PFSimpleOperator: public PFSimpleAction,
public IPFOperator
{
public:
// constructor: inherited as a base class constructor
PFSimpleOperator() { _activeIcon() = _inactiveIcon() = NULL; }
PFExport virtual ~PFSimpleOperator();
// From InterfaceServer
PFExport virtual BaseInterface* GetInterface(Interface_ID id);
// --- These methods MUST be implemented by the derived class --- //
// --- These methods have a default virtual implementation to --- //
// --- ease PFExport implementation of Clone(...) method --- //
// From IPFOperator interface
virtual bool Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd, Object* pSystem, INode* node, IObject* integrator) { return false; }
protected:
// const access to class members
HBITMAP activeIcon() const { return m_activeIcon; }
HBITMAP inactiveIcon() const { return m_inactiveIcon; }
// access to class members
HBITMAP& _activeIcon() { return m_activeIcon; }
HBITMAP& _inactiveIcon() { return m_inactiveIcon; }
private:
HBITMAP m_activeIcon;
HBITMAP m_inactiveIcon;
};
#endif // _PFSIMPLEOPERATOR_H_

View File

@ -0,0 +1,103 @@
/*! \file PFSimpleTest.h
\brief PF SimpleTest (abstract class) header.
Features that are common for a simplest form of
PF Test. SimpleTest doesn't have a
visual representation in viewports therefore it
cannot depend on its own icon to determine parameters
of the operation. All parameters are defined through
ParamBlock2.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 05-28-2002
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _PFSIMPLETEST_H_
#define _PFSIMPLETEST_H_
#include "max.h"
#include "iparamb2.h"
#include "PFSimpleAction.h"
#include "IPFTest.h"
class PFSimpleTest: public PFSimpleAction,
public IPFTest
{
public:
// constructor: inherited as a base class constructor
PFSimpleTest() { _activeIcon() = _trueIcon() = _falseIcon() = NULL; }
PFExport virtual ~PFSimpleTest();
/** @defgroup PFSimpleTest PFSimpleTest.h
* @{
*/
/*! \fn PFExport virtual BaseInterface* GetInterface(Interface_ID id);
* \brief From InterfaceServer
*/
PFExport virtual BaseInterface* GetInterface(Interface_ID id);
/*! \fn virtual bool Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd, Object* pSystem, INode* pNode, INode* actionNode, IPFIntegrator* integrator, BitArray& testResult, Tab<float>& testTime) { return false; }
* \brief Method must be implemented by the derived class. Has a default virtual implementation to
ease PFExport implementation of Clone(...) method. From IPFTest interface.
*/
virtual bool Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd,
Object* pSystem, INode* pNode, INode* actionNode, IPFIntegrator* integrator,
BitArray& testResult, Tab<float>& testTime) { return false; }
/*! \fn PFExport void ProceedStep1(IObject* pCont, Object* pSystem, INode* pNode, INode* actionNode, FPInterface* integrator);
* \brief Method must be implemented by the derived class. Has a default virtual implementation to
ease PFExport implementation of Clone(...) method.
*/
PFExport void ProceedStep1(IObject* pCont, Object* pSystem, INode* pNode, INode* actionNode, FPInterface* integrator);
/*! \fn PFExport bool ProceedStep2(TimeValue timeStartTick, float timeStartFraction, TimeValue& timeEndTick, float& timeEndFraction, BitArray& testResult, Tab<float>& testTime);
* \brief Method must be implemented by the derived class. Has a default virtual implementation to
ease PFExport implementation of Clone(...) method.
*/
PFExport bool ProceedStep2(TimeValue timeStartTick, float timeStartFraction, TimeValue& timeEndTick, float& timeEndFraction, BitArray& testResult, Tab<float>& testTime);
/*@}*/
protected:
// const access to class members
const IObject* containerFnPub() const { return m_containerFnPub; }
const Object* particleSystemFnPub() const { return m_particleSystemFnPub; }
const INode* particleNodeFnPub() const { return m_particleNodeFnPub; }
const INode* actionNodeFnPub() const { return m_actionNodeFnPub; }
const FPInterface* integratorFnPub() const { return m_integratorFnPub; }
HBITMAP activeIcon() const { return m_activeIcon; }
HBITMAP trueIcon() const { return m_trueIcon; }
HBITMAP falseIcon() const { return m_falseIcon; }
// access to class members
IObject*& _containerFnPub() { return m_containerFnPub; }
Object*& _particleSystemFnPub() { return m_particleSystemFnPub; }
INode*& _particleNodeFnPub() { return m_particleNodeFnPub; }
INode*& _actionNodeFnPub() { return m_actionNodeFnPub; }
FPInterface*& _integratorFnPub() { return m_integratorFnPub; }
HBITMAP& _activeIcon() { return m_activeIcon; }
HBITMAP& _trueIcon() { return m_trueIcon; }
HBITMAP& _falseIcon() { return m_falseIcon; }
private:
// to support FnPub two-step Proceed
IObject* m_containerFnPub;
Object* m_particleSystemFnPub;
INode* m_particleNodeFnPub;
INode* m_actionNodeFnPub;
FPInterface* m_integratorFnPub;
// for custom icons
HBITMAP m_activeIcon;
HBITMAP m_trueIcon;
HBITMAP m_falseIcon;
};
#endif // _PFSIMPLEOPERATOR_H_

View File

@ -0,0 +1,253 @@
/*! \file ParticleChannelMask.h
\brief An interface for ParticleChannelMask.
The interface is used by Operators/Elements to define
what channels are read/write.
The class is implemented by system.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 9-19-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _PARTICLECHANNELMASK_H_
#define _PARTICLECHANNELMASK_H_
#include "Max.h"
#include "PFExport.h"
// all generic particle channel listed (implemented by max)
enum PCU_genericChannelIndex {
PCG_float= 1<<0,
PCG_int= 1<<1,
// PCG_RGBA= 1<<2,
PCG_Point3= 1<<3,
PCG_bool= 1<<4,
// PCG_String= 1<<5,
// PCG_TimeValue= 1<<6,
PCG_PTV= 1<<7, // Precise Time Value
// PCG_TexMap= 1<<8,
PCG_INode= 1<<9,
PCG_Matrix3= 1<<10,
PCG_void= 1<<11,
// PCG_Interval= 1<<12,
PCG_AngAxis= 1<<13,
PCG_Quat= 1<<14,
// PCG_Point2= 1<<15,
// PCG_BitArray= 1<<16,
PCG_Mesh= 1<<17,
// PCG_TabPoint3= 1<<18,
// PCG_TabFace= 1<<19
PCG_TabUVVert= 1<<20,
PCG_TabTVFace= 1<<21,
PCG_Map= 1<<22,
PCG_MeshMap= 1<<23
};
// all standard particle channels listed (implemented by max)
// Note to Developer: update index2InterfaceID and InterfaceID2index methods
// if number/content of standard classes is changed
// maximum amount of standard particle channels is 31; restricted by bit size of DWORD
enum PCU_channelIndex {
PCU_Undefined= 0,
PCU_Amount= 1<<0, // fictional channel to indicate that Operator changes number of particles
PCU_New= 1<<1, // channel to trace newly born/entered particles
PCU_ID= 1<<2, // channel to keep particleID=(index,born)
PCU_Time= 1<<3, // current valid time for a particle (PCG_PTV)
PCU_BirthTime= 1<<4, // time when particle was born (PCG_PTV)
PCU_EventStart= 1<<5, // time when particle entered the current event (PCG_PTV)
PCU_Position= 1<<6, // particle position (PCG_Point3)
PCU_Speed= 1<<7, // particle speed (PCG_Point3)
PCU_Acceleration= 1<<8, // particle acceleration (PCG_Point3)
PCU_Orientation= 1<<9, // 3D orientation of a particle (PCG_Quad)
PCU_Spin= 1<<10, // angular velocity of a particle (PCG_AngAxis)
PCU_Scale= 1<<11, // scaling factor for particle (Point3: x, y, z axes)
PCU_Shape= 1<<12, // shape as a whole mesh (PCG_Mesh)
// PCU_ShapeTopology= 1<<13, // topology data (Tab<Face>)
// PCU_ShapeGeometry= 1<<14, // geometry data (Tab<Point3>)
// PCU_ShapeNormals= 1<<15, // normals data
PCU_ShapeTexture= 1<<16, // texture coordinate data
// PCU_Mass= 1<<17, // particle mass
PCU_MtlIndex= 1<<18, // material index for particles
PCU_Selection= 1<<19, // selection status
PCU_MXSInteger= 1<<20, // maxscript integer value
PCU_MXSFloat= 1<<21, // maxscript float value
PCU_MXSVector= 1<<22, // maxscript Point3 value
PCU_MXSMatrix= 1<<23, // maxscript Matrix3 value
PCU_DeathTime= 1<<24, // time when particle is expected to die (PCG_PTV)
PCU_Lifespan= 1<<25 // lifespan of a particle
};
class ParticleChannelMask
{
public:
/** @defgroup ParticleChannelMask ParticleChannelMask.h
* @{
*/
/*! \fn PFExport ParticleChannelMask();
* \brief constructors/destructor/assigning
*/
PFExport ParticleChannelMask();
/*! \fn PFExport ParticleChannelMask(const ParticleChannelMask&);
* \brief constructors/destructor/assigning
*/
PFExport ParticleChannelMask(const ParticleChannelMask&);
/*! \fn PFExport ParticleChannelMask(DWORD readMask, DWORD writeMask);
* \brief constructors/destructor/assigning
*/
PFExport ParticleChannelMask(DWORD readMask, DWORD writeMask);
/*! \fn PFExport ParticleChannelMask& operator=(const ParticleChannelMask&);
* \brief constructors/destructor/assigning
*/
PFExport ParticleChannelMask& operator=(const ParticleChannelMask&);
/*! \fn PFExport ~ParticleChannelMask();
* \brief constructors/destructor/assigning
*/
PFExport ~ParticleChannelMask();
/*! \fn PFExport int operator==(const ParticleChannelMask&) const;
* \brief Test for equality
*/
PFExport int operator==(const ParticleChannelMask&) const;
/*! \fn PFExport int operator!=(const ParticleChannelMask&) const;
* \brief Test for equality
*/
PFExport int operator!=(const ParticleChannelMask&) const;
/*! \fn PFExport void SetReadChannels(DWORD channelsFlag);
* \brief set standard read/write and custom channels methods. If a custom particle channel is indeed a standard particle channel then it's stored as a flag
*/
PFExport void SetReadChannels(DWORD channelsFlag);
/*! \fn PFExport void SetWriteChannels(DWORD channelsFlag);
* \brief See PFExport void SetReadChannels()
*/
PFExport void SetWriteChannels(DWORD channelsFlag);
/*! \fn PFExport bool SetChannels(int numChannels, Interface_ID* channels);
* \brief See PFExport void SetReadChannels()
*/
PFExport bool SetChannels(int numChannels, Interface_ID* channels);
/*! \fn PFExport void AddReadChannels(DWORD channelsFlag); // adds more standard read channels
* \brief See PFExport void SetReadChannels()
*/
PFExport void AddReadChannels(DWORD channelsFlag); // adds more standard read channels
/*! \fn PFExport void RemoveReadChannels(DWORD channelsFlag); // removes some standard read channels
* \brief See PFExport void SetReadChannels()
*/
PFExport void RemoveReadChannels(DWORD channelsFlag); // removes some standard read channels
/*! \fn PFExport void AddWriteChannels(DWORD channelsFlag); // adds more standard write channels
* \brief See PFExport void SetReadChannels()
*/
PFExport void AddWriteChannels(DWORD channelsFlag); // adds more standard write channels
/*! \fn PFExport void RemoveWriteChannels(DWORD channelsFlag); // removes some standard write channels
* \brief See PFExport void SetReadChannels()
*/
PFExport void RemoveWriteChannels(DWORD channelsFlag); // removes some standard write channels
/*! \fn PFExport bool AddChannel(Interface_ID& channel);
* \brief See PFExport void SetReadChannels()
*/
PFExport bool AddChannel(Interface_ID& channel);
/*! \fn PFExport bool RemoveChannel(Interface_ID& channel);
* \brief See PFExport void SetReadChannels()
*/
PFExport bool RemoveChannel(Interface_ID& channel);
/*! \fn PFExport const int GetNumChannels() const; // standard read/write and custom together
* \brief get channels methods
*/
PFExport const int GetNumChannels() const; // standard read/write and custom together
/*! \fn PFExport const Interface_ID GetChannel(int i) const;
* \brief
*/
PFExport const Interface_ID GetChannel(int i) const;
/*! \fn PFExport const bool HasChannel(Interface_ID& channel) const;
* \brief has channels methods. Returns true if the channel is present
*/
PFExport const bool HasChannel(Interface_ID& channel) const;
/*! \fn PFExport const bool HasReadChannels(DWORD channelsFlag) const;
* \brief returns true if all readChannels are present
*/
PFExport const bool HasReadChannels(DWORD channelsFlag) const;
/*! \fn PFExport const bool HasWriteChannels(DWORD channelsFlag) const;
* \brief returns true if all writeChannels are present
*/
PFExport const bool HasWriteChannels(DWORD channelsFlag) const;
/*! \fn PFExport static int NumStandardParticleChannels();
* \brief maximum number of available standard particle channels (constant)
*/
PFExport static int NumStandardParticleChannels();
/*! \fn PFExport static const ParticleChannelMask& Null();
* \brief empty mask
*/
PFExport static const ParticleChannelMask& Null();
private:
// conversion between channel index and standard channel Class_ID
// returns PCU_Undefined if the channel isn't standard particle channel
PFExport static const PCU_channelIndex InterfaceID2readIndex(Interface_ID& id);
PFExport static const PCU_channelIndex InterfaceID2writeIndex(Interface_ID& id);
// returns false if not a valid index
PFExport static const Interface_ID readIndex2InterfaceID(PCU_channelIndex index);
PFExport static const Interface_ID writeIndex2InterfaceID(PCU_channelIndex index);
void invalidateNumSRChannels() { _numSRChannelsValid() = false; }
void invalidateNumSWChannels() { _numSWChannelsValid() = false; }
// const access to class members
const DWORD readFlag() const { return m_readFlag; }
const DWORD writeFlag() const { return m_writeFlag; }
const bool numSRChannelsValid() const { return m_numSRChannelsValid; }
const bool numSWChannelsValid() const { return m_numSWChannelsValid; }
const int numStandardReadChannels() const; // updates num of standard read channels if invalid
const int numStandardWriteChannels() const; // updates num of standard write channels if invalid
const int numCustomChannels() const { return m_numCustomChannels; }
const Interface_ID* customChannels() const { return m_customChannels; }
// access to class members
DWORD& _readFlag() { return m_readFlag; }
DWORD& _writeFlag() { return m_writeFlag; }
bool& _numSRChannelsValid() { return m_numSRChannelsValid; }
bool& _numSWChannelsValid() { return m_numSWChannelsValid; }
int& _numStandardReadChannels() { return m_numStandardReadChannels; }
int& _numStandardWriteChannels() { return m_numStandardWriteChannels; }
int& _numCustomChannels() { return m_numCustomChannels; }
Interface_ID*& _customChannels() { return m_customChannels; }
protected:
DWORD m_readFlag, m_writeFlag;
mutable bool m_numSRChannelsValid, m_numSWChannelsValid;
mutable int m_numStandardReadChannels, m_numStandardWriteChannels;
int m_numCustomChannels;
Interface_ID *m_customChannels;
const static DWORD kChannelsCast;
const static int kNumStandardParticleChannels;
const static ParticleChannelMask kNull; // empty mask
};
#endif // _PARTICLECHANNELMASK_H_

View File

@ -0,0 +1,94 @@
/*! \file PreciseTimeValue.h
\brief Class definitions for PreciseTimeValue.
Though time is stored internall in 3ds max as an integer
number of ticks, the precision is not sufficient particularly
for collision detection and particle systems tests.
The class is used where an additional degree of time pre-
cision is required.
The "fraction" member stays in range [-0.5f, 0.5f] if
there is no direct manipulation with the member.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-17-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _PRECISETIMEVALUE_H
#define _PRECISETIMEVALUE_H
#include "PFExport.h"
class PFExport PreciseTimeValue {
public:
int tick;
float fraction;
// Constructors
PreciseTimeValue() {}
PreciseTimeValue(int t, float f) { tick = t; fraction = f; }
PreciseTimeValue(int t) { tick = t; fraction = 0.0f; }
PreciseTimeValue(float f);
PreciseTimeValue(const PreciseTimeValue& v);
// Data members
static const PreciseTimeValue Origin;
// Conversion function
operator int() { return tick; }
operator float() { return tick+fraction; }
// Unary operators
PreciseTimeValue operator-() const;
PreciseTimeValue operator+() const { return *this; }
// Property functions
int TimeValue() const { return tick; }
float PreciseTime() const { return tick+fraction; }
// Assignment operators
PreciseTimeValue& operator-=(const PreciseTimeValue&);
PreciseTimeValue& operator-=(const int v) { tick -= v; return *this; }
PreciseTimeValue& operator-=(const float);
PreciseTimeValue& operator+=(const PreciseTimeValue&);
PreciseTimeValue& operator+=(const int v) { tick += v; return *this; }
PreciseTimeValue& operator+=(const float);
PreciseTimeValue& operator*=(const int);
PreciseTimeValue& operator*=(const float);
PreciseTimeValue& operator/=(const float);
PreciseTimeValue& Set(int t, float f) { tick=t; fraction=f; return *this; }
// Test for equality
int operator==(const PreciseTimeValue& v) const
{ return ((v.tick==tick)&&(v.fraction==fraction)); }
int operator!=(const PreciseTimeValue& v) const
{ return ((v.tick!=tick)||(v.fraction!=fraction)); }
int Equals(const PreciseTimeValue& v, float epsilon = 1E-6f) const;
int Equals(int t, float epsilon = 1E-6f) const;
int Equals(float t, float epsilon = 1E-6f) const;
int operator>(const PreciseTimeValue& v) const;
int operator<(const PreciseTimeValue& v) const;
int operator>=(const PreciseTimeValue& v) const;
int operator<=(const PreciseTimeValue& v) const;
// Binary operators
PreciseTimeValue operator-(const PreciseTimeValue&) const;
PreciseTimeValue operator-(const int) const;
PreciseTimeValue operator-(const float) const;
PreciseTimeValue operator+(const PreciseTimeValue&) const;
PreciseTimeValue operator+(const int) const;
PreciseTimeValue operator+(const float) const;
PreciseTimeValue operator*(const int) const;
PreciseTimeValue operator*(const float) const;
PreciseTimeValue operator/(const float) const;
// internal use
void AdjustFraction();
};
#endif // _PRECISETIMEVALUE_H_

View File

@ -0,0 +1,71 @@
/*! \file RandObjLinker.h
\brief Class definitions for RandObjLinker
RandObjLinker links (creates) a RandGenerator for each
supplied Object (usually its a particle system).
Tests/Operators that use randomization have this an instance
of this class as a member. A Test/Operator may serve
several particle systems. For each particle system the
Test/Operator has to keep a dedicated copy of RandGenerator.
This copy of RandGenerator is used exclusively for the
designated particle system. This scheme allows not to mix
randomization for different particle systems.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 12-04-2001
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _RANDOBJLINKER_H
#define _RANDOBJLINKER_H
#include "max.h"
#include "PFExport.h"
#include "RandGenerator.h"
class RandObjLinker {
public:
PFExport RandObjLinker();
PFExport ~RandObjLinker();
// to initialize random generator for a particle container "pCont"
PFExport bool Init(IObject* pCont, int randomSeed);
// to release random generator for a particle container "pCont"
PFExport void Release(IObject* pCont);
// to get a random generator associated with a particle container "pCont"
PFExport RandGenerator* GetRandGenerator(IObject* pCont) const;
// to deallocate all random generators and all data
PFExport void FreeAll();
private:
bool HasPContainer(IObject* pCont) const;
bool AddPContainer(IObject* pCont, int randomSeed);
// const access to class members
int num() const { return m_num; }
const Tab<IObject*>& particleContainers() const { return m_particleContainers; }
IObject* particleContainer(int index) const { return m_particleContainers[index]; }
const Tab<RandGenerator*>& randGenerators() const { return m_randGenerators; }
RandGenerator* randGenerator(int index) const { return m_randGenerators[index]; }
// access to class members
int& _num() { return m_num; }
Tab<IObject*>& _particleContainers() { return m_particleContainers; }
IObject*& _particleContainer(int index) { return m_particleContainers[index]; }
Tab<RandGenerator*>& _randGenerators() { return m_randGenerators; }
RandGenerator*& _randGenerator(int index) { return m_randGenerators[index]; }
protected:
int m_num;
Tab<IObject*> m_particleContainers;
Tab<RandGenerator*> m_randGenerators;
};
#endif // _RANDOBJLINKER_H_