Interface: ActionList

The ActionList Interface is exposed by the Event Class.

It lets you add and removed Actions to/from the Event, test the type of the Actions on the list and control the Event’s appearance in the Particle View.

Methods:

<integer><PF_Event>.numActions()      

Returns the number of actions in the list.

<node><PF_Event>.getAction <index>index   

Returns the indexed action from the list.

<boolean><PF_Event>.appendAction <node>action 

Appends the specified action to the list, returns true on success.

See VolumeDocking Sample Script for a complete example.

<boolean><PF_Event>.insertAction <node>action <index>index 

Inserts the specified action in the list at the position defined by the index value. Returns true on success.

See VolumeDocking Sample Script for a complete example.

<boolean><PF_Event>.removeAction <index>index 

Removes the indexed action from the list. Returns true on success.

<boolean><PF_Event>.hasAction <node>action <&index>index 

index is In and Out parameter

Returns true if the specified action is on the list. When true, the by-reference index variable will contain the actual index of the existing action on the list.

<boolean><PF_Event>.isAction <node>action 

Returns true if the specified node is an action.

<boolean><PF_Event>.isOperator <node>action 

Returns true if the specified node is an operator.

<boolean><PF_Event>.isTest <node>action 

Returns true if the specified node is a test.

<boolean><PF_Event>.isActivated() 

Returns true if activated.

<void><PF_Event>.activate <boolean>active 

Sets the active state to the boolean value specified by the active parameter.

<integer><PF_Event>.isActionActive <index>index 

Returns 1 if the indexed action is active, 0 otherwise.

<void><PF_Event>.activateAction <index>index <integer>active 

Sets the active flag of the indexed action. 0 = inactive, 1= active

<void><PF_Event>.getPViewLocation <&integer>x <&integer>y 

x is In and Out parameter 
y is In and Out parameter 

Returns the x and y location of the Particle View in the by-reference parameters.

<void><PF_Event>.setPViewLocation <integer>x <integer>y 

Sets the Particle View location to the specified integer values.

X and Y Range is from 0 to 64000.

<integer><PF_Event>.getPViewZOrder() 

Returns the Particle View Z order.

<void><PF_Event>.setPViewZOrder <integer>z order 

Sets the Particle View Z Order. Range is from0 to 64000.

<integer><PF_Event>.getListWidth() 

Returns the List Width.

<void>setListWidth <integer>width 

Sets the List width. Range is from 100 to 1000 pixels.

<integer><PF_Event>.getPViewRightBoundary() 

Returns the right boundary of the Particle View.

<boolean><PF_Event>.isCollapsed() 

Returns true if the action list is collapsed.

Note: Collapsing is not implemented yet.
<void><PF_Event>.collapse() 

Collapses the action list.

Note: Collapsing is not implemented yet.
<void><PF_Event>.expand() 

Expands the action list.

Note: Expanding is not implemented yet.
<boolean><PF_Event>.hasUpStream() 

Returns true if the action list has an upstream list.

EXAMPLES AND RESULTS

   --Open Particle View to see results
   ParticleFlow.openParticleView()
   --Create an empty event
   ev = Event()
   --> $Event:Event 02 @ [0.000000,0.000000,0.000000]
   --Get the number of actions - the Event IS empty...
   ev.numActions()
   --> 0
   --Disable Automatic Event Encapsulation
   particleFlow.beginEdit()
   --> OK
   --Create a new Find_Target Action
   ft = find_target()
   --> $Find_Target:Find Target 01 @ [0.000000,0.000000,0.000000]
   --Enable Encapsulation again
   particleFlow.endEdit()
   --> OK
   --Append the Find_Target to the Event
   ev.appendAction ft
   --> true
   --Get the first action in the Event...
   ev.getAction 1
   --> $Find_Target:Find Target 01 @ [0.000000,0.000000,0.000000]
   --Let’s create another Action...
   particleFlow.beginEdit()
   --> OK
   --This time a Birth Action
   bt = birth()
   --> $Birth:Birth 01 @ [0.000000,0.000000,0.000000]
   particleFlow.endEdit()
   --> OK
   --Insert the Birth at first position
   ev.insertAction bt 1
   --> true
   --Try to insert the Find_Target
   --You cannot - it is already in the Event!
   ev.insertAction ft 1
   --> false
   --Remove the second event (Find_Target)
   ev.removeAction 2
   --> true
   --Initialize a variable to pass by reference
   ind = 0
   --> 0
   --Check if the Birth is in the Event - It is!
   ev.hasAction bt &ind
   --> true
   --The by-reference variable has the index
   ind
   --> 1
   --See if Find_Target is also there -
   --It isn’t anymore.
   ev.hasAction ft &ind
   --> false
   --See if Birth is an Action...
   ev.isAction bt
   --> true
   --See if Find_Target is an Action...
   ev.isAction ft
   --> true
   --See if Birth is an Operator...
   ev.isOperator bt
   --> true
   --See if Find_Target is an Operator...
   ev.isOperator ft
   --> false
   --See if Birth is a Test...
   ev.isTest bt
   --> false
   --See if Find_Target is a Test...
   ev.isTest ft
   --> true
   --See if the Event is activated...
   ev.isActivated()
   --> true
   --Deactivate it!
   ev.activate false
   --> OK
   --Now it is deactivated.
   ev.isActivated()
   --> false
   --Activate it again.
   ev.activate true
   --> OK
   --Works!
   ev.isActivated()
   --> true
   --See if the Birth action is active
   ev.isActionActive 1
   --> 1

   --Deactivate the Birth action
   ev.activateAction 1 0
   --> OK
   --Did it work?
   ev.isActionActive 1
   --> 0
   --Back to Active
   ev.activateAction 1 1
   --> OK
   --Birth is back to work!
   ev.isActionActive 1
   --> 1
   --Initialize some variables to pass by reference
   x = y = 0
   --> 0
   --Get the Event location in Particle View
   ev.getPViewLocation &x &y
   --> OK
   --X now contains the X coordinate...
   x
   --> 27
   --...and Y the Y coordinate
   y
   --> 14
   --Let’s change the location to 40,40
   ev.setPViewLocation 40 40
   --> OK
   --Get again to make sure it worked...
   ev.getPViewLocation &x &y
   --> OK
   x
   --> 40
   y
   --> 40
   --Get the Z order of the Event
   ev.getPViewZOrder()
   --> 1
   --Set the Z order down to 0
   ev.setPViewZOrder 0
   --> OK
   --Check that it worked
   ev.getPViewZOrder()
   --> 0
   --Get the width of the Event
   ev.getListWidth()
   --> 180
   --Set the width to something larger
   ev.setListWidth 300
   --> OK
   --It worked (you should see it in PView)
   ev.getPViewRightBoundary()
   --> 300
   --Make it smaller
   ev.setListWidth 100
   --> OK
   --Check where the right boundary is
   ev.getPViewRightBoundary()
   --> 100
   --Get the collapsed state of the Event - currently it will
   --always return false, this is for Future Use.
   ev.isCollapsed()
   --> false
   --Note: Not Implemented Yet!
   ev.collapse()
   --> OK
   --Note: Not Implemented Yet!
   ev.expand()
   --> OK
   --See if there are Events upstream - there are none
   ev.hasUpStream()
   --> false

This Interface is available in:

Event : Helper