Kernel SDK Developer's Guide > Working with the Ge Library > Working with Points
Working with Points

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:

  • OdGePosition3d::OdGePosition3d() — Default constructor. Creates a point at (0,0,0).
  • OdGePosition3d::OdGePosition3d(const OdGePoint3d& point) — Creates a point object using OdGePoint3d object.
  • OdGePosition3d::OdGePosition3d(double x, double y, double z) — Creates a point object with specified coordinates.
  • OdGePosition3d::OdGePosition3d(const OdGePosition3d& source) — Creates a point object cloned from the source point object.

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.