All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
POP_ContextData Class Reference

#include <POP_ContextData.h>

+ Inheritance diagram for POP_ContextData:

Public Member Functions

 POP_ContextData (const char *owner)
virtual ~POP_ContextData (void)
const char * getName () const
void copyFrom (const POP_ContextData &data, GU_Detail *gdp=NULL)
void cook (OP_Context &context)
 cook() is used to perform cooking on the POP specified by myCookPOP. More...
void cookGuide (OP_Context &context)
void reset (POP_Node *pop, GU_Detail *gdp, const char *init, bool keepgeo, unsigned seed, bool solveimmediately)
void frameReset (void)
void offsetReset (void)
 offsetReset() resets the attribute offsets. More...
void recacheOffset (void)
void cacheMissingInternalAttributes ()
GU_DetailgetDisplayDetail (void)
void setDisplayToMyGdp ()
float random (void)
float randomSample (void)
unsigned getRandomSeed () const
GU_DetailgetDetail (void) const
void cacheDetail (POP_Node *node)
void addToParticleList (GEO_PrimParticle *part, POP_Node *pop, int idx)
void clearParticleLists ()
void setRefDetail (GU_Detail *gdp)
int getRuleSuppression ()
void setRuleSuppression (int suppress)
POP_ParticleListgetParticleList (void)
int isGuideOnly (void) const
int nextID (void)
void bumpNumParticles (int delta)
int allowBirth (void)
 allowBirth() returns whether a new particle can be born. More...
void getInputGeo (UT_String &path, int index) const
void setInputGeo (const UT_String &path, int index)
void appendGuide (POP_Node *, const GU_DetailHandle &)
void setInstanceGuide (POP_Node *, const GU_DetailHandle &)
bool getSelectionChanged () const
void setSelectionChanged ()
void setTime (fpreal time)
fpreal getTime () const
void setTimeInc (fpreal tinc)
fpreal getTimeInc () const
Blind Data Management
POP_BlindDatagetBlindData (const POP_Node *pop) const
int addBlindData (POP_BlindData *data)
POP_BlindDatastealBlindData (const POP_Node *pop)
GEO_PrimParticle Management
GEO_PrimParticlegetPrimPart (POP_Node *node)
GEO_PrimParticlehasPrimPart (POP_Node *node)
POP_NodegetGenerator (GEO_PrimParticle *part) const
Event Management
GA_RWAttributeRef getEventAttr (void)
 getEventAttr() returns the event attribute. More...
void addEvent (UT_String &events, float t)
 addEvent() signals that an event has occurred. More...
void removeEvent (UT_String &events)
 removeEvent() signals that an event is over. More...
void clearAllEvents (void)
 clearAllEvents() clears any currently active events. More...
POP_Cache Reference Counting

Reference counting, used for caching in POP_Cache (through POPNET_Node) Note that when the count reaches 0, myGdp is deleted along with this, because in the POP_Cache a new gdp is created for each context data.

void incRef ()
void decRef ()
Cook Control Flags

These flags control how the pop network will cook. They globally turn off various update rules so it is possible to, for example, only perform the velocity update, or only perform the cooking.

bool shouldDoReap () const
void setDoReap (bool v)
bool shouldDoPrep () const
void setDoPrep (bool v)
bool shouldDoApplyRules () const
void setDoApplyRules (bool v)
bool shouldDoCook () const
void setDoCook (bool v)
bool shouldDoCookFirst () const
void setDoCookFirst (bool v)
User Local Variables
CH_LocalVariablegetUserVariables (void)
const CH_LocalVariablegetUserVariables (void) const
GA_RWAttributeRef addUserVariable (const char *name, int tuplesize, GA_StorageClass type, GA_Defaults def, const char *local=0)
int isUserVariable (int index)
float getUserVariableValue (GEO_PointP ppt, int index, int thread)
uint64 getUserVariableSerial () const
- Public Member Functions inherited from OP_ContextData
 OP_ContextData ()
virtual ~OP_ContextData ()

Static Public Member Functions

static POP_ContextDatagetExpressionData (int thread)

Public Attributes

fpreal myTime
fpreal myTimeInc
int myRemoveUnused
int myDoInfoButton
int myDoUpdateViewport
int myMaxParticles
POP_GuideHandleList myOPGuides
UT_IntArray myGuidePOPs
UT_ValArray< GEO_PointPmyInstancePoints
GU_DetailHandle myInstanceOPGuide
int myInstanceGuidePOP


class POP_ContextDataHandle

Detailed Description

A POP_ContextData encapsulates and caches data necessary to cook a POP network. An instance is typically initialized by the entity that cooks a POP network and passed from POP to POP as the cooking occurs.

The POP_ContextData contains the geometry detail to update during the cook along with many cached attribute offsets.

Definition at line 53 of file POP_ContextData.h.

Constructor & Destructor Documentation

POP_ContextData::POP_ContextData ( const char *  owner)
virtual POP_ContextData::~POP_ContextData ( void  )

Member Function Documentation

int POP_ContextData::addBlindData ( POP_BlindData data)

Returns 1 if the data was added successfully to the context data. At this point, the context assumes ownership of the data and may delete it from time to time.

void POP_ContextData::addEvent ( UT_String events,
float  t 

addEvent() signals that an event has occurred.

void POP_ContextData::addToParticleList ( GEO_PrimParticle part,
POP_Node pop,
int  idx 
GA_RWAttributeRef POP_ContextData::addUserVariable ( const char *  name,
int  tuplesize,
GA_StorageClass  type,
GA_Defaults  def,
const char *  local = 0 
int POP_ContextData::allowBirth ( void  )

allowBirth() returns whether a new particle can be born.

void POP_ContextData::appendGuide ( POP_Node ,
const GU_DetailHandle  

The following method is used to append guide geometry during a cook. The specified GU_DetailHandle must be pointing to a POP_Guide.

void POP_ContextData::bumpNumParticles ( int  delta)

bumpNumParticles() updates the running count of particles in the network.

Definition at line 384 of file POP_ContextData.h.

void POP_ContextData::cacheDetail ( POP_Node node)
void POP_ContextData::cacheMissingInternalAttributes ( )

cacheMissingInternalOffsets() will acquire any attribute offsets from the gdp that it currently has noted as missing.

This method does not affect user attribute offsets.
void POP_ContextData::clearAllEvents ( void  )

clearAllEvents() clears any currently active events.

void POP_ContextData::clearParticleLists ( )

Erases the particle lists. You will need to reset() to rebuild them, but this avoids having dangling pointers to primitives You must clear lists if you will be losing control of the gdp and someone else may delete primitives.

Definition at line 205 of file POP_ContextData.h.

void POP_ContextData::cook ( OP_Context context)

cook() is used to perform cooking on the POP specified by myCookPOP.

void POP_ContextData::cookGuide ( OP_Context context)

cookGuide() is like cook() except that it is used to recook the guide geometry only.

void POP_ContextData::copyFrom ( const POP_ContextData data,
GU_Detail gdp = NULL 
void POP_ContextData::decRef ( )

Definition at line 217 of file POP_ContextData.h.

void POP_ContextData::frameReset ( void  )

frameReset() is used to reset some information on a per frame basis. It should be called before an attempt to cook a POP. However, once this is set, any number of calls to cook a POP can be performed assuming the underlying network does not change.

POP_BlindData* POP_ContextData::getBlindData ( const POP_Node pop) const

Return the blind data associated with the POP. If there is no data stored for the pop, a null ptr will be returned.

GU_Detail* POP_ContextData::getDetail ( void  ) const

getDetail() returns the GU_Detail being processed by this POP_ContextData.

Definition at line 174 of file POP_ContextData.h.

GU_Detail* POP_ContextData::getDisplayDetail ( void  )

Definition at line 115 of file POP_ContextData.h.

GA_RWAttributeRef POP_ContextData::getEventAttr ( void  )

getEventAttr() returns the event attribute.

static POP_ContextData* POP_ContextData::getExpressionData ( int  thread)

Query the context with respect to which expression functions are to be evaluated.

POP_Node* POP_ContextData::getGenerator ( GEO_PrimParticle part) const

getGenerator() returns the POP_Node that created a particular particle primitive.

void POP_ContextData::getInputGeo ( UT_String path,
int  index 
) const

Query the path to the specified context geometry.

[out]pathnode path
[in]index[0 .. MAX_INPUT_GEOS-1]
const char* POP_ContextData::getName ( void  ) const

Definition at line 59 of file POP_ContextData.h.

POP_ParticleList* POP_ContextData::getParticleList ( void  )

Definition at line 258 of file POP_ContextData.h.

GEO_PrimParticle* POP_ContextData::getPrimPart ( POP_Node node)

getPrimPart() returns the particle primitive generated by a particular POP. If this particle doesn't exist already, it creates a new one.

unsigned POP_ContextData::getRandomSeed ( ) const

Definition at line 153 of file POP_ContextData.h.

int POP_ContextData::getRuleSuppression ( )

Globally force the suppression of certain update rules when executing POP_Node::applyRulesToList(). This should be a mask (bitfield) of the relevant PART_STAT_SUPP* flags you want to suppress.

Definition at line 253 of file POP_ContextData.h.

bool POP_ContextData::getSelectionChanged ( ) const

Definition at line 409 of file POP_ContextData.h.

fpreal POP_ContextData::getTime ( ) const

Access the context time

Definition at line 98 of file POP_ContextData.h.

fpreal POP_ContextData::getTimeInc ( ) const

Access the context time

Definition at line 100 of file POP_ContextData.h.

CH_LocalVariable* POP_ContextData::getUserVariables ( void  )

Definition at line 355 of file POP_ContextData.h.

const CH_LocalVariable* POP_ContextData::getUserVariables ( void  ) const

Definition at line 356 of file POP_ContextData.h.

uint64 POP_ContextData::getUserVariableSerial ( ) const

Definition at line 369 of file POP_ContextData.h.

float POP_ContextData::getUserVariableValue ( GEO_PointP  ppt,
int  index,
int  thread 
GEO_PrimParticle* POP_ContextData::hasPrimPart ( POP_Node node)

hasPrimPart() returns whether the node already has a particle primitive assigned to it.

void POP_ContextData::incRef ( )

Definition at line 213 of file POP_ContextData.h.

int POP_ContextData::isGuideOnly ( void  ) const

isGuideOnly() returns true when POP_Node::cookPop() implementations should only update the guide geometry.

Definition at line 374 of file POP_ContextData.h.

int POP_ContextData::isUserVariable ( int  index)

Definition at line 364 of file POP_ContextData.h.

int POP_ContextData::nextID ( void  )

nextId() returns the integer ID to assign to the next birthed particle.

This method increments the internal state and so should only be called when initializing the "id" attribute of a newly birthed particle.
void POP_ContextData::offsetReset ( void  )

offsetReset() resets the attribute offsets.

float POP_ContextData::random ( void  )

random() returns a random number between 0-1. This should be used instead of SYSfastRandom() so that random numbers used within POPs are completely deterministic.

Definition at line 524 of file POP_ContextData.h.

float POP_ContextData::randomSample ( void  )

This uses the same seed as random() but sends the result through a hash... This is slower than random, but has the advantage that succeeding calls produce values that are "more" independent of each other. Specifically, if you sample a cube, you'll get a nice distribution

Definition at line 530 of file POP_ContextData.h.

void POP_ContextData::recacheOffset ( void  )

recacheOffset() will reacquire the attribute offsets from the gdp. This method should be called if the offsets in the detail may have changed, say as that result of a merge operation.

void POP_ContextData::removeEvent ( UT_String events)

removeEvent() signals that an event is over.

void POP_ContextData::reset ( POP_Node pop,
GU_Detail gdp,
const char *  init,
bool  keepgeo,
unsigned  seed,
bool  solveimmediately 

reset() is used to completely reset the POP_ContextData. It should be called whenever a restart of the particle system is required.

void POP_ContextData::setDisplayToMyGdp ( )

Definition at line 120 of file POP_ContextData.h.

void POP_ContextData::setDoApplyRules ( bool  v)

Definition at line 243 of file POP_ContextData.h.

void POP_ContextData::setDoCook ( bool  v)

Definition at line 245 of file POP_ContextData.h.

void POP_ContextData::setDoCookFirst ( bool  v)

Definition at line 247 of file POP_ContextData.h.

void POP_ContextData::setDoPrep ( bool  v)

Definition at line 241 of file POP_ContextData.h.

void POP_ContextData::setDoReap ( bool  v)

Definition at line 239 of file POP_ContextData.h.

void POP_ContextData::setInputGeo ( const UT_String path,
int  index 

Set the path to the specified context geometry.

[in]pathnode path
[in]index[0 .. MAX_INPUT_GEOS-1]
void POP_ContextData::setInstanceGuide ( POP_Node ,
const GU_DetailHandle  

The following method is used to specify the instance guide geometry during a cook. The specified GU_DetailHandle must be pointing to a POP_Guide.

void POP_ContextData::setRefDetail ( GU_Detail gdp)

Definition at line 231 of file POP_ContextData.h.

void POP_ContextData::setRuleSuppression ( int  suppress)

Globally force the suppression of certain update rules when executing POP_Node::applyRulesToList(). This should be a mask (bitfield) of the relevant PART_STAT_SUPP* flags you want to suppress.

Definition at line 255 of file POP_ContextData.h.

void POP_ContextData::setSelectionChanged ( )

Definition at line 411 of file POP_ContextData.h.

void POP_ContextData::setTime ( fpreal  time)

Access the context time

Definition at line 97 of file POP_ContextData.h.

void POP_ContextData::setTimeInc ( fpreal  tinc)

Access the context time

Definition at line 99 of file POP_ContextData.h.

bool POP_ContextData::shouldDoApplyRules ( ) const

Definition at line 242 of file POP_ContextData.h.

bool POP_ContextData::shouldDoCook ( ) const

Definition at line 244 of file POP_ContextData.h.

bool POP_ContextData::shouldDoCookFirst ( ) const

Definition at line 246 of file POP_ContextData.h.

bool POP_ContextData::shouldDoPrep ( ) const

Definition at line 240 of file POP_ContextData.h.

bool POP_ContextData::shouldDoReap ( ) const

Definition at line 238 of file POP_ContextData.h.

POP_BlindData* POP_ContextData::stealBlindData ( const POP_Node pop)

Returns the blind data for the pop and gives up any responsiblity or ownership of the data.

Friends And Related Function Documentation

friend class POP_ContextDataHandle

Definition at line 520 of file POP_ContextData.h.

Member Data Documentation

POP_Node* POP_ContextData::myCookPOP

Definition at line 428 of file POP_ContextData.h.

POP_Node* POP_ContextData::myDisplayPOP

Definition at line 429 of file POP_ContextData.h.

int POP_ContextData::myDoInfoButton

Definition at line 430 of file POP_ContextData.h.

int POP_ContextData::myDoUpdateViewport

Definition at line 431 of file POP_ContextData.h.

UT_IntArray POP_ContextData::myGuidePOPs

Definition at line 439 of file POP_ContextData.h.

int POP_ContextData::myInstanceGuidePOP

Definition at line 443 of file POP_ContextData.h.

GU_DetailHandle POP_ContextData::myInstanceOPGuide

Definition at line 442 of file POP_ContextData.h.

UT_ValArray<GEO_PointP> POP_ContextData::myInstancePoints

Definition at line 441 of file POP_ContextData.h.

int POP_ContextData::myMaxParticles

Definition at line 432 of file POP_ContextData.h.

POP_GuideHandleList POP_ContextData::myOPGuides

Definition at line 438 of file POP_ContextData.h.

int POP_ContextData::myRemoveUnused

Definition at line 426 of file POP_ContextData.h.

fpreal POP_ContextData::myTime

Definition at line 423 of file POP_ContextData.h.

fpreal POP_ContextData::myTimeInc

Definition at line 424 of file POP_ContextData.h.

void* POP_ContextData::myUserData

Definition at line 425 of file POP_ContextData.h.

OP_Network* POP_ContextData::myXformObj

Definition at line 427 of file POP_ContextData.h.

The documentation for this class was generated from the following file: