A point object uses the position, normal, thickness, and ECS rotation properties to define the geometry to be drawn. In examples, the pPoint variable stores a pointer to the point object.
The Position property defines the position of the point in three-dimensional coordinates. The position has the coordinates (0,0,0) by default. The point is a planar entity. Many planes can be passed through a point.
To get the position, use the position() method which does not have arguments and returns the three-dimensional point as an instance of the OdGePoint3d type. For example:
OdGePoint3d position = pPoint->position();
odPrintConsoleString(L"\nPosition = (%g,%g,%g)", position.x, position.y, position.z);
To set the position, use the setPosition() method which requires the three-dimensional point as an argument of the OdGePoint3d type and does not return a value. For example:
OdGePoint3d point(4.2, 6.5, 1.8);
pPoint->setPosition(point);
The Normal property defines the normal to an arbitrary plane passed through the point, and this plane is used as the point plane. The normal has the coordinates (0,0,1) by default.
To get the normal, use the normal() method which does not have arguments and returns the three-dimensional vector as an instance of the OdGeVector3d type. For example:
OdGeVector3d normal = pPoint->normal();
odPrintConsoleString(L"\nNormal = (%g,%g,%g)", normal.x, normal.y, normal.z);
To set the normal, use the setNormal() method which requires the three-dimensional vector as an argument of the OdGeVector3d type and does not return a value. For example:
OdGeVector3d vector(0.606, 0.101, 0.303);
pPoint->setNormal(vector);
Note: The setNormal() method automatically converts the specified coordinates to a unit vector.
The Thickness property defines the thickness of the point as a Double value in drawing units. A positive value defines the thickness to be drawn along the normal direction. A negative value defines the thickness to be drawn in the opposite direction from the normal. A zero value defines a point without thickness. The thickness is zero by default.
To get the thickness, use the thickness() method which does not have arguments and returns the thickness as a Double value. For example:
odPrintConsoleString(L"\nThickness = %g", pPoint->thickness());
To set the thickness, use the setThickness() method which requires a Double value as an argument and does not return a value. For example:
pPoint->setThickness(1.5);
The ECS Rotation property defines the angle in radians between the OCS X-axis for the point based on the normal vector and the X-axis that will be used for displaying the point. This angle is used when PDMODE is non-zero. The angle is specified as a Double value in the range 0 to 2PI. A positive angle value is measured clockwise. A negative angle value is measured counterclockwise. ECS rotation is zero by default.
To get the ECS rotation, use the ecsRotation() method which does not have arguments and returns the angle as a Double value. For example:
odPrintConsoleString(L"\nECS Rotation = %g", pPoint->ecsRotation());
To set the ECS rotation, use the setEcsRotation() method which requires a Double value as an argument and does not return a value. For example:
pPoint->setEcsRotation(0.102);
Note: The setEcsRotation() method does not convert to an equivalent angle and sets the specified value
Example of Working with the Point Object
Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.
|