As well as adding individual Frames to a FrameSet
(13.3), it is also possible to add complete sets of
inter-related Frames which are contained within another
FrameSet. This, of course, corresponds to the process of merging two
FrameSets (see Figure below).
Figure 15:
Two FrameSets in the process of being merged using
astAddFrame. FrameSet B is being added to FrameSet A by supplying a
new Mapping which inter-relates a nominated Frame in A (here number 1)
and the current Frame of B. In the merged FrameSet, the Frames
contributed by B will be re-numbered to become Frames 4, 5 and 6. The
base Frame will remain unchanged, but the current Frame of B becomes
the new current Frame. Note that FrameSet B itself is not
altered by this process.
|
This process is performed by adding one FrameSet to another using
astAddFrame, in much the same manner as when adding a new Frame to an
existing FrameSet (13.3). It is simply a matter of
providing a FrameSet pointer, instead of a Frame pointer, for the 4th
argument. In performing the merger you must, as usual, supply a
Mapping, but in this case the Mapping should relate the current Frame
of the FrameSet being added to one of the Frames already present. For
example, you might perform the merger shown in
Figure 15 as follows:
AstMapping *mapping;
...
astAddFrame( frameseta, 1, mapping, framesetb );
The Frames acquired by ``frameseta'' from the FrameSet being added
(``framesetb'') are re-numbered so that they retain their original
order and follow on consecutively after the Frames that were already
present, whose indices remain unchanged. The base Frame of
``frameseta'' remains unchanged, but the current Frame of
``framesetb'' becomes its new current Frame. All the
inter-relationships between Frames in both FrameSets remain in place
and are preserved in the merged FrameSet.
Note that while this process modifies the first FrameSet
(``frameseta''), it leaves the original contents of the one being
added (``framesetb'') unchanged.