DragPosition

DragPosition changes the shape of a curve by moving a point to a specified location. It has two parameters. The first is type GCoordinate to represent parameter values between 0 and 1, where 0 represents the first point in the curve and 1 represents the last. The second parameter is type TGPoint which is where the point on the curve specified in the first parameter gets moved. The following code fragment moves a point in the Figure 49 curve so that it looks like the curve in Figure 51.


This code fragment changes the shape of cubicCurve so that the point defined by parameter value.25 is moved to TGPoint( 50, 100 ).

      TFrameBundle frameBundle( TRGBColor( 0, 0, 0 ), 5.0 );
       TGCurve cubicCurve( TGPoint( 25, 125 ), 
                          TGPoint( 45, 200 ),
                          TGPoint( 95, 175 ),
                          TGPoint( 70, 150 ) );
      
      cubicCurve.DragPosition( .25, TGPoint( 50, 100 ) );
      
      thePort.Draw( cubicCurve, frameBundle );

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker