SpatiaLite  4.2.0
 All Data Structures Files Functions Variables Typedefs Macros Pages
Functions
gg_dynamic.h File Reference

Geometry handling functions: DynamicLine handling. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaAllocDynamicLine (void)
 Creates a new dynamicly growing line/ring object. More...
 
GAIAGEO_DECLARE void gaiaFreeDynamicLine (gaiaDynamicLinePtr p)
 Destroys a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaAppendPointToDynamicLine (gaiaDynamicLinePtr p, double x, double y)
 Appends a new 2D Point [XY] at the end of a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaAppendPointZToDynamicLine (gaiaDynamicLinePtr p, double x, double y, double z)
 Appends a new 3D Point [XYZ] at the end of a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaAppendPointMToDynamicLine (gaiaDynamicLinePtr p, double x, double y, double m)
 Appends a new 2D Point [XYM] at the end of a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaAppendPointZMToDynamicLine (gaiaDynamicLinePtr p, double x, double y, double z, double m)
 Appends a new 3D Point [XYZM] at the end of a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaPrependPointToDynamicLine (gaiaDynamicLinePtr p, double x, double y)
 Appends a new 2D Point [XY] before the first one of a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaPrependPointZToDynamicLine (gaiaDynamicLinePtr p, double x, double y, double z)
 Appends a new 3D Point [XYZ] before the first one of a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaPrependPointMToDynamicLine (gaiaDynamicLinePtr p, double x, double y, double m)
 Appends a new 2D Point [XYM] before the first one of a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaPrependPointZMToDynamicLine (gaiaDynamicLinePtr p, double x, double y, double z, double m)
 Appends a new 3D Point [XYZM] before the first one of a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineInsertAfter (gaiaDynamicLinePtr p, gaiaPointPtr pt, double x, double y)
 Appends a new 2D Point [XY] immediately after the given Point into a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineInsertBefore (gaiaDynamicLinePtr p, gaiaPointPtr pt, double x, double y)
 Appends a new 2D Point [XY] immediately before the given Point into a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE void gaiaDynamicLineDeletePoint (gaiaDynamicLinePtr p, gaiaPointPtr pt)
 Removes a given Point from a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaCloneDynamicLine (gaiaDynamicLinePtr org)
 Duplicates a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaReverseDynamicLine (gaiaDynamicLinePtr org)
 Duplicates and reverts a dynamically growing line/ring object. More...
 
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaDynamicLineSplitBefore (gaiaDynamicLinePtr org, gaiaPointPtr point)
 Cuts a dynamically growing line/ring in two halves, using a given cut point. More...
 
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaDynamicLineSplitAfter (gaiaDynamicLinePtr org, gaiaPointPtr point)
 Cuts a dynamically growing line/ring in two halves, using a given cut point. More...
 
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaDynamicLineJoinAfter (gaiaDynamicLinePtr org, gaiaPointPtr point, gaiaDynamicLinePtr toJoin)
 Merges two dynamically growing line/ring object into a single one. More...
 
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaDynamicLineJoinBefore (gaiaDynamicLinePtr org, gaiaPointPtr point, gaiaDynamicLinePtr toJoin)
 Merges two dynamically growing line/ring object into a single one. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineFindByCoords (gaiaDynamicLinePtr p, double x, double y)
 Finds a Point within a dymically growing line/ring object [by coords]. More...
 
GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineFindByPos (gaiaDynamicLinePtr p, int pos)
 Finds a Point within a dymically growing line/ring object [by position]. More...
 
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaCreateDynamicLine (double *coords, int points)
 Creates a new dynamicly growing line/ring object. More...
 

Detailed Description

Geometry handling functions: DynamicLine handling.

Function Documentation

GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaAllocDynamicLine ( void  )

Creates a new dynamicly growing line/ring object.

Returns
the pointer to newly created object
See Also
gaiaCreateDynamicLine, gaiaFreeDynamicLine
Note
you are responsible to destroy (before or after) any allocated dynamically growing line/ring object.
GAIAGEO_DECLARE gaiaPointPtr gaiaAppendPointMToDynamicLine ( gaiaDynamicLinePtr  p,
double  x,
double  y,
double  m 
)

Appends a new 2D Point [XYM] at the end of a dynamically growing line/ring object.

Parameters
ppointer to the dynamically growing line/ring object.
xX coordinate of the Point
yY coordinate of the Point
mM measure of the Point
Returns
the pointer to newly created Point
GAIAGEO_DECLARE gaiaPointPtr gaiaAppendPointToDynamicLine ( gaiaDynamicLinePtr  p,
double  x,
double  y 
)

Appends a new 2D Point [XY] at the end of a dynamically growing line/ring object.

Parameters
ppointer to the dynamically growing line/ring object.
xX coordinate of the Point
yY coordinate of the Point
Returns
the pointer to newly created Point
GAIAGEO_DECLARE gaiaPointPtr gaiaAppendPointZMToDynamicLine ( gaiaDynamicLinePtr  p,
double  x,
double  y,
double  z,
double  m 
)

Appends a new 3D Point [XYZM] at the end of a dynamically growing line/ring object.

Parameters
ppointer to the dynamically growing line/ring object.
xX coordinate of the Point
yY coordinate of the Point
zZ coordinate of the Point
mM measure of the Point
Returns
the pointer to newly created Point
GAIAGEO_DECLARE gaiaPointPtr gaiaAppendPointZToDynamicLine ( gaiaDynamicLinePtr  p,
double  x,
double  y,
double  z 
)

Appends a new 3D Point [XYZ] at the end of a dynamically growing line/ring object.

Parameters
ppointer to the dynamically growing line/ring object.
xX coordinate of the Point
yY coordinate of the Point
zZ coordinate of the Point
Returns
the pointer to newly created Point
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaCloneDynamicLine ( gaiaDynamicLinePtr  org)

Duplicates a dynamically growing line/ring object.

Parameters
orgpointer to dynamically growing line/ring object [origin].
Returns
the pointer to newly created dynamic growing line/ring object: NULL on failure.
Note
the newly created object is an exact copy of the original one.
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaCreateDynamicLine ( double *  coords,
int  points 
)

Creates a new dynamicly growing line/ring object.

Parameters
coordsan array of COORDs, any dimension [XY, XYZ, XYM, XYZM]
pointsnumber of points [aka vertices] into the array
Returns
the pointer to newly created object
See Also
gaiaAllocDynamicLine, gaiaFreeDynamicLine, gaiaLinestringStruct, gaiaRingStruct
Note
you are responsible to destroy (before or after) any allocated dynamically growing line/ring object.
The COORDs array is usually expected to be one found within a gaiaLinestring or gaiaRing object.
GAIAGEO_DECLARE void gaiaDynamicLineDeletePoint ( gaiaDynamicLinePtr  p,
gaiaPointPtr  pt 
)

Removes a given Point from a dynamically growing line/ring object.

Parameters
ppointer to dynamically growing line/ring object.
ptpointer to given Point.
Note
the given Point (referenced by its address) will be removed from the dynamically growin line/ring object.
the given Point will be then implicitly destroyed.
GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineFindByCoords ( gaiaDynamicLinePtr  p,
double  x,
double  y 
)

Finds a Point within a dymically growing line/ring object [by coords].

Parameters
ppointer to dymamically line/ring object.
xPoint X coordinate.
yPoint Y coordinate.
Returns
the pointer to the corresponding Point object: NULL on failure.
See Also
gaiaDynamicLineFindByPos
Note
if the line object contains more Points sharing the same coordinates, a reference to the first one found will be returned.
GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineFindByPos ( gaiaDynamicLinePtr  p,
int  pos 
)

Finds a Point within a dymically growing line/ring object [by position].

Parameters
ppointer to dymamically line/ring object.
posrelative position [first Point has index 0].
Returns
the pointer to the corresponding Point object: NULL on failure.
See Also
gaiaDynamicLineFindByCoords
GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineInsertAfter ( gaiaDynamicLinePtr  p,
gaiaPointPtr  pt,
double  x,
double  y 
)

Appends a new 2D Point [XY] immediately after the given Point into a dynamically growing line/ring object.

Parameters
ppointer to the dynamically growing line/ring object.
ptpointer to the given Point.
xX coordinate of the Point to be appended
yY coordinate of the Point to be appended
See Also
gaiaDynamicLiceInsertBefore
Returns
the pointer to newly created Point
GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineInsertBefore ( gaiaDynamicLinePtr  p,
gaiaPointPtr  pt,
double  x,
double  y 
)

Appends a new 2D Point [XY] immediately before the given Point into a dynamically growing line/ring object.

Parameters
ppointer to the dynamically growing line/ring object.
ptpointer to the given Point.
xX coordinate of the Point to be appended
yY coordinate of the Point to be appended
See Also
gaiaDynamicLiceInsertBeforeAfter
Returns
the pointer to newly created Point
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaDynamicLineJoinAfter ( gaiaDynamicLinePtr  org,
gaiaPointPtr  point,
gaiaDynamicLinePtr  toJoin 
)

Merges two dynamically growing line/ring object into a single one.

Parameters
orgpointer to the first input object [first line].
pointpointer to the reference Point object.
toJoinpointer to the second input object [second line].
Returns
the pointer to newly created dynamically growing line/ring object [merged line]: NULL on failure.
See Also
gaiaDynamicLineJoinBefore
Note
the reference Point must exists into the first line: the second line will then be inserted immediately after the reference Point.
The newly created object will represent the resulting merged line:
both input objects remain untouched.
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaDynamicLineJoinBefore ( gaiaDynamicLinePtr  org,
gaiaPointPtr  point,
gaiaDynamicLinePtr  toJoin 
)

Merges two dynamically growing line/ring object into a single one.

Parameters
orgpointer to the first input object [first line].
pointpointer to the reference Point object.
toJoinpointer to the second input object [second line].
Returns
the pointer to newly created dynamically growing line/ring object [merged line]: NULL on failure.
See Also
gaiaDynamicLineJoinAfter
Note
the reference Point must exists into the first line: the second line will then be inserted immediately before the reference Point.
The newly created object will represent the resulting merged line:
both input objects remain untouched.
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaDynamicLineSplitAfter ( gaiaDynamicLinePtr  org,
gaiaPointPtr  point 
)

Cuts a dynamically growing line/ring in two halves, using a given cut point.

Parameters
orgpointer to the input object [the line to be split].
pointpointer to given cut point.
Returns
the pointer to newly created dynamic growing line/ring object: NULL on failure.
See Also
gaiaDynamicLineSplitBefore
Note
the newly created object will contain a line going from the orginal first point to the cut point [included].
on completion the orginal line will be reduced, going from the cut point [excluded] to the original last point.
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaDynamicLineSplitBefore ( gaiaDynamicLinePtr  org,
gaiaPointPtr  point 
)

Cuts a dynamically growing line/ring in two halves, using a given cut point.

Parameters
orgpointer to the input object [the line to be split].
pointpointer to given cut point.
Returns
the pointer to newly created dynamic growing line/ring object: NULL on failure.
See Also
gaiaDynamicLineSplitAfter
Note
the newly created object will contain a line going from the orginal first point to the cut point [excluded].
on completion the orginal line will be reduced, going from the cut point [included] to the original last point.
GAIAGEO_DECLARE void gaiaFreeDynamicLine ( gaiaDynamicLinePtr  p)

Destroys a dynamically growing line/ring object.

Parameters
ppointer to object to be destroyed
See Also
gaiaAllocDynamicLine
GAIAGEO_DECLARE gaiaPointPtr gaiaPrependPointMToDynamicLine ( gaiaDynamicLinePtr  p,
double  x,
double  y,
double  m 
)

Appends a new 2D Point [XYM] before the first one of a dynamically growing line/ring object.

Parameters
ppointer to the dynamically growing line/ring object.
xX coordinate of the Point
yY coordinate of the Point
mM measure of the Point
Returns
the pointer to newly created Point
GAIAGEO_DECLARE gaiaPointPtr gaiaPrependPointToDynamicLine ( gaiaDynamicLinePtr  p,
double  x,
double  y 
)

Appends a new 2D Point [XY] before the first one of a dynamically growing line/ring object.

Parameters
ppointer to the dynamically growing line/ring object.
xX coordinate of the Point
yY coordinate of the Point
Returns
the pointer to newly created Point
GAIAGEO_DECLARE gaiaPointPtr gaiaPrependPointZMToDynamicLine ( gaiaDynamicLinePtr  p,
double  x,
double  y,
double  z,
double  m 
)

Appends a new 3D Point [XYZM] before the first one of a dynamically growing line/ring object.

Parameters
ppointer to the dynamically growing line/ring object.
xX coordinate of the Point
yY coordinate of the Point
zZ coordinate of the Point
mM measure of the Point
Returns
the pointer to newly created Point
GAIAGEO_DECLARE gaiaPointPtr gaiaPrependPointZToDynamicLine ( gaiaDynamicLinePtr  p,
double  x,
double  y,
double  z 
)

Appends a new 3D Point [XYZ] before the first one of a dynamically growing line/ring object.

Parameters
ppointer to the dynamically growing line/ring object.
xX coordinate of the Point
yY coordinate of the Point
zZ coordinate of the Point
Returns
the pointer to newly created Point
GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaReverseDynamicLine ( gaiaDynamicLinePtr  org)

Duplicates and reverts a dynamically growing line/ring object.

Parameters
orgpointer to dynamically growing line/ring object [origin].
Returns
the pointer to newly created dynamic growing line/ring object: NULL on failure.
Note
the newly created object is an exact copy of the origina one, except in that direction is reverted.
i.e. first inpunt point becomes last output point, and last input point becomes first output point.