VizRT Color Position


structure onoffcontainer
dMSDifference as double
dXDiff as double
sContainerName as string
end structure

dim iLineNumber = (integer) 8
dim sLinePrefix = (string) “ONOFF_LINE_”
dim sLinesDomain = (string) “ANI_DATA”
dim sNameTextName = (string) “txt_name”
dim sColorContainerName = (string) “ONOFF_COLOR”
dim bMultipages = (boolean) false
dim sPagePrefix = (string) “PAGE_”
‘ max site differences when elements are “ON”
dim dMSBase = (double) 1150
dim dColorXBase = -141
‘ setter tous les ONOFF qui agissent sur le maxsize
dim oRank as onoffcontainer
oRank.dMSDifference = 65
oRank.dXDiff = 29
oRank.sContainerName = “ONOFF_RANK”
dim oBib as onoffcontainer
oBib.dMSDifference = 107
oBib.dXDiff = 45.5
oBib.sContainerName = “ONOFF_BIB”
dim oNoc as onoffcontainer
oNoc.dMSDifference = 83
oNoc.dXDiff = 35.5
oNoc.sContainerName = “ONOFF_NOC”
dim oFlag as onoffcontainer
oFlag.dMSDifference = 75
oFlag.dXDiff = 31
oFlag.sContainerName = “ONOFF_FLAG”

dim oTime as onoffcontainer
oTime.dMSDifference = 205
oTime.dXDiff = 0
oTime.sContainerName = “ONOFF_TIME”
dim oIrm as onoffcontainer
oIrm.dMSDifference = 205
oIrm.dXDiff = 0
oIrm.sContainerName = “ONOFF_IRM”
dim oQual as onoffcontainer
oQual.dMSDifference = 108
oQual.dXDiff = 0
oQual.sContainerName = “ONOFF_QUALIFIED”

dim arrOnOff as array[onoffcontainer]
arrOnOff.push(oRank)
arrOnOff.push(oBib)
arrOnOff.push(oNoc)
arrOnOff.push(oFlag)
arrOnOff.push(oTime)
arrOnOff.push(oIrm)
arrOnOff.push(oQual)

sub OnInitParameters()
RegisterPushButton(“checkonoff”,”Check on/offs”, 1)
end sub
sub OnExecAction(buttonId As Integer)
if bMultipages then
TreatMultipagesLines()
else
TreatLines()
end if
end sub
sub TreatLines()
dim i = (integer) 0
for i=1 to iLineNumber
dim cBaseContainer = (container) scene.findcontainer(sLinePrefix&i).findsubcontainer(sLinesDomain)
dim cTextContainer = (container) cBaseContainer.findsubcontainer(sNameTextName)
dim cColorContainer = (container) cBaseContainer.findsubcontainer(sColorContainerName)
dim dMSBaseTemp = (double) dMSBase

dim dColorXBaseTemp = (double) dColorXBase

For Each j In arrOnOff
if cBaseContainer.findsubcontainer(j.sContainerName).active == true then
dMSBaseTemp = dMSBaseTemp-j.dMSDifference
dColorXBaseTemp = dColorXBaseTemp+j.dXDiff
end if
Next

cTextContainer.GetFunctionPluginInstance(“Maxsize”).SetParameterDouble(“WIDTH_X”,dMSBaseTemp)
cColorContainer.position.x = dColorXBaseTemp
next
end sub

sub TreatMultipagesLines()
dim i = (integer) 0
for p=1 to 2
for i=1 to iLineNumber
dim cBaseContainer = (container) scene.findcontainer(sPagePrefix&p).findsubcontainer(sLinePrefix&i).findsubcontainer(sLinesDomain)
dim cTextContainer = (container) cBaseContainer.findsubcontainer(sNameTextName)
dim cColorContainer = (container) cBaseContainer.findsubcontainer(sColorContainerName)
dim dMSBaseTemp = (double) dMSBase
dim dColorXBaseTemp = (double) dColorXBase
dim iVal = (string) p
System.SendCommand(iVal)
For Each j In arrOnOff
if cBaseContainer.findsubcontainer(j.sContainerName).active == true then
dMSBaseTemp = dMSBaseTemp-j.dMSDifference
dColorXBaseTemp = dColorXBaseTemp+j.dXDiff
end if
Next

dim dMSBaseTemp2 = (double) dMSBaseTemp

cTextContainer.GetFunctionPluginInstance(“Maxsize”).SetParameterDouble(“WIDTH_X”,dMSBaseTemp)
cColorContainer.position.x = dColorXBaseTemp+15
next
next
end sub