DInsight Home

ILineGeom Interface

# ILineGeom Interface

RotatePoint
IntersectPlane
GetNearestPoint

ILineGeom interface allows performing calculations related to an arbitrary line in 3D space. ILineGeom can be queried from ILine, which is normally created as an independent object using IDIObjejGenerator.Create or IDIObjGenerator.Create2 of the Object Generator with eType parameter set to 1 which is value of the eObjTypeLine member form the Object Type enumeration.

HRESULT RotatePoint(double degrees, DIPoint* point)

Parameters

degrees- [in] angle in degrees to rotate by, which can be negative

point - [in,out] Point to be rotated around the line, which implements the interface

Returns

DISP_E_PARAMNOTOPTIONAL if point is a NULL reference.

DI_E_INVALIDGEOMETRY if direction vector of the line has zero length. Use ILine.GetDirection and ILineSetDirection to access the property.

S_OK in case of success.

Remarks:

The method changes the point to its position after rotation around the line. Result depends on sign of degrees. Positive values produce CCW rotations if looking in direction opposite to the direction of line. Position and direction of the line can be specified using ILine interface of the same object.

HRESULT IntersectPlane(DIPoint* locationPlane, DIVect* normalPlane, double* position, int* result )

Parameters

locationPlane- [in] Point the plane passes through

normalPlane - [in] Normal of the plane

position - [out] calculated position of the intersection point on the line. (Dist to the origin of the line). position can be supplied to ILine.GetPoint to obtain 3D coordinates of the intersection

result - [out] Result code. 0 - if failed. (See below), 1 - if success, 2 - if the line belongs to the plane and there is no intersection, 3 - if the line is parallel to the plane and there is no intersection.

Returns

DISP_E_PARAMNOTOPTIONAL if any of the parameters is NULL.

DI_E_INVALIDGEOMETRY if direction vector of the line or normal has zero length.

S_OK in case of success.

Remarks:

The method calculates intersection of the line, which implements this interface (the line where this ILineMetr was queried from) with the specified 3D plane. Position and direction of the line can be specified using ILine interface of the same object. Direction of the line and normalPlane must not be zero vectors. Use ILine.GetPoint to convert position  to 3D coordinates of the intersection point. The result  return code can be used to determine relative orientation of the line and the plane.

HRESULT GetNearestPoint(DIPoint* point, double* position, double* distance )

Parameters

point- [in] point in 3D space to which the nearest position on the line is to be found

position - [out] calculated position of the nearest point on the line. (Dist to the origin of the line). position can be supplied to ILine.GetPoint to obtain 3D coordinates of the intersection.

distance - [out] Calculated distance from point to the line, which is equal to distance form point to the nearest point.

Returns

DISP_E_PARAMNOTOPTIONAL if any of the parameters is NULL.

DI_E_INVALIDGEOMETRY if direction vector of the line has zero length.

S_OK in case of success.

Remarks:

The method calculates distance from point to the line, which implements this interface (the line where this ILineMetr was queried from). Position of the nearest point on the line returned in position. Use ILine.GetPoint to convert position  to 3D coordinates of the intersection point.