GetSectionOfCurve

GetSectionOfCurve returns a section of a curve. It has three parameters. The first two parameters are 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 third parameter is type TGCurve to return the specified section of the curve. When the first parameter value is less than the second parameter value, the direction of the curve section is reversed.

The following code fragment finds a section of the curve in Figure 49, and Figure 50 shows the section of the curve returned by GetSectionOfCurve.


This code fragment returns the section of the curve that lies between the points defined by parameter values .25 and .75.

      TFrameBundle frameBundle( TRGBColor( 0, 0, 0 ), 5.0 );
           TGCurve cubicCurve( TGPoint( 25, 125 ), 
                          TGPoint( 45, 200 ),
                          TGPoint( 95, 175 ),
                          TGPoint( 70, 150 ) );
      
      TGCurve section;
      cubicCurve.GetSectionOfCurve( .25, .75, section );
      
      thePort.Draw( section, franeBundle );

[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