template<typename K, typename E>
class bridges::datastructure::KdTreeElement< K, E >
This class can be used to create K-d Tree elements, derived from BSTElement. K-D trees can be thought of as the spatial equivalent binary search trees and operate on multiple dimensions (2D and 3D are most common). These trees serve as a representation of the underlying geometrically defined spaces. Specialized versions of these trees include quadtrees and octrees, which subdivide into equal sized quadrants octants at each level, respectively.
This class extends the BSTElement class by adding a dimension property. It also includes a thickness property for displaying the partitioning lines generated by the convex decomposition.
convenient to generate visual representation to allow for use in a binary search tree implementation.
- See also
- There is a tutorial about K-d Trees : http://bridgesuncc.github.io/tutorials/KdTree.html
@param K that is the search key type - this is usually a number, integer
or float
@param E the application data type
- Author
- Kalpathi Subramanian
- Date
- 6/18/15, 7/17/16
|
| | KdTreeElement (const K &k, int dim, int th, const KdTreeElement *l, const KdTreeElement *r, const E &val=E(), const string &lab=string()) |
| |
| | KdTreeElement (const K &k, int dim, int th=0, const E &val=E(), const string &lab=string()) |
| |
| virtual const string | getDStype () const override |
| |
| int | getDimension () const |
| |
| void | setDimension (const int &dim) |
| |
| float | getThickness () const |
| |
| void | setThickness (const float &th) |
| |
| K | getPartitioner () const |
| |
| void | setPartitioner (const K &p) |
| |
| virtual KdTreeElement * | getLeft () override |
| |
| virtual const KdTreeElement * | getLeft () const override |
| |
| void | setLeft (KdTreeElement *l) |
| |
| virtual KdTreeElement * | getRight () override |
| |
| virtual const KdTreeElement * | getRight () const override |
| |
| void | setRight (KdTreeElement *r) |
| |
| | BSTElement (const K &k, BSTElement *l, BSTElement *r, const E &val=E(), const string &lab=string()) |
| |
| | BSTElement (const K &k, const E &val=E(), const string &lab=string()) |
| |
| K | getKey () const |
| |
| void | setKey (const K &k) |
| |
| void | setLeft (BSTElement *l) |
| |
| void | setRight (BSTElement *r) |
| |
| | BinTreeElement (BinTreeElement *l, BinTreeElement *r, const E &e=E(), const string &lab=string()) |
| |
| | BinTreeElement (const E &e=E(), const string &lab=string()) |
| |
| void | setLeft (BinTreeElement *l) |
| |
| void | setRight (BinTreeElement *r) |
| |
| | TreeElement (const E &e=E(), const string &lab=string()) |
| |
| vector< TreeElement * > & | getChildren () |
| |
| const vector< TreeElement * > & | getChildren () const |
| |
| TreeElement * | getChild (const int &n) |
| |
| const TreeElement * | getChild (const int &n) const |
| |
| void | addChild (TreeElement *child) |
| |
| void | setChild (const size_t &index, TreeElement *kid) |
| |
| | Element (const E &val=E(), const string &lab=string()) |
| |
| | Element (const Element &e) |
| |
| Element & | operator= (const Element &e) |
| |
| E & | operator= (E const &e) |
| |
| virtual | ~Element () |
| |
| ElementVisualizer * | getVisualizer () |
| |
| const ElementVisualizer * | getVisualizer () const |
| |
| LinkVisualizer * | getLinkVisualizer (const Element *el) |
| |
| LinkVisualizer * | getLinkVisualizer (const Element *el) const |
| |
| string const & | getLabel () const |
| |
| void | setLabel (const string &lab) |
| |
| E const & | getValue () const |
| |
| E & | getValue () |
| |
| void | setValue (const E &val) |
| |
| void | setSize (const double &sz) |
| | Sets size of the element. More...
|
| |
| double | getSize () const |
| |
| void | setColor (const Color &col) |
| | Set the color of the Element. More...
|
| |
| void | setColor (const string col) |
| | Set the color by name. More...
|
| |
| Color | getColor () const |
| | Get the current color of the element. More...
|
| |
| void | setOpacity (double opacity) |
| |
| double | getOpacity () |
| |
| void | setShape (const Shape &shp) |
| | Set the shape of the element. More...
|
| |
| Shape | getShape () const |
| | Returns the shape of the element. More...
|
| |
| void | setLocation (const double &locX, const double &locY) |
| |
| double | getLocationX () const |
| |
| double | getLocationY () const |
| |
| virtual | ~DataStructure ()=default |
| |