Lines

A line defines segments that are defined by two endpoints with an implied direction that moves from the start point to the end point.

TLine3D DragPosition GetPoints NearestParametric
Evaluate GetStartPoint Reverse Direction
GetEndPoint Length SetEndPoint
SetStartPoint

The following code fragment creates the lines shown in Figure 154. The DragPosition function (the declaration is shown below) moves the line so that the point specififed by parameter u is moved to the location of parameter point. A value of 1 causes the endpoint to move, and a value of zero causes the start point to move. For values between zero and 1, both the endpoint and start point move in proportion to the parametric distance. See the online Class and Member function descriptions for more information.

      virtual void DragPosition( GParametric u, const TGPoint3D point );

      TGLine3D lineGeometry(  TGPoint3D( 0, 0, 0), TGPoint3D( 100, -100, 150 ) );
      TLine3D line( lineGeometry );
      TFrameBundle3D frameBundle( TRGBColor( 0, 0, 0 ), 2.0 );
      line.AdoptBundle( new TGrafBundle3D( frameBundle ) );
      line.Draw( thePort );
      line.DragPosition( 1, TGPoint3D( 25, -75, 125 ) );
      line.Draw( thePort );

[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