A NurbsCurveList is a kind of Geometry and is a collection of NurbsCurve objects.
We can navigate the NurbsCurveList using the generic terms such as Points or we can choose to use navigate using terms that are specific to the NurbsCurveList such as NurbsCurves, ControlPoints. There are some functions that do not fit with a generic terms such as Knots, which are specific to NURBS, this is why there are specific terms as well as generic terms.
A nurbs curve is defined as follows (surface can be defined similarly in 2 dimensions degree): k, order: k+1, Number of Control Points: n, Knot sequence = t(0), t(1)... t(k)... t(n)... t(n+k+1) Where the knot sequence is non-decreasing which means t(0) <= t(1) <= ..... <= t(n)... <= t(n+k+1)
The above is a general definition for a nurbs curve and IGES standard supports this definition. However in most industrial design systems, people put some constraints on the knot sequence: for a degree k curve, the first k+1 knots and the last k+1 knots are equal, e.g. t(0) = t(1) = ... = t(k) and t(n+1) = t(n+2) =... = t(n+k+1). This ensures the curve passes the start ControlPoint and end ControlPoint which is a nice property to control the final shape of nurbs curve. For now we only support this constrained version of IGES format as we expect most design systems are using this format.
using namespace XSI; Application app; Model root = app.GetActiveSceneRoot(); X3DObject myArc; root.AddGeometry( L"Arc", L"NurbsCurve", L"", myArc ); NurbsCurveList curvelist( myArc.GetActivePrimitive().GetGeometry() );
#include <xsi_nurbscurvelist.h>
Public Member Functions |
|
NurbsCurveList () | |
~NurbsCurveList () | |
NurbsCurveList (const CRef &in_ref) | |
NurbsCurveList (const NurbsCurveList &in_obj) | |
NurbsCurveList (const Geometry &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
NurbsCurveList & | operator= (const NurbsCurveList &in_obj) |
NurbsCurveList & | operator= (const Geometry &in_geom) |
NurbsCurveList & | operator= (const CRef &in_ref) |
CStatus | GetClosed (bool &out_bClosed) const |
CNurbsCurveRefArray | GetCurves () const |
CControlPointRefArray | GetControlPoints () const |
CStatus | GetLength (double &out_dLength) const |
CStatus | GetClosestCurvePosition (MATH::CVector3 &in_vPosition, LONG &out_lCurveIndex, double &out_dSquaredDistance, double &out_dUValue, MATH::CVector3 &out_vPosition) const |
CStatus | Get (siNurbsFormat in_siNurbsFormat, CNurbsCurveDataArray &out_curves) const |
CStatus | Set (const CNurbsCurveDataArray &in_curves, siNurbsFormat in_siNurbsFormat=siSINurbs) |
CStatus | AddCurve (const CNurbsCurveData &in_curve, siNurbsFormat in_siNurbsFormat, NurbsCurve &out_NurbsCurve) |
NurbsCurveList | ( | ) |
Default constructor.
~NurbsCurveList | ( | ) |
Default destructor.
NurbsCurveList | ( | const CRef & | in_ref | ) |
Constructor.
in_ref | constant reference object. |
NurbsCurveList | ( | const NurbsCurveList & | in_obj | ) |
Copy constructor.
in_obj | constant class object. |
NurbsCurveList | ( | const Geometry & | in_obj | ) |
Copy constructor.
in_obj | Geometry object. |
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from Geometry.
siClassID GetClassID | ( | ) | const [virtual] |
NurbsCurveList& operator= | ( | const NurbsCurveList & | in_obj | ) |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
in_obj | constant class object. |
NurbsCurveList& operator= | ( | const Geometry & | in_geom | ) |
Creates a Polygon object from a Geometry object. The newly created object is set to empty if the input Geometry object is not compatible.
in_geom | Source geometry |
Reimplemented from Geometry.
NurbsCurveList& operator= | ( | const CRef & | in_ref | ) |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
in_ref | constant class object. |
Reimplemented from Geometry.
CStatus GetClosed | ( | bool & | out_bClosed | ) | const |
Returns true if the curve list is closed or false otherwise.
out_bClosed | return true if the curve list is closed or false otherwise. |
CNurbsCurveRefArray GetCurves | ( | ) | const |
Returns an array of all NurbsCurve objects on this NurbsCurveList object.
CControlPointRefArray GetControlPoints | ( | ) | const |
Returns an array of all ControlPoint objects on this NurbsCurveList object.
CStatus GetLength | ( | double & | out_dLength | ) | const |
Returns an array of all ControlPoint objects on this NurbsCurveList object. This corresponds to the sum of the length of the NurbsCurve composing this NurbsCurveList.
out_dLength | returns the length of the NurbsCurveList |
CStatus GetClosestCurvePosition | ( | MATH::CVector3 & | in_vPosition, |
LONG & | out_lCurveIndex, | ||
double & | out_dSquaredDistance, | ||
double & | out_dUValue, | ||
MATH::CVector3 & | out_vPosition | ||
) | const |
Returns the curve index, position of the point on it, U value and distance from the given position.
in_vPosition | A position expressed in the NurbsCurveList object frame of reference. |
out_lCurveIndex | The curve index to which the position is the closest. |
out_dSquaredDistance | The squared distance of the specified position to the curve point. |
out_dUValue | The corresponding UValue on the NurbsCurve. |
out_vPosition | The actual curve point position at U value. |
CStatus Get | ( | siNurbsFormat | in_siNurbsFormat, |
CNurbsCurveDataArray & | out_curves | ||
) | const |
Returns a complete data description of this nurbs curve list.
in_siNurbsFormat | Specifies how the data is formatted. |
out_curves | The entire curve data description. |
CStatus Set | ( | const CNurbsCurveDataArray & | in_curves, |
siNurbsFormat | in_siNurbsFormat =
siSINurbs |
||
) |
Sets the current NurbsCurveList geometry, from a complete data description of a nurbs curve list. This is only available from compiled operators. If you use it on a object with clusters and you change the topology the burden of updating the clusters is on the user.
in_curves | The data for the new representation of this NurbsCurveList. |
in_siNurbsFormat | Specifies how the data is formatted. |
CStatus AddCurve | ( | const CNurbsCurveData & | in_curve, |
siNurbsFormat | in_siNurbsFormat, | ||
NurbsCurve & | out_NurbsCurve | ||
) |
Adds a curve to this NurbsCurveList object.
in_curve | The data description for the new NurbsCurve. |
in_siNurbsFormat | Specifies how the data is formatted. |
out_NurbsCurve | The new NurbsCurve. |