sclViewports
Overview
The 3D Graphics environment that Scl integrates with has viewports that string and triangle data are drawn in. There is always at least one viewport but there may be more than one viewport, depending on your actions.
The sclViewports command permits access to the set of viewports that exist at any point in time. The sclViewports command can be used with the Scl iterator commands, SclCountItems and SclGetItem commands to obtain the handles to viewports in this set of viewports.
Synopsis
sclViewports <other command> <other arguments>
Description
The sclViewports command represents the set of viewports that exist at any time for the 3D graphics environment.
Arguments
- <other command>
- SclIterateFirst
- SclIterateLast
- SclIterateNext
- SclIteratePrev
- SclCountItems
- SclGetItem
- <other arguments>
sclViewports represents the set of viewports that exist in the 3D graphics environment. The commands that may be used with the sclViewport command are:
To initialise an iterator for iterating forward through the set of viewports.
To initialise an iterator for iterating backwards through the set of viewports.
To iterate forwards through the set of viewports and return the handle to the next viewport.
To iterate backwards through the set of viewports and return the handle to the previous viewport.
To obtain a count of the number of viewports that exist in the set.
To get the handle of a viewport at a specific position in the set of viewports
Depending on the <other command> applied to the sclViewports command additional arguments may be required. Details of these can be found by consulting the documentation on the commands listed above.
Examples
#
# This example shows how a count of the number of viewports in the set of
# viewports can be obtained and also how a viewport at a specified position
# in the set of viewports can be obtained and assigned to a variable
#
set count [sclViewports SclCountItems]
puts "There are $count viewports in the set of Viewports"
for {set i 0} {$i < $count} {incr i} {
sclViewports SclGetItem ViewportHandle $i
puts "The viewport at position $i is [$ViewportHandle SclGetId]"
}
|
#
# This example shows how the iterator commands are used to iterate
# forward through the set of viewports and display the name of each
# viewport that exists
#
sclViewports SclIterateFirst Iterator
while {[$Iterator SclIterateNext ViewportHandle] == $SCL_TRUE} {
puts "Viewport id = [$ViewportHandle SclGetId]"
}
|