The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



SetItemParams


Unit:SDL_rot3d
Class:TRot3D
Declaration:procedure SetItemParams (Item: longint; ItParams: Tr3ChartItem);

The method SetItemParams sets the parameters of a single chart item. The input parameter Item is the index of the item (c.f. array property DataContainer). The parameter ItParams is of the type Tr3ChartItem and contains the information on the item.

Hint: With release 8.0 of the SDL Component Suite the data model of ROT3D has been changed from a linked list to a dynamic array which is accessible via the array property DataContainer. The method SetItemParams has been kept for compatibility purposes, future designs should use the property DataContainer.


Example: For the following example suppose that the user has clicked the mouse somewhere on the chart area. The code below shows how to change the color of the nearest item on the chart to the color "clLime".
 
var 
  Item  : longint; 
  ItPar : Tr3ChartItem; 
  dist  : double; 

begin 
with Rot3D1 do 
  begin 
  Item := FindNearestItemScreen (MousePosX, MousePosY, tkEverything, dist); 
  if Item <> -1 then 
    begin 
    Itpar := GetItemParams (Item); 
    ItPar.Color := clLime; 
    SetItemParams (Item, ItPar); 
    MakeVisible; 
    end; 
  end; 
end; 

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): exrot3d



Last Update: 2012-Oct-20