DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Collapse ModelsModels
Collapse DG Kernel ComponentsDG Kernel Components
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
Collapse ModelModel
Collapse ViewView
Collapse General ComputingGeneral Computing
Collapse Samples and TutorialsSamples and Tutorials
Collapse GraphicsGraphics
Collapse Math ObjectsMath Objects
Collapse DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Search Documentation


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.

See also: Interface list


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 interentity point on the line. (Dist to the origin of the line). position can be supplied to ILine.GetPoint to obtain 3D coordinates of the interentity

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

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 interentity 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 interentity 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 interentity.

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 interentity point.