static sgCSpline*   sgCSpline::Create(const SG_SPLINE& splGeo)

 

Description:

Creates an object of the SPLINE class.

 

Arguments:

splGeom - the spline geometry. Read more about the spline geometry at SG_SPLINE

 

Returned value:

Returns the pointer to the created object. Otherwise NULL.

 

Following shortening is set:

#define  sgCreateSpline    sgCSpline::Create

 

Note:

If the geometry isn't used after creating the spline you must delete it using the Delete function

 

 

Example:

 

SG_POINT tmpPnt;

 

SG_SPLINE* splGeo = SG_SPLINE::Create();

 

tmpPnt.x = 1.0; tmpPnt.y = -3.0; tmpPnt.z = 0.0;

splGeo->AddKnot(tmpPnt,0);

tmpPnt.x = 3.0; tmpPnt.y = -2.0; tmpPnt.z = 0.0;

splGeo->AddKnot(tmpPnt,1);

tmpPnt.x = 2.0; tmpPnt.y = -1.0; tmpPnt.z = 0.0;

splGeo->AddKnot(tmpPnt,2);

tmpPnt.x = 3.0; tmpPnt.y = 1.0; tmpPnt.z = 0.0;

splGeo->AddKnot(tmpPnt,3);

tmpPnt.x = 2.0; tmpPnt.y = 4.0; tmpPnt.z = 0.0;

splGeo->AddKnot(tmpPnt,4);

tmpPnt.x =4.0; tmpPnt.y = 5.0; tmpPnt.z = 0.0;

splGeo->AddKnot(tmpPnt,5);

 

sgCSpline* spl_obj = sgCreateSpline(*splGeo);

 

SG_SPLINE::Delete(splGeo);

 

 

See also:

Objects hierarchy   sgCObject methods   SG_SPLINE SG_POINT