インタフェース: ActionList

 
 
 

アクション リストのインタフェースは、イベント クラスによって公開されます。

このインタフェースによって、アクションをイベントに対して追加および削除したり、リスト上でアクションのタイプをテストしたり、[パーティクル ビュー](Particle View)でのイベントの外観をコントロールできます。

   

メソッド:

<integer><PF_Event>.numActions() 	 

リスト内の値のアクションの数を返します。

   

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

リストからインデックスで指定されたアクションを返します。

   

<bool><PF_Event>.appendAction <node>action 

指定したアクションをリストに追加して、成功したら true を返します。

例の詳細は、「VolumeDocking サンプル スクリプト」を参照してください。

   

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

指定したアクションをリスト内の、インデックス値で定義された位置に挿入します。正常に終了した場合、 true を戻します。

例の詳細は、「VolumeDocking サンプル スクリプト」を参照してください。

   

<bool><PF_Event>.removeAction <index>index 

リストからインデックスで指定されたアクションを削除します。正常に終了した場合は true を戻します。

   

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

index is In and Out parameter

指定したアクションがリスト上に存在する場合は、true を返します。true の場合、参照インデックス変数には、リスト上に存在するアクションの実際のインデックスが格納されます。

   

<bool><PF_Event>.isAction<node>action 

指定されたノードがアクションである場合、true を返します。

   

<bool><PF_Event>.isOperator<node>action 

指定されたノードがオペレータである場合、true を返します。

   

<bool><PF_Event>.isTest<node>action 

指定されたノードがテストである場合、true を返します。

   

<bool><PF_Event>.isActivated() 

アクティブであれば true を返します。

   

<void><PF_Event>.activate<bool>active 

アクティブ パラメータによって指定されるブール値にアクティブな状態を設定します。

   

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

インデックスで指定されたアクションがアクティブな場合は 1、そうでない場合は 0 を返します。

   

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

インデックスで指定されたアクションのアクティブ フラグを設定します。0 = 非アクティブ、1 = アクティブ

   

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

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

参照パラメータ内の[パーティクル ビュー](Particle View)の x と y の場所を返します。

   

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

[パーティクル ビュー](Particle View)の場所を、指定された整数値に設定します。

X と Y の範囲は 0 から 64000 までです。

   

<integer><PF_Event>.getPViewZOrder() 

[パーティクル ビュー](Particle View)の[Z 配列](Z Order)を返します。

   

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

[パーティクル ビュー](Particle View)の[Z 配列](Z Order)を設定します。範囲は 0 から 64000 までです。

   

<integer><PF_Event>.getListWidth() 

リスト幅を返します。

   

<void>setListWidth<integer>width 

リストの幅を設定します。範囲は 100 から 1000 ピクセルまでです。

   

<integer><PF_Event>.getPViewRightBoundary() 

[パーティクル ビュー](Particle View)の右側の境界を返します。

   

<bool><PF_Event>.isCollapsed() 

アクション リストが集約されている場合、true を返します。

注:集約はまだ実装されていません

   

<void><PF_Event>.collapse() 

アクション リストを集約します。

注:集約はまだ実装されていません

   

<void><PF_Event>.expand() 

アクション リストを展開します。

注:展開はまだ実装されていません

   

<bool><PF_Event>.hasUpStream() 

アクション リストにアップ ストリームのリストがある場合は true を返します。

例と結果

--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 &endash; 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 &endash;
--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&endash; 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 &endash; there are none
ev.hasUpStream()
false

このインタフェースは下記で使用できます。

Event: ヘルパー