Modify Frame Chain

RTSX Help: Modify a frame in frame structure

InsertFrame, DeleteFrame, ReplaceFrame

DeleteFrame

ReplaceFrame

Insert,delete, or replace a frame in a frame structure data created by Frame( ).

Syntax

  • F = InsertFrame(F, Fi, findex)
  • F = DeleteFrame(F, findex)
  • F = ReplaceFrame(F, Fi, findex)

Input Arguments

  • F  — a   frame structure created by Frame( )
  • Fi  — a   single frame created by Frame( )
  • findex  — frame index; i.e., the frame number to insert, delete, or replace

Output Arguments

  • F — modified frame data structure

Description

This group of functions is handy when a frame structure is already created by Frame( ) and later found that it needs some minor modification, such as adjusting only a single frame. Use InsertFrame( ), DeleteFrame( ), and ReplaceFrame( ) to insert, remove, and replace a frame at a location specified by findex. In the case of insertion and replacement, a new frame must first be created using Frame( ).

If you buit a chain with original frame structure before, you need to rebuild with SerialFrame( ) using the modified frame structure as input argument.

Examples

Try these commands to see what happens to the frame structure

// create a sequence of frames for testing
F(1)=Frame(eye(4,4),'name','U');   
F(2)=Frame(trotx(pi/2)*transl([0 1 1]),'name','V'); 
F(3)=Frame(transl([2 3 -1]),'abs','name','W');  
 // create a single frame for insertion/replacement
Fi=Frame(trotz(pi/4)*trans([-1 1 -1]),'name','X'); 
F = InsertFrame(F,Fi,2); 	// insert at location 2. Now F has 4 frames
F=DeleteFrame(F,4);	// delete frame 4. F is reduced to 3 frames
F=ReplaceFrame(F,Frame(trotz(pi/4)),3); // replace frame 3 with another new frame
F=InsertFrame(F,Frame([],'name','?'),3); // insert a blank frame at location 3
// after finish. Run SerialFrame( ) to create a chain
fc1 = SerialFrame(F,'name','Modified chain 1');

See Also