Hermes
 All Data Structures Files Functions Variables Macros Pages
BoxSP Struct Reference

#include <Definition.h>

Collaboration diagram for BoxSP:

Public Member Functions

BoxSPconstructorBoxSP (int32 lx, int32 ly, int32 hx, int32 hy, BoxSP *result, char **error)
 Constructs a spatial box from x and y coordinates. More...
 
BoxSPconstructorHighBoxSP (const PointSP *l, const PointSP *h, BoxSP *result, char **error)
 Constructs a spatial box from the low and high points. More...
 
BoxSPinBoxSP (const char *str, BoxSP *result, char **error)
 Constructs a spatial box from the text representation of the object. More...
 
char * outBoxSP (const BoxSP *box)
 Constructs the text representation of a spatial box. More...
 
bytea * BoxSP2Bytea (const BoxSP *box)
 Gives the byte array of a spatial box. More...
 
bool equalsBoxSP (const BoxSP *boxA, const BoxSP *boxB)
 Checks if the two boxes are equal. More...
 

Data Fields

PointSP l
 
PointSP h
 

Detailed Description

BoxSP is spatial data type and is comprised of two PointSP(i,e) components where “l” is the low left point and “h” is the high right point

lh ___ h
| |
|___|
l hl
This is an axis-aligned box.

See also
BoxSP/Casts.sql
BoxSP/Definition.sql
BoxSP/Distance.sql
BoxSP/Interactions.sql
BoxSP/Properties.sql
BoxSP/RelationalOperators.sql

Member Function Documentation

bytea * BoxSP2Bytea ( const BoxSP box)

Gives the byte array of a spatial box.

Parameters
[in]boxpointer to a BoxSP object.
Returns
The byte array.

Referenced by hashBoxSP(), and sendBoxSP().

BoxSP * constructorBoxSP ( int32  lx,
int32  ly,
int32  hx,
int32  hy,
BoxSP result,
char **  error 
)

Constructs a spatial box from x and y coordinates.

Correct examples (best practices)

  1. BoxSP box; constructorBoxSP(0,0, 1,1, &box, NULL);
  2. char *error = NULL; BoxSP *box = constructorBoxSP(0,0, 1,1, NULL, &error);

Wrong examples (common mistakes)

  1. BoxSP *box = constructorBoxSP(1,1, 0,0, NULL, NULL); pfree(box);
Parameters
[in]lxlowest x
[in]lylowest y
[in]hxhighest x
[in]hyhighest y
[out]resultthe box to update.
[out]errorerror message, if any.
Returns
Pointer to a BoxSP or null pointer if an error has occurred. You should check if the returned pointer is NULL before you deallocate it with pfree()!

Referenced by constructorBoxSPV1().

BoxSP * constructorHighBoxSP ( const PointSP l,
const PointSP h,
BoxSP result,
char **  error 
)

Constructs a spatial box from the low and high points.

Parameters
[in]llowest point
[in]hhighest point
[out]resultsame as constructorBoxSP().
[out]errorsame as constructorBoxSP().
Returns
same as constructorBoxSP().

Referenced by constructorHighBoxSPV1().

bool equalsBoxSP ( const BoxSP boxA,
const BoxSP boxB 
)

Checks if the two boxes are equal.

Parameters
[in]boxApointer to the first BoxSP object.
[in]boxBpointer to the second BoxSP object.
Returns
True if they are equal. False otherwise.

Referenced by equalsBoxSPV1().

BoxSP * inBoxSP ( const char *  str,
BoxSP result,
char **  error 
)

Constructs a spatial box from the text representation of the object.

Parameters
[in]strtext representation and the format is "((lx, ly), (hx, hy))".
[out]resultsame as constructorBoxSP().
[out]errorsame as constructorBoxSP().
Returns
same as constructorBoxSP().

Referenced by inBoxSPV1().

char * outBoxSP ( const BoxSP box)

Constructs the text representation of a spatial box.

Parameters
[in]boxpointer to a BoxSP object.
Returns
the text representation of the box.

Referenced by outBoxSPV1().

Field Documentation


The documentation for this struct was generated from the following file: