Point objects (locations) are represented by the OdGePosition2d and OdGePosition3d classes and inherit the functionality of the OdGePointEnt2d and OdGePointEnt3d classes respectively. This topic demonstrates the most common operations with points as an object of the OdGePosition3d class. The functionality of 2D point objects is similar.
For creation of a point object, you can use one of the OdGePosition3d constructors:
To set the parameters of the location, use the set() method. Use x-,y-,z-coordinates or an OdGePoint3d object as parameters:
OdGePosition3d() pos1, pos2(0,1,0);
pos1.set(OdGePoint3d(10,0,0));
pos2.set(10,10,10);
The point3d() method transforms the location object to an object of the OdGePoint3d class.
OdGePoint3d point1 = pos1.point3d();
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|