This class creates an array a 2D points (x, y)
More...
#include "../include/GridPoints.h"
|
int | init () |
|
int | init (int size) |
|
| GridPoints () |
|
| GridPoints (int size) |
|
| ~GridPoints () |
|
| GridPoints (const GridPoints &data) |
|
GridPoints | operator= (const GridPoints &data) |
|
int | copy (const GridPoints &data) |
|
int | copy (const GridPoints &data, int start, int rnum) |
|
int | clear () |
|
int | expand (int size) |
|
int | add (float x, float y) |
|
int | add (GridPoint gpt) |
|
int | add1 (GridPoint gpt) |
|
int | add (int ind) |
|
int | add1 (int ind) |
|
int | set (int ind, float rx, float ry) |
|
int | set (int ind, GridPoint &gpt) |
|
int | get (int ind, GridPoint &gpt) |
|
GridPoint | get (int ind) |
|
int | remove (int ind) |
|
int | insert (int ind, GridPoint &gpt) |
|
int | insert (int ind, float x, float y) |
|
float | getGX (int ind) |
|
float | getGY (int ind) |
|
float | getGX1 (int ind) |
|
float | getGY1 (int ind) |
|
int | getNum () |
|
int | offset (int ind, float rx, float ry) |
|
int | offset (float rx, float ry) |
|
int | within (GridPoint &gpt) |
|
int | getCenter (GridPoint &gpt) |
|
int | getCentroid (GridPoint &gpt) |
|
int | getBoundingBox (Rect &box) |
|
int | getPointsWithin (GridPoints &gpts) |
|
int | print () |
|
This class creates an array a 2D points (x, y)
- Author
- Dan Vietor
◆ GridPoints() [1/3]
GridPoints::GridPoints |
( |
| ) |
|
Constructor. Initializes the values.
References init().
◆ GridPoints() [2/3]
GridPoints::GridPoints |
( |
int |
size | ) |
|
Constructor. Size the arrays.
References init().
◆ ~GridPoints()
GridPoints::~GridPoints |
( |
| ) |
|
◆ GridPoints() [3/3]
Copy constructor.
- Parameters
-
References copy().
◆ add() [1/3]
int GridPoints::add |
( |
float |
rx, |
|
|
float |
ry |
|
) |
| |
Adds a new point.
- Parameters
-
References expand().
Referenced by add().
◆ add() [2/3]
Adds a new point.
- Parameters
-
References expand().
◆ add() [3/3]
int GridPoints::add |
( |
int |
ind | ) |
|
Adds a new point from the existing list.
- Parameters
-
ind | Index of point to copy to and of list |
References add().
◆ add1() [1/2]
Adds a point (no bounds check
- Parameters
-
◆ add1() [2/2]
int WXP::GridPoints::add1 |
( |
int |
ind | ) |
|
|
inline |
Adds an existing point (no bounds check
- Parameters
-
◆ clear()
int WXP::GridPoints::clear |
( |
| ) |
|
|
inline |
◆ copy() [1/2]
◆ copy() [2/2]
int GridPoints::copy |
( |
const GridPoints & |
data, |
|
|
int |
start, |
|
|
int |
rnum |
|
) |
| |
Copies a subset of point into array
- Parameters
-
data | GridPoints |
start | Starting point within data |
rnum | Number of points to copy |
References init().
◆ expand()
int GridPoints::expand |
( |
int |
size | ) |
|
◆ get() [1/2]
Gets a specific point value from array.
- Parameters
-
- Returns
- Output GridPoint class with values
References get().
◆ get() [2/2]
int GridPoints::get |
( |
int |
ind, |
|
|
GridPoint & |
gpt |
|
) |
| |
Gets a specific point value from array.
- Parameters
-
- Return values
-
Referenced by get().
◆ getCenter()
◆ getCentroid()
int GridPoints::getCentroid |
( |
GridPoint & |
gpt | ) |
|
Find the centroid of the polygon (averages X and Y). Centroid can be outside of polygon.
- Return values
-
◆ getGX()
float WXP::GridPoints::getGX |
( |
int |
ind | ) |
|
|
inline |
◆ getGX1()
float WXP::GridPoints::getGX1 |
( |
int |
ind | ) |
|
|
inline |
Returns X value (no bounds check)
- Parameters
-
◆ getGY()
float WXP::GridPoints::getGY |
( |
int |
ind | ) |
|
|
inline |
◆ getGY1()
float WXP::GridPoints::getGY1 |
( |
int |
ind | ) |
|
|
inline |
Returns Y value (no bounds check)
- Parameters
-
◆ getNum()
int WXP::GridPoints::getNum |
( |
| ) |
|
|
inline |
Return the number of points
◆ init() [1/2]
◆ init() [2/2]
int GridPoints::init |
( |
int |
size | ) |
|
◆ insert() [1/2]
int GridPoints::insert |
( |
int |
ind, |
|
|
float |
rx, |
|
|
float |
ry |
|
) |
| |
Insert a point into the array
- Parameters
-
ind | Index to insert the point |
rx | X value |
ry | Y value |
References expand().
◆ insert() [2/2]
int GridPoints::insert |
( |
int |
ind, |
|
|
GridPoint & |
gpt |
|
) |
| |
Insert a point into the array
- Parameters
-
ind | Index to insert the point |
pt | GridPoint to insert |
References insert().
Referenced by insert().
◆ offset() [1/2]
int GridPoints::offset |
( |
float |
rx, |
|
|
float |
ry |
|
) |
| |
Offsets the entire array.
- Parameters
-
rx | New x value |
ry | New y value |
◆ offset() [2/2]
int GridPoints::offset |
( |
int |
ind, |
|
|
float |
rx, |
|
|
float |
ry |
|
) |
| |
Offsets a specific point value in array.
- Parameters
-
ind | Index of value to set |
rx | New x value |
ry | New y value |
◆ operator=()
Assignment operator. Used to overload copying
- Parameters
-
References copy().
◆ print()
int GridPoints::print |
( |
| ) |
|
Prints the values to standard output.
◆ remove()
int GridPoints::remove |
( |
int |
ind | ) |
|
Deletes a specific point from array.
- Parameters
-
ind | Index of point to delete |
◆ set() [1/2]
int GridPoints::set |
( |
int |
ind, |
|
|
float |
rx, |
|
|
float |
ry |
|
) |
| |
Sets a specific point value in array.
- Parameters
-
ind | Index of value to set |
rx | New x value |
ry | New y value |
◆ set() [2/2]
int GridPoints::set |
( |
int |
ind, |
|
|
GridPoint & |
gpt |
|
) |
| |
Sets a specific point value in array.
- Parameters
-
ind | Index of value to set |
pnt | New values |
◆ within()
Determines if a point is within the array.
- Parameters
-
Referenced by getCenter().
The documentation for this class was generated from the following files: