3ds Max C++ API Reference
IPopulateFlow Class Referenceabstract

IPopulateFlow is the interface class to Populate flow objects. More...

#include <IPopulateFlow.h>

+ Inheritance diagram for IPopulateFlow:

Public Types

enum  LaneWeaveType {
  eForward = 1 , eHugLeft , eWeaveLeft , eWeaveRight ,
  eHugRight , eBackward
}
 Lane Weave Types. More...
 
- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 

Public Member Functions

FPInterfaceDescGetDesc ()
 
virtual Interface_ID GetID ()
 
Flow Parameters

Returns the path width

virtual float GetPathWidth () const =0
 Sets the path width. More...
 
virtual bool SetPathWidth (float width)=0
 Sets the path width. More...
 
virtual float GetLaneWidth () const =0
 Returns the lane width. More...
 
virtual bool SetLaneWidth (float width)=0
 Sets the lane width. More...
 
virtual bool GetPortalUnified () const =0
 Returns whether or not the portals are unified (or linked) More...
 
virtual void SetPortalUnified (bool unified)=0
 Sets whether or not the portals are unified (or linked) More...
 
virtual LaneWeaveType GetLaneWeave () const =0
 Returns the lane weave type. More...
 
virtual bool SetLaneWeave (LaneWeaveType weave)=0
 Sets the lane weave type. More...
 
virtual int GetPositionSeed () const =0
 Returns the position randomization seed. More...
 
virtual bool SetPositionSeed (int seed)=0
 Sets the position randomization seed. More...
 
virtual int GetGenderSeed () const =0
 Returns the gender randomization seed. More...
 
virtual bool SetGenderSeed (int seed)=0
 Sets the gender randomization seed. More...
 
Portal 1 Parameters

If the portals are unified, portal 1 parameters apply to both portals, and if not, portal 1 parameters apply only to portal 1.

Returns the flow density at the specified time

virtual float GetDensity (TimeValue t) const =0
 Density is a value between 0.0 and 1.0, 0 meaning the portal releases no characters, and 1 meaning the portal releases the maximum allowable number of characters. More...
 
virtual bool SetDensity (TimeValue t, float density)=0
 Sets the flow density at the specified time. More...
 
virtual float GetSpeed (TimeValue t) const =0
 Returns the flow speed at the specified time. More...
 
virtual bool SetSpeed (TimeValue t, float speed)=0
 Sets the flow speed at the specified time. More...
 
virtual float GetRunningPercent (TimeValue t) const =0
 Returns the percent of runners at the specified time. More...
 
virtual bool SetRunningPercent (TimeValue t, float runPercent)=0
 Sets the percent of runners at the specified time. More...
 
virtual float GetGenderPercent (TimeValue t) const =0
 Returns the percent of females at the specified time. More...
 
virtual bool SetGenderPercent (TimeValue t, float genderPercent)=0
 Sets the percent of females at the specified time. More...
 
Portal 2 Parameters

If the portals are unified, portal 2 parameters are ignored, and if not, portal 2 parameters apply only to portal 2.

Returns the flow density of portal 2 at the specified time

virtual float GetDensity2 (TimeValue t) const =0
 Density is a value between 0.0 and 1.0, 0 meaning the portal releases no characters, and 1 meaning the portal releases the maximum allowable number of characters. More...
 
virtual bool SetDensity2 (TimeValue t, float density)=0
 Sets the flow density of portal 2 at the specified time. More...
 
virtual float GetSpeed2 (TimeValue t) const =0
 Returns the flow speed of portal 2 at the specified time. More...
 
virtual bool SetSpeed2 (TimeValue t, float speed)=0
 Sets the flow speed of portal 2 at the specified time. More...
 
virtual float GetRunningPercent2 (TimeValue t) const =0
 Returns the percent of runners released from portal 2 at the specified time. More...
 
virtual bool SetRunningPercent2 (TimeValue t, float runPercent)=0
 Sets the percent of runners released from portal 2 at the specified time. More...
 
virtual float GetGenderPercent2 (TimeValue t) const =0
 Returns the percent of females released from portal 2 at the specified time. More...
 
virtual bool SetGenderPercent2 (TimeValue t, float genderPercent)=0
 Sets the percent of females released from portal 2 at the specified time. More...
 
Geometry Querying and Editing

To edit the geometry of a flow, simply edit the points which make up the center line of the flow.

The sides are created based on the center line of points and the width of the flow.
If the points cannot generate a valid flow, then the flow is marked unusable. An unusable flow is displayed without lanes or marks, and with orange edges in the viewport, and no simulation will take place on it. If executed inside a hold, all functions which change the geometry can be undone.

See also
ComputeSides(), IsPathUsable()

Returns the number of points in the center line of the flow

virtual int GetNumPoints () const =0
 Returns the specified point. More...
 
virtual Point3 GetPoint (int i) const =0
 Returns the specified point. More...
 
virtual bool CanAddPoint (Point3 pt)=0
 Returns true if a valid flow will result from the point being appended to the flow and false if not. More...
 
virtual void AddPoint (Point3 pt)=0
 Appends a point to the flow. More...
 
virtual bool CanInsertPoint (int index, Point3 pt)=0
 Returns true if a valid flow will result from the point being inserted at the specified index, and false if not. More...
 
virtual bool InsertPoint (int index, Point3 pt)=0
 Inserts a point in the flow. More...
 
virtual bool SetPoint (int index, Point3 pt)=0
 Sets a point in the flow. More...
 
virtual bool DeletePoint (int index)=0
 Deletes a point in the flow. More...
 
virtual bool SetPointSelected (int index, bool selected)=0
 Selects or deselects a point in the flow. More...
 
Ramps

A ramp consists of a single inclined or flat segment in a flow surrounded by two landing segments.

The points at the start and end of a ramp are called creases. The points of the ramp creases can not be set directly. Instead, they must be set with the crease percent. The crease percent indicates how far a ramp crease is between the ends of the surrounding landings.
It is a value between 0.0 and 1.0. A value of 0.0 indicates that the crease is just slightly past the start of the landing before the ramp. A value of 1.0 indicates that the crease is just slightly before the end of the last landing segment. The crease percent at the start of the ramp must be less than the crease percent at the end of the ramp.

virtual bool CreateRamp (int index)=0
 Creates a ramp. More...
 
virtual bool DeleteRamp (int index)=0
 Deletes a ramp. More...
 
virtual bool IsRamp (int index)=0
 Returns whether or not the specified index is at the starting crease of a ramp. More...
 
virtual bool IsLanding (int index)=0
 Returns whether or not the specified index is at the start of a ramp landing segment. More...
 
virtual float GetCreasePercent (int index) const =0
 Returns the crease percent. More...
 
virtual bool SetCreasePercent (int index, float percent)=0
 Sets the crease percent. More...
 
virtual void SetRamp (int index)=0
 Sets points to be creases. More...
 
Miscellaneous Functions

Computes the sides of the flow

virtual bool ComputeSides (bool forceComputation=true)=0
 When you add, insert, set, or delete points, or add, delete or change a ramp, an internal flag is set indicating that the flow has changed and the sides need to be recomputed. More...
 
virtual bool IsPathUsable ()=0
 Returns whether or not the flow is usable. More...
 
virtual float GetDefaultPathWidth () const =0
 Returns the default path width. More...
 
virtual Color GetInvalidPathColor () const =0
 Returns the color of the edges of an unusable flow. More...
 
virtual void StoreLastKnownGoodPoints ()=0
 Temporarily stores the flow points. More...
 
virtual void RestoreLastKnownGoodPoints ()=0
 Restores the temporarily stored points. More...
 
- Public Member Functions inherited from FPMixinInterface
 FPMixinInterface ()
 
virtual LifetimeType LifetimeControl ()
 
virtual CoreExport bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
CoreExport ~FPMixinInterface ()
 
virtual BaseInterfaceGetInterface (Interface_ID id)
 
virtual FPInterfaceDescGetDescByID (Interface_ID id)
 
- Public Member Functions inherited from FPInterface
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t=0, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPParams *params)
 
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t, FPValue &result, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPValue &result, FPParams *params=NULL)
 
virtual CoreExport FunctionID FindFn (const MCHAR *name)
 
virtual CoreExport BOOL IsEnabled (FunctionID actionID)
 
virtual CoreExport BOOL IsChecked (FunctionID actionID)
 
virtual CoreExport BOOL IsVisible (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsEnabled (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsChecked (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsVisible (FunctionID actionID)
 
virtual ActionTableGetActionTable ()
 
virtual void EnableActions (BOOL onOff)
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor. More...
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=NULL)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Static Public Member Functions

static IPopulateFlowGetPopulateFlowInterface (Object *obj)
 Gets the interface to a Populate Flow object. More...
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Additional Inherited Members

- Static Public Attributes inherited from FPInterface
static CoreExport FPInterfaceDesc nullInterface
 
- Protected Member Functions inherited from FPMixinInterface
 FPMixinInterface (const FPMixinInterface &rhs)
 
FPMixinInterfaceoperator= (const FPMixinInterface &rhs)
 
- Protected Member Functions inherited from FPInterface
virtual FPStatus _dispatch_fn (FunctionID fid, TimeValue t, FPValue &result, FPParams *p)
 
- Protected Attributes inherited from FPMixinInterface
Tab< InterfaceNotifyCallback * > * interfaceNotifyCBs
 

Detailed Description

IPopulateFlow is the interface class to Populate flow objects.

Example
The following code creates a Populate flow, sets some if its parameters, and adds it to Populate.
// Create Populate Flow
INode *flowNode = ip->CreateObjectNode(flowObj);
IPopulateFlow *flowIface = IPopulateFlow::GetPopulateFlowInterface(flowObj);
// Add points to the flow
flowIface->AddPoint(Point3(-400.0f,0.0f,0.0f));
flowIface->AddPoint(Point3( 400.0f,0.0f,0.0f));
flowIface->SetPathWidth(230.0f);
flowIface->ComputeSides();
// Set some flow parameters
flowIface->SetDensity(0,0.7f);
flowIface->SetSpeed(0,0.8f);
// Add flow to Populate
IPopulate *iPopulate = IPopulate::GetInstance();
iPopulate->AddFlow(flowNode);
#define POPULATE_FLOW_CLASS_ID
The class ID for the IPopulateFlow class.
Definition: IPopulateFlow.h:17
Definition: inode.h:55
Definition: maxapi.h:2991
virtual INode * CreateObjectNode(Object *obj)=0
virtual void * CreateInstance(SClass_ID superID, Class_ID classID)=0
static IPopulateFlow * GetPopulateFlowInterface(Object *obj)
Gets the interface to a Populate Flow object.
Definition: IPopulateFlow.h:341
static IPopulate * GetInstance()
Returns the interface to Populate.
Definition: IPopulate.h:284
The object class is the base class for all objects.
Definition: object.h:1428
Definition: point3.h:56
#define GEOMOBJECT_CLASS_ID
Geometric object super-class ID.
Definition: plugapi.h:398
CoreExport Interface * GetCOREInterface()
See also
IPopulate, IPopulateIdleArea, IPopulateSeat

Member Enumeration Documentation

◆ LaneWeaveType

Lane Weave Types.

Enumerator
eForward 

Single direction forward.

eHugLeft 

Lanes on left forward, lanes on right backward.

eWeaveLeft 

Lanes alternate between forward and backward.

eWeaveRight 

Lanes alternate between backward and forward.

eHugRight 

Lanes on right forward, lanes on left backward.

eBackward 

Single direction backward.

37  {
39  eForward = 1,
41  eHugLeft,
43  eWeaveLeft,
45  eWeaveRight,
47  eHugRight,
49  eBackward
50  };
@ eHugRight
Lanes on right forward, lanes on left backward.
Definition: IPopulateFlow.h:47
@ eForward
Single direction forward.
Definition: IPopulateFlow.h:39
@ eBackward
Single direction backward.
Definition: IPopulateFlow.h:49
@ eWeaveRight
Lanes alternate between backward and forward.
Definition: IPopulateFlow.h:45
@ eWeaveLeft
Lanes alternate between forward and backward.
Definition: IPopulateFlow.h:43
@ eHugLeft
Lanes on left forward, lanes on right backward.
Definition: IPopulateFlow.h:41

Member Function Documentation

◆ GetPathWidth()

virtual float GetPathWidth ( ) const
pure virtual

Sets the path width.

Parameters
[in]width- the path width

◆ SetPathWidth()

virtual bool SetPathWidth ( float  width)
pure virtual

Sets the path width.

Parameters
[in]width- the path width

◆ GetLaneWidth()

virtual float GetLaneWidth ( ) const
pure virtual

Returns the lane width.

◆ SetLaneWidth()

virtual bool SetLaneWidth ( float  width)
pure virtual

Sets the lane width.

If the width is too large or small, it will be clipped to the allowable limits.

Parameters
[in]width- the lane width
Returns
true if the width was successfully set, false if not

◆ GetPortalUnified()

virtual bool GetPortalUnified ( ) const
pure virtual

Returns whether or not the portals are unified (or linked)

If the portals are unified, portal 1 parameters apply to both portals, and portal 2 parameters are ignored. If the portals are not unified, portal 1 parameters apply to portal 1, and portal 2 parameters apply to portal 2.

◆ SetPortalUnified()

virtual void SetPortalUnified ( bool  unified)
pure virtual

Sets whether or not the portals are unified (or linked)

If the portals are unified, portal 1 parameters apply to both portals, and portal 2 parameters are ignored. If the portals are not unified, portal 1 parameters apply to portal 1, and portal 2 parameters apply to portal 2.

Parameters
[in]unified- whether or not the portals are unified

◆ GetLaneWeave()

virtual LaneWeaveType GetLaneWeave ( ) const
pure virtual

Returns the lane weave type.

See also
IPopulateFlow::LaneWeaveType

◆ SetLaneWeave()

virtual bool SetLaneWeave ( LaneWeaveType  weave)
pure virtual

Sets the lane weave type.

Parameters
[in]weave- the lane weave type
See also
IPopulateFlow::LaneWeaveType
Returns
true if the weave was successfully set, false if not

◆ GetPositionSeed()

virtual int GetPositionSeed ( ) const
pure virtual

Returns the position randomization seed.

◆ SetPositionSeed()

virtual bool SetPositionSeed ( int  seed)
pure virtual

Sets the position randomization seed.

Parameters
[in]seed- the position seed
Returns
true if the seed was successfully set, false if not

◆ GetGenderSeed()

virtual int GetGenderSeed ( ) const
pure virtual

Returns the gender randomization seed.

◆ SetGenderSeed()

virtual bool SetGenderSeed ( int  seed)
pure virtual

Sets the gender randomization seed.

Parameters
[in]seed- the gender seed
Returns
true if the seed was successfully set, false if not

◆ GetDensity()

virtual float GetDensity ( TimeValue  t) const
pure virtual

Density is a value between 0.0 and 1.0, 0 meaning the portal releases no characters, and 1 meaning the portal releases the maximum allowable number of characters.

Parameters
[in]t- time at which the density is retrieved

◆ SetDensity()

virtual bool SetDensity ( TimeValue  t,
float  density 
)
pure virtual

Sets the flow density at the specified time.

Density is a value between 0.0 and 1.0, 0 meaning the portal releases no characters, and 1 meaning the portal releases the maximum allowable number of characters

Parameters
[in]t- time at which the density is set
[in]density- density of the flow at time t
Returns
true if the density was successfully set, false if not

◆ GetSpeed()

virtual float GetSpeed ( TimeValue  t) const
pure virtual

Returns the flow speed at the specified time.

Speed is a value between 0.0 and 1.0, 0 meaning the portal releases slow pedestrians, and 1 meaning the portal releases fast pedestrians.

Parameters
[in]t- time at which the speed is retrieved

◆ SetSpeed()

virtual bool SetSpeed ( TimeValue  t,
float  speed 
)
pure virtual

Sets the flow speed at the specified time.

Speed is a value between 0.0 and 1.0, 0 meaning the portal releases slow pedestrians, and 1 meaning the portal releases fast pedestrians.

Parameters
[in]t- time at which the speed is set
[in]speed- speed of the pedestrians at time t
Returns
true if the speed was successfully set, false if not

◆ GetRunningPercent()

virtual float GetRunningPercent ( TimeValue  t) const
pure virtual

Returns the percent of runners at the specified time.

Running percent is a value between 0.0 and 1.0, 0 meaning the portal releases no running pedestrians, and 1 meaning the portal releases all running pedestrians.

Parameters
[in]t- time at which the running percent is retrieved

◆ SetRunningPercent()

virtual bool SetRunningPercent ( TimeValue  t,
float  runPercent 
)
pure virtual

Sets the percent of runners at the specified time.

Running percent is a value between 0.0 and 1.0, 0 meaning the portal releases no running pedestrians, and 1 meaning the portal releases all running pedestrians.

Parameters
[in]t- time at which the running percent is set
[in]runPercent- percent of running pedestrians at time t
Returns
true if the run percent was successfully set, false if not

◆ GetGenderPercent()

virtual float GetGenderPercent ( TimeValue  t) const
pure virtual

Returns the percent of females at the specified time.

Gender percent is a value between 0.0 and 1.0, 0 meaning the portal releases all males, and 1 meaning the portal releases all females.

Parameters
[in]t- time at which the gender percent is retrieved

◆ SetGenderPercent()

virtual bool SetGenderPercent ( TimeValue  t,
float  genderPercent 
)
pure virtual

Sets the percent of females at the specified time.

Gender percent is a value between 0.0 and 1.0, 0 meaning the portal releases all males, and 1 meaning the portal releases all females.

Parameters
[in]t- time at which the gender percent is set
[in]genderPercent- percent of females at time t
Returns
true if the gender percent was successfully set, false if not

◆ GetDensity2()

virtual float GetDensity2 ( TimeValue  t) const
pure virtual

Density is a value between 0.0 and 1.0, 0 meaning the portal releases no characters, and 1 meaning the portal releases the maximum allowable number of characters.

Parameters
[in]t- time at which the density is retrieved

◆ SetDensity2()

virtual bool SetDensity2 ( TimeValue  t,
float  density 
)
pure virtual

Sets the flow density of portal 2 at the specified time.

Density is a value between 0.0 and 1.0, 0 meaning the portal releases no characters, and 1 meaning the portal releases the maximum allowable number of characters

Parameters
[in]t- time at which the density is set
[in]density- density of the flow at time t
Returns
true if the density was successfully set, false if not

◆ GetSpeed2()

virtual float GetSpeed2 ( TimeValue  t) const
pure virtual

Returns the flow speed of portal 2 at the specified time.

Speed is a value between 0.0 and 1.0, 0 meaning the portal releases slow pedestrians, and 1 meaning the portal releases fast pedestrians.

Parameters
[in]t- time at which the speed is retrieved

◆ SetSpeed2()

virtual bool SetSpeed2 ( TimeValue  t,
float  speed 
)
pure virtual

Sets the flow speed of portal 2 at the specified time.

Speed is a value between 0.0 and 1.0, 0 meaning the portal releases slow pedestrians, and 1 meaning the portal releases fast pedestrians.

Parameters
[in]t- time at which the speed is set
[in]speed- speed of the pedestrians at time t
Returns
true if the speed was successfully set, false if not

◆ GetRunningPercent2()

virtual float GetRunningPercent2 ( TimeValue  t) const
pure virtual

Returns the percent of runners released from portal 2 at the specified time.

Running percent is a value between 0.0 and 1.0, 0 meaning the portal releases slow pedestrians, and 1 meaning the portal releases fast pedestrians.

Parameters
[in]t- time at which the running percent is retrieved

◆ SetRunningPercent2()

virtual bool SetRunningPercent2 ( TimeValue  t,
float  runPercent 
)
pure virtual

Sets the percent of runners released from portal 2 at the specified time.

Running percent is a value between 0.0 and 1.0, 0 meaning the portal releases slow pedestrians, and 1 meaning the portal releases fast pedestrians.

Parameters
[in]t- time at which the running percent is set
[in]runPercent- percent of running pedestrians at time t
Returns
true if the run percent was successfully set, false if not

◆ GetGenderPercent2()

virtual float GetGenderPercent2 ( TimeValue  t) const
pure virtual

Returns the percent of females released from portal 2 at the specified time.

Gender percent is a value between 0.0 and 1.0, 0 meaning the portal releases all males, and 1 meaning the portal releases all females.

Parameters
[in]t- time at which the gender percent is retrieved

◆ SetGenderPercent2()

virtual bool SetGenderPercent2 ( TimeValue  t,
float  genderPercent 
)
pure virtual

Sets the percent of females released from portal 2 at the specified time.

Gender percent is a value between 0.0 and 1.0, 0 meaning the portal releases all males, and 1 meaning the portal releases all females.

Parameters
[in]t- time at which the gender percent is set
[in]genderPercent- percent of females at time t
Returns
true if the gender percent was successfully set, false if not

◆ GetNumPoints()

virtual int GetNumPoints ( ) const
pure virtual

Returns the specified point.

Parameters
[in]i- the index of the retrieved point

◆ GetPoint()

virtual Point3 GetPoint ( int  i) const
pure virtual

Returns the specified point.

Parameters
[in]i- the index of the retrieved point

◆ CanAddPoint()

virtual bool CanAddPoint ( Point3  pt)
pure virtual

Returns true if a valid flow will result from the point being appended to the flow and false if not.

Parameters
[in]pt- the point to be potentially added

◆ AddPoint()

virtual void AddPoint ( Point3  pt)
pure virtual

Appends a point to the flow.

Parameters
[in]pt- the point to be added
Returns
true if the point was successfully added, false if not

◆ CanInsertPoint()

virtual bool CanInsertPoint ( int  index,
Point3  pt 
)
pure virtual

Returns true if a valid flow will result from the point being inserted at the specified index, and false if not.

index == 0 will insert at the start of the flow, and index == numpts will append past the end of the path.

Parameters
[in]index- the index at which the point will be inserted
[in]pt- the point to be potentially inserted

◆ InsertPoint()

virtual bool InsertPoint ( int  index,
Point3  pt 
)
pure virtual

Inserts a point in the flow.

index == 0 will insert at the start of the flow, and index == numpts will append past the end of the path.

Parameters
[in]index- the index at which the point will be inserted
[in]pt- the point to be inserted
Returns
true if the point was successfully inserted, false if not

◆ SetPoint()

virtual bool SetPoint ( int  index,
Point3  pt 
)
pure virtual

Sets a point in the flow.

A point at the start or end of a ramp cannot be set with this method.

See also
SetCreasePercent()
Parameters
[in]index- the index of the point to be set
[in]pt- the point to be set
Returns
true if the point was successfully set, false if not

◆ DeletePoint()

virtual bool DeletePoint ( int  index)
pure virtual

Deletes a point in the flow.

Points at ramp creases cannot be deleted with this function.

See also
DeleteRamp()
Parameters
[in]index- the index of the point to be deleted
Returns
true if the point was successfully deleted, false if not

◆ SetPointSelected()

virtual bool SetPointSelected ( int  index,
bool  selected 
)
pure virtual

Selects or deselects a point in the flow.

Parameters
[in]index- the index of the point to be selected
[in]selected- the value to set the point's selected property to. Set to true to select, false to de-select.
Returns
true if the operation was successful

◆ CreateRamp()

virtual bool CreateRamp ( int  index)
pure virtual

Creates a ramp.

The ramp will be created flat inside the segment, adding two new points inside the specified segment, with the ramp in between the two new points and the landing segments on either side. If it's impossible to create a ramp in the specified segment, it will not be created.

Parameters
[in]index- the index of the segment in which the ramp will be created
Returns
true if the ramp was successfully created, false if it is not possible to create a ramp in this segment

◆ DeleteRamp()

virtual bool DeleteRamp ( int  index)
pure virtual

Deletes a ramp.

The ramp whose starting crease is at the specified index will be deleted. Both ramp crease points will be deleted.
If the resulting flow is on two levels, it will be broken up into two flows.

Parameters
[in]index- the index of the starting crease of the ramp to be deleted
Returns
true if the ramp was successfully deleted, false if it is not possible to delete the ramp

◆ IsRamp()

virtual bool IsRamp ( int  index)
pure virtual

Returns whether or not the specified index is at the starting crease of a ramp.

Parameters
[in]index- the index to check

◆ IsLanding()

virtual bool IsLanding ( int  index)
pure virtual

Returns whether or not the specified index is at the start of a ramp landing segment.

A ramp landing is the segment before or after a ramp.

Parameters
[in]index- the index to check

◆ GetCreasePercent()

virtual float GetCreasePercent ( int  index) const
pure virtual

Returns the crease percent.

The crease percent is a value between 0.0 and 1.0, indicating how far the crease is between the start of the first landing and the end of the second landing.

Parameters
[in]index- the index of the crease

◆ SetCreasePercent()

virtual bool SetCreasePercent ( int  index,
float  percent 
)
pure virtual

Sets the crease percent.

The crease percent is a value between 0.0 and 1.0, indicating how far the crease is between the start of the first landing and the end of the second landing.
The first crease percent must have a lower value than the second crease percent.

Parameters
[in]index- the index of the crease
[in]percent- a value between 0.0 and 1.0
Returns
true if the crease percent was successfully set, false if it was not possible to set the percent to the specified value

◆ SetRamp()

virtual void SetRamp ( int  index)
pure virtual

Sets points to be creases.

For internal use only. This is very dangerous because it doesn't check ramp validity when it creates creases.

◆ ComputeSides()

virtual bool ComputeSides ( bool  forceComputation = true)
pure virtual

When you add, insert, set, or delete points, or add, delete or change a ramp, an internal flag is set indicating that the flow has changed and the sides need to be recomputed.

You can call this function to recompute them, or they will be recomputed when the flow is displayed. Computation causes the internal flag to be reset.

Parameters
[in]forceComputation- if true, the sides will be computed, if false, the sides will only be computed if the flow has changed since the last side computation
Returns
true if the flow is usable, false if not

◆ IsPathUsable()

virtual bool IsPathUsable ( )
pure virtual

Returns whether or not the flow is usable.

An unusable flow displays without lanes or marks, and with orange edges in the viewport, and no simulation will take place on it.

◆ GetDefaultPathWidth()

virtual float GetDefaultPathWidth ( ) const
pure virtual

Returns the default path width.

◆ GetInvalidPathColor()

virtual Color GetInvalidPathColor ( ) const
pure virtual

Returns the color of the edges of an unusable flow.

◆ StoreLastKnownGoodPoints()

virtual void StoreLastKnownGoodPoints ( )
pure virtual

Temporarily stores the flow points.

You can store the points before changing them, check the flow validity, and if they are invalid, restore them. However, since the functions which edit the flow are undoable, this function is not terribly useful and is only used internally in special cases.

See also
RestoreLastKnownGoodPoints(), IsPathUsable()

◆ RestoreLastKnownGoodPoints()

virtual void RestoreLastKnownGoodPoints ( )
pure virtual

Restores the temporarily stored points.

You can store the points before changing them, check the flow validity, and if they are invalid, restore them. However, since the functions which edit the flow are undoable, this function is not terribly useful and is only used internally in special cases.

See also
StoreLastKnownGoodPoints(), IsPathUsable()

◆ GetDesc()

FPInterfaceDesc* GetDesc ( )
virtual
Remarks
Returns a pointer to the class which contains the interface metadata.

Implements FPInterface.

◆ GetID()

virtual Interface_ID GetID ( )
inlinevirtual
Remarks
This method overrides GetID() in those interfaces that do not publish metadata but instead have a unique Interface_ID for quick internal identification in implementation code that might be shared by a bunch of mixin interfaces.
Returns
The Interface_ID.
Default Implementation:
{ return GetDesc()->ID; }

Reimplemented from FPMixinInterface.

336 { return POPFLOW_INTERFACE; }
#define POPFLOW_INTERFACE
The interface ID for the IPopulateFlow class.
Definition: IPopulateFlow.h:19

◆ GetPopulateFlowInterface()

static IPopulateFlow* GetPopulateFlowInterface ( Object obj)
inlinestatic

Gets the interface to a Populate Flow object.

Parameters
[in]obj- Populate flow object
Returns
A pointer to an IPopulateFlow interface, or NULL.
341  {
342  return obj? static_cast<IPopulateFlow*>(obj->GetInterface(POPFLOW_INTERFACE)): NULL;}
#define NULL
Definition: autoptr.h:18
CoreExport void * GetInterface(ULONG id)
Inherited from Animatable.