|
WXP C++ Library Version 6.74.9
|
This class creates an array a 2D points (x, y) More...
#include "../include/Points.h"
Public Member Functions | |
| int | init () |
| int | init (int size) |
| Points () | |
| Points (int size) | |
| ~Points () | |
| Points (const Points &data) | |
| Points | operator= (const Points &data) |
| int | copy (const Points &data) |
| int | copy (const Points &data, int start, int rnum) |
| int | clear () |
| int | expand (int size) |
| int | add (float x, float y) |
| int | add (Point pt) |
| int | add1 (Point pt) |
| int | add (int ind) |
| int | add1 (int ind) |
| int | set (int ind, float rx, float ry) |
| int | set (int ind, Point &pt) |
| int | get (int ind, Point &pt) |
| Point | get (int ind) |
| int | remove (int ind) |
| int | insert (int ind, Point &pt) |
| int | insert (int ind, float x, float y) |
| float | getX (int ind) |
| float | getY (int ind) |
| float | getX1 (int ind) |
| float | getY1 (int ind) |
| int | getNum () |
| int | offset (int ind, float rx, float ry) |
| int | offset (float rx, float ry) |
| int | within (Point &pt) |
| int | getCenter (Point &pt) |
| int | getCentroid (Point &pt) |
| int | print () |
This class creates an array a 2D points (x, y)
| Points::Points | ( | ) |
Constructor. Initializes the values.
References init().
| Points::Points | ( | int | size | ) |
Constructor. Size the arrays.
References init().
| Points::~Points | ( | ) |
Destructor.
| Points::Points | ( | const Points & | data | ) |
| int Points::add | ( | float | rx, |
| float | ry | ||
| ) |
Adds a new point.
| rx | Sets X |
| ry | Sets Y |
References expand().
Referenced by add(), WXP::Lev2Plot::draw(), WXP::MetaPlot::draw(), WXP::RedbookPlot::draw(), WXP::WarnPlot::draw(), WXP::WatchPlot::draw(), WXP::MapPlot::draw(), WXP::CloudPlot::draw(), WXP::WindPlot::drawBarb(), WXP::Plot::drawCircle(), WXP::Graph::drawCircle(), WXP::Graph::drawFill(), WXP::Graph::drawFill(), WXP::MapPlot::drawLatLon(), WXP::Plot::drawLine(), WXP::Graph::drawLine(), WXP::Graph::drawMarkLine(), WXP::Graph::drawRect(), WXP::Plot::drawSpline(), WXP::Graph::drawSymbol(), WXP::WindPlot::drawTrack(), WXP::WindPlot::drawVect(), and WXP::RedbookFile::vector().
| int Points::add | ( | int | ind | ) |
Adds a new point from the existing list.
| ind | Index of point to copy to and of list |
References add().
| int Points::add | ( | Point | pt | ) |
Adds a new point.
| pt | Point class with values |
References expand(), WXP::Point::x, and WXP::Point::y.
|
inline |
Adds an existing point (no bounds check
| ind | Index of point to add |
|
inline |
Adds a point (no bounds check
| pt | Point to add |
References WXP::Point::x, and WXP::Point::y.
Referenced by WXP::ContPlot::drawBoxFill(), and WXP::ContPlot::drawFill().
|
inline |
Clears point array
Referenced by WXP::Lev2Plot::draw(), WXP::MetaPlot::draw(), WXP::RedbookPlot::draw(), WXP::WarnPlot::draw(), WXP::WatchPlot::draw(), WXP::MapPlot::draw(), WXP::CloudPlot::draw(), WXP::WindPlot::drawBarb(), WXP::ContPlot::drawBoxFill(), WXP::ContPlot::drawFill(), WXP::Graph::drawFill(), WXP::Graph::drawFill(), WXP::MapPlot::drawLatLon(), WXP::Plot::drawLine(), WXP::Graph::drawLine(), WXP::Graph::drawMarkLine(), WXP::MapPlot::drawSegment(), WXP::Plot::drawSpline(), WXP::Graph::drawSymbol(), WXP::WindPlot::drawTrack(), WXP::WindPlot::drawVect(), and WXP::RedbookFile::vector().
| int Points::copy | ( | const Points & | data | ) |
Copy data.
| epts | Strings class to copy from |
References init().
Referenced by WXP::Plot::drawLine(), WXP::Plot::drawSpline(), operator=(), and Points().
| int Points::copy | ( | const Points & | data, |
| int | start, | ||
| int | rnum | ||
| ) |
| int Points::expand | ( | int | size | ) |
| Point Points::get | ( | int | ind | ) |
| int Points::get | ( | int | ind, |
| Point & | pt | ||
| ) |
Gets a specific point value from array.
| ind | Index of value to get |
| pnt | Output Point class with values |
References WXP::Point::x, and WXP::Point::y.
Referenced by WXP::Domain::adjust(), WXP::Lev2Plot::draw(), and get().
| int Points::getCenter | ( | Point & | pt | ) |
Find a point at the center of the polygon
| pt | Central point |
References WXP::Point::init(), within(), WXP::Point::x, and WXP::Point::y.
Referenced by WXP::WarnPlot::draw(), and WXP::WatchPlot::draw().
| int Points::getCentroid | ( | Point & | pt | ) |
Find the centroid of the polygon (averages X and Y). Centroid can be outside of polygon.
| pt | Centroid point |
References WXP::Point::x, and WXP::Point::y.
|
inline |
Return the number of points
Referenced by WXP::Domain::adjust(), WXP::MetaPlot::draw(), WXP::MapPlot::draw(), WXP::XWindow::drawFill(), WXP::Graph::drawFill(), WXP::MapPlot::drawLatLon(), WXP::XWindow::drawLine(), WXP::Graph::drawLine(), WXP::Plot::drawLine(), WXP::Plot::drawSpline(), WXP::GTran::isPointsInWindow(), WXP::Domain::offsetLine(), and WXP::Domain::wrapLine().
|
inline |
Returns X value
| ind | Index in array |
References WXP::Const::MISS.
Referenced by WXP::RedbookPlot::draw(), WXP::CloudPlot::draw(), WXP::Plot::drawLine(), WXP::Plot::drawSpline(), WXP::GTran::isPointsInWindow(), WXP::RedbookFile::vector(), and WXP::Domain::wrapLine().
|
inline |
Returns X value (no bounds check)
| ind | Index in array |
Referenced by WXP::XWindow::drawFill(), WXP::Graph::drawFill(), WXP::XWindow::drawLine(), and WXP::Graph::drawLine().
|
inline |
Returns Y value
| ind | Index in array |
References WXP::Const::MISS.
Referenced by WXP::RedbookPlot::draw(), WXP::CloudPlot::draw(), WXP::GTran::isPointsInWindow(), WXP::Domain::offsetLine(), WXP::RedbookFile::vector(), and WXP::Domain::wrapLine().
|
inline |
Returns Y value (no bounds check)
| ind | Index in array |
Referenced by WXP::XWindow::drawFill(), WXP::Graph::drawFill(), WXP::XWindow::drawLine(), and WXP::Graph::drawLine().
| int Points::init | ( | int | size | ) |
Initializes the values
| int Points::insert | ( | int | ind, |
| float | rx, | ||
| float | ry | ||
| ) |
Insert a point into the array
| ind | Index to insert the point |
| rx | X value |
| ry | Y value |
References expand().
| int Points::insert | ( | int | ind, |
| Point & | pt | ||
| ) |
Insert a point into the array
| ind | Index to insert the point |
| pt | Point to insert |
References insert(), WXP::Point::x, and WXP::Point::y.
Referenced by insert().
| int Points::offset | ( | float | rx, |
| float | ry | ||
| ) |
Offsets the entire array.
| rx | New x value |
| ry | New y value |
| int Points::offset | ( | int | ind, |
| float | rx, | ||
| float | ry | ||
| ) |
Offsets a specific point value in array.
| ind | Index of value to set |
| rx | New x value |
| ry | New y value |
Referenced by WXP::Lev2Plot::draw(), WXP::Graph::drawLine(), WXP::Domain::offsetLine(), and WXP::Domain::wrapLine().
| int Points::print | ( | ) |
Prints the values to standard output.
Referenced by WXP::MetaPlot::draw().
| int Points::remove | ( | int | ind | ) |
Deletes a specific point from array.
| ind | Index of point to delete |
| int Points::set | ( | int | ind, |
| float | rx, | ||
| float | ry | ||
| ) |
Sets a specific point value in array.
| ind | Index of value to set |
| rx | New x value |
| ry | New y value |
Referenced by WXP::Domain::adjust().
| int Points::set | ( | int | ind, |
| Point & | pt | ||
| ) |
Sets a specific point value in array.
| ind | Index of value to set |
| pnt | New values |
References WXP::Point::x, and WXP::Point::y.
| int Points::within | ( | Point & | pt | ) |
Determines if a point is within the array.
| pt | Point to check |
References WXP::Point::x, and WXP::Point::y.
Referenced by getCenter().