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