#include <query_point.hpp>
This is a simple wrapper for the CGAL KD-tree data structure.
Definition at line 148 of file query_point.hpp.
Public Member Functions | |
template<class QueryPointListenerType> | QueryPointIndex (const std::vector< Geometry::Point > &points, const std::vector< QueryPointListenerType * > &listeners) |
Constructor. | |
QueryPointIndex (const Geometry::Rectangle &r, int rows, int cols) | |
Constructs a query point index with a grid of query points in the interior of a rectangular window. | |
QueryPointIndex (const QueryPointIndex &q1, const QueryPointIndex &q2) | |
Constructs a query point containing the query points in both of the supplied indexes. | |
~QueryPointIndex () | |
Destructor. | |
void | addListeners (QueryPointListenerFactory &factory) |
Adds a query point listener to every query point in this index. | |
template<class OutputIterator> void | output (const Geometry::Rectangle &r, OutputIterator it) const |
Searches for all query points in this index that are in the closure of the supplied rectangle. | |
template<class UnaryFunction> void | apply (const Geometry::Rectangle &r, UnaryFunction &f) const |
Searches for all query points in this index that are in the closure of the supplied rectangle. | |
template<class UnaryFunction> void | applyToAll (UnaryFunction &f) const |
Applies the supplied unary function to all query points in this index. | |
int | size () const |
Returns the number of query points in this set. | |
const QueryPoint & | point (int i) const |
Returns a const reference to the query point with the supplied index. | |
QueryPoint & | point (int i) |
Returns the query point with the supplied index. | |
const QueryPoint & | closest (const Geometry::Point &p) const |
Returns the closest query point to the supplied point. | |
void | recolor (const Geometry::Point &a, const Geometry::Point &b, const Geometry::Point &c) |
Recolors all query points in the closure of the triangle with the supplied vertices. | |
void | recolor (const Geometry::Point &a, const Geometry::Point &b, const Geometry::Point &c, const Geometry::Point &d) |
Recolors all query points in the closure of the quadrilateral with the supplied vertices. | |
Protected Types | |
typedef CGAL::Kd_tree< SearchTraits > | KDTree |
A type of a kd-tree of query points. | |
Protected Attributes | |
std::vector< QueryPoint > | qpoints |
A vector of the query points. | |
QueryPointListenerList * | listenerLists |
An array of listener lists, one per query point. | |
Color * | color |
An array of colors, one per query point, that indicates their current color. | |
KDTree * | tree |
The KD tree of query points. |
|
A type of a kd-tree of query points.
Definition at line 192 of file query_point.hpp. Referenced by QueryPointIndex(). |
|
Constructor. This initializes a point index from a vector of Point objects.
Definition at line 309 of file query_point.hpp. References Arak::QueryPoint::addListener(), Arak::Color, Arak::INVALID_COLOR, KDTree, listenerLists, qpoints, Arak::QueryPointListenerList, and tree. |
|
Constructs a query point index with a grid of query points in the interior of a rectangular window.
Definition at line 6 of file query_point.cpp. References Arak::Color, Arak::INVALID_COLOR, KDTree, listenerLists, Arak::Geometry::Point, qpoints, Arak::QueryPointListenerList, Arak::Geometry::Rectangle, and tree. |
|
Constructs a query point containing the query points in both of the supplied indexes.
Definition at line 35 of file query_point.cpp. References color, Arak::Color, KDTree, listenerLists, point(), qpoints, Arak::QueryPointListenerList, size(), and tree. |
|
Destructor.
Definition at line 64 of file query_point.cpp. References listenerLists, and tree. |
|
Adds a query point listener to every query point in this index. The listeners are generated using the supplied factory.
Definition at line 70 of file query_point.cpp. References Arak::QueryPointListenerFactory::create(), listenerLists, and qpoints. Referenced by Arak::PointSetColorEstimator::PointSetColorEstimator(). |
|
Searches for all query points in this index that are in the closure of the supplied rectangle. The supplied unary function is applied to all such points.
Definition at line 385 of file query_point.hpp. References output(), and Arak::Geometry::Rectangle. Referenced by recolor(). |
|
Applies the supplied unary function to all query points in this index.
Definition at line 396 of file query_point.hpp. References tree. |
|
Returns the closest query point to the supplied point.
Definition at line 75 of file query_point.cpp. References Arak::Geometry::Point, Arak::QueryPointIndex::SearchTraits::Point_d, and tree. Referenced by Arak::Coloring::color(). |
|
Searches for all query points in this index that are in the closure of the supplied rectangle. These points are written to the supplied output iterator.
Definition at line 369 of file query_point.hpp. References Arak::Geometry::Rectangle, and tree. Referenced by apply(). |
|
Returns the query point with the supplied index.
Definition at line 413 of file query_point.hpp. References qpoints. |
|
Returns a const reference to the query point with the supplied index.
Definition at line 408 of file query_point.hpp. References qpoints. Referenced by Arak::Coloring::addQueryPoints(), Arak::Coloring::getPointWithColor(), Arak::Coloring::initialize(), QueryPointIndex(), Arak::Coloring::read(), Arak::Coloring::readBinary(), Arak::Coloring::test(), and Arak::Coloring::visualize(). |
|
Recolors all query points in the closure of the quadrilateral with the supplied vertices. The vertices must be supplied in either clockwise or counter-clockwise order.
Definition at line 108 of file query_point.cpp. References apply(), Arak::Geometry::Point, Arak::Geometry::Rectangle, Arak::Geometry::Segment, and Arak::Geometry::Triangle. |
|
Recolors all query points in the closure of the triangle with the supplied vertices.
Definition at line 82 of file query_point.cpp. References apply(), Arak::Geometry::Point, Arak::Geometry::Rectangle, and Arak::Geometry::Triangle. Referenced by Arak::Coloring::recolored(). |
|
Returns the number of query points in this set.
Definition at line 403 of file query_point.hpp. References qpoints. Referenced by Arak::Coloring::addQueryPoints(), Arak::Coloring::initialize(), QueryPointIndex(), Arak::Coloring::read(), Arak::Coloring::readBinary(), Arak::Coloring::test(), and Arak::Coloring::visualize(). |
|
An array of colors, one per query point, that indicates their current color.
Definition at line 166 of file query_point.hpp. Referenced by QueryPointIndex(). |
|
An array of listener lists, one per query point.
Definition at line 160 of file query_point.hpp. Referenced by addListeners(), QueryPointIndex(), and ~QueryPointIndex(). |
|
A vector of the query points.
Definition at line 155 of file query_point.hpp. Referenced by addListeners(), point(), QueryPointIndex(), and size(). |
|
The KD tree of query points.
Definition at line 197 of file query_point.hpp. Referenced by applyToAll(), closest(), output(), QueryPointIndex(), and ~QueryPointIndex(). |