Kernel SDK Developer's Guide > Working with the Ge Library > Working with Curves > Working with Curve Boundaries
Working with Curve Boundaries

The Ge library provides a representation for curve boundaries on a bounded surface using the OdGeCurveBoundary class.

Structurally, a OdGeCurveBoundary object consists of four arrays:

  • Array of 3D curve or position pointers
  • Array of 2D parameter space curve pointers
  • Array of 3D orientations
  • Array of 2D orientations

There is a one-to-one correspondence between elements in the arrays, although certain elements of a given array can be NULL, or meaningless. For example, the combination (curve3d*, NULL, false, true) is acceptable. The first element is a curve in 3D, the second element specifies that there is no 2D parametric representation for this curve. The third element specifies the logical direction of the 3D curve. The fourth element is the orientation for corresponding parameters space curve, which is specified as the opposite to the 3D curve orientation, but since there is no parameters space curve, this element isn't relevant.

To construct an OdGeCurveBoundary object, use an appropriate OdGeCurveBoundary() constructor:

  • OdGeCurveBoundary::OdGeCurveBoundary() — Default constructor. Creates an empty object.
  • OdGeCurveBoundary::OdGeCurveBoundary(int numCurves, const OdGeEntity3d *const * crv3d, const OdGeCurve2d *const * crv2d, bool* orientation3d, bool* orientation2d, bool makeCopy = true) — Creates an object with specified parameters: number of curves that compose the boundary, an array of 3D curves, an array of 2D parameters space curves, arrays of their logical orientations, and a special flag that sets whether the constructor makes a copy of 3D and 2D curves.
  • OdGeCurveBoundary::OdGeCurveBoundary(const OdGeCurveBoundary& source)) — Creates an object copied from the source object.

The set() method sets the parameters of the boundary:

OdGeCurveBoundary& OdGeCurveBoundary::set(int numCurves, const OdGeEntity3d *const * crv3d, const OdGeCurve2d *const * crv2d, bool* orientation3d, bool* orientation2d, bool makeCopy = true);

For example:

curveBoundary.set(3, curves3d, NULL, &orientation3d, &orientation2d);

To get the parameters of the boundary, use the getContour() method:

void OdGeCurveBoundary::getContour(int& numCurves, OdGeEntity3d*** crv3d, OdGeCurve2d*** crv2d, bool** orientation3d, bool** orientation2d) const;

For each array, provide memory for the array or allow getCountour to allocate it, and delete the elements of the array. If an array is NULL, getCountour allocates memory and the caller must also delete the corresponding array.

The number of elements can be also obtained using the numElements() method.

This class also supports the ownership of its geometry. Being the owner of its geometry causes it to remove the geometry on destruction of the boundary curve owner object. To set the boundary object to the owner of the curve data, use the setToOwnCurves() method:

OdGeCurveBoundary& OdGeCurveBoundary::setToOwnCurves();
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.