libSBML C API  5.18.0
LineSegment_t Class Reference

Detailed Description

layout Representation of a line.

The LineSegment_t class consists of the mandatory attribute xsi:type and two child elements of type Point_t. One is called 'start' and represents the starting point of the line, the other is called 'end' and represents the endpoint of the line. The LineSegment_t class is also the base class for CubicBezier_t, which represent curved lines instead of straight ones.

Public Member Functions

LineSegment_tLineSegment_clone (const LineSegment_t *ls)
 
LineSegment_tLineSegment_create (void)
 Creates a LineSegment_t with the default SBML level, version, and package version, and both points set to (0.0,0.0,0.0). More...
 
LineSegment_tLineSegment_createFrom (const LineSegment_t *temp)
 Creates a clone of temp, or creates a new empty LineSegment_t if temp is NULL. More...
 
LineSegment_tLineSegment_createWithCoordinates (double x1, double y1, double z1, double x2, double y2, double z2)
 Creates a LineSegment_t with the default SBML level, version, and package version, and with the given coordinates and returns the pointer. More...
 
LineSegment_tLineSegment_createWithPoints (const Point_t *start, const Point_t *end)
 Creates a LineSegment_t with the default SBML level, version, and package version, and with the given points and returns the pointer. More...
 
void LineSegment_free (LineSegment_t *ls)
 Frees the memory for the line segment. More...
 
Point_tLineSegment_getEnd (LineSegment_t *ls)
 Returns the end point of the line. More...
 
Point_tLineSegment_getStart (LineSegment_t *ls)
 Returns the start point of the line. More...
 
void LineSegment_initDefaults (LineSegment_t *ls)
 Does nothing since no defaults are defined for LineSegment_t. More...
 
void LineSegment_setEnd (LineSegment_t *ls, const Point_t *end)
 Initializes the end point with a copy of the given Point_t structure. More...
 
void LineSegment_setStart (LineSegment_t *ls, const Point_t *start)
 Initializes the start point with a copy of the given Point_t structure. More...
 

Member Function Documentation

LineSegment_t * LineSegment_clone ( const LineSegment_t ls)
Returns
a (deep) copy of this LineSegment_t, or NULL if ls is NULL.
Parameters
lsthe LineSegment_t structure.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
LineSegment_t * LineSegment_create ( void  )

Creates a LineSegment_t with the default SBML level, version, and package version, and both points set to (0.0,0.0,0.0).

Returns
A pointer to the created LineSegment_t.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
LineSegment_t * LineSegment_createFrom ( const LineSegment_t temp)

Creates a clone of temp, or creates a new empty LineSegment_t if temp is NULL.

Parameters
tempthe LineSegment_t structure to copy.
Returns
the created copy of the LineSegment_t
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
LineSegment_t * LineSegment_createWithCoordinates ( double  x1,
double  y1,
double  z1,
double  x2,
double  y2,
double  z2 
)

Creates a LineSegment_t with the default SBML level, version, and package version, and with the given coordinates and returns the pointer.

Parameters
x1the value of the x coordinate of the start Point_t.
y1the value of the y coordinate of the start Point_t.
z1the value of the z coordinate of the start Point_t.
x2the value of the x coordinate of the end Point_t.
y2the value of the y coordinate of the end Point_t.
z2the value of the z coordinate of the end Point_t.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
LineSegment_t * LineSegment_createWithPoints ( const Point_t start,
const Point_t end 
)

Creates a LineSegment_t with the default SBML level, version, and package version, and with the given points and returns the pointer.

Parameters
startthe Point_t at which the line segment starts.
endthe Point_t at which the line segment ends.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
void LineSegment_free ( LineSegment_t ls)

Frees the memory for the line segment.

Parameters
lsthe LineSegment_t structure.
Point_t * LineSegment_getEnd ( LineSegment_t ls)

Returns the end point of the line.

Parameters
lsthe LineSegment_t structure.
Note
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
Point_t * LineSegment_getStart ( LineSegment_t ls)

Returns the start point of the line.

Parameters
lsthe LineSegment_t structure.
Note
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
void LineSegment_initDefaults ( LineSegment_t ls)

Does nothing since no defaults are defined for LineSegment_t.

Parameters
lsthe LineSegment_t structure.
void LineSegment_setEnd ( LineSegment_t ls,
const Point_t end 
)

Initializes the end point with a copy of the given Point_t structure.

Parameters
lsthe LineSegment_t structure.
endthe Point_t at which the line segment ends.
void LineSegment_setStart ( LineSegment_t ls,
const Point_t start 
)

Initializes the start point with a copy of the given Point_t structure.

Parameters
lsthe LineSegment_t structure.
startthe Point_t at which the line segment starts.