cgma
|
#include <WeightedOctree.hpp>
Public Types | |
enum | { X_MIN = 0, Y_MIN = 0, Z_MIN = 0, X_MAX = 1, Y_MAX = 2, Z_MAX = 4 } |
Public Member Functions | |
Cell () | |
bool | removeNode (const X &node) |
void | addNode (const X &node) |
bool | leaf () |
void | appendNodes (std::vector< X > &list) |
const std::vector< X > & | nodes () const |
int | nodeCount () |
void | setWeight (int w) |
void | addWeight (int w) |
int | weight () |
void | setCenter (double &x, double &y, double &z) |
void | setCenter (CubitVector ¢er) |
CubitVector & | center () |
void | removeAllNodes () |
Cell * | child (int quadrant) |
void | setChild (int quadrant, Cell *c) |
void | setParent (Cell *) |
Cell * | parent () |
void | appendAllNodes (std::vector< X > &list) |
Protected Attributes | |
Cell * | Parent |
Cell * | Children [8] |
std::vector< X > | Nodes |
int | TotalWeight |
CubitVector | Center |
bool | IsLeaf |
Definition at line 49 of file WeightedOctree.hpp.
anonymous enum |
WeightedOctree< X, C, E >::Cell::Cell | ( | ) |
Definition at line 562 of file WeightedOctree.cpp.
{ this->TotalWeight=0; this->IsLeaf=true; this->Parent=NULL; for(int i=0;i<8;i++) { this->Children[i]=NULL; } }
void WeightedOctree< X, C, E >::Cell::addNode | ( | const X & | node | ) |
Definition at line 631 of file WeightedOctree.cpp.
{ this->Nodes.push_back(node); }
void WeightedOctree< X, C, E >::Cell::addWeight | ( | int | w | ) |
Definition at line 648 of file WeightedOctree.cpp.
{ this->TotalWeight+=w; }
void WeightedOctree< X, C, E >::Cell::appendAllNodes | ( | std::vector< X > & | list | ) |
Definition at line 590 of file WeightedOctree.cpp.
{ if(this->Nodes.size()) { appendNodes( list ); } for( int i = 0; i < 8; i++ ) { if(this->Children[i]) this->Children[i]->appendAllNodes(list); } }
void WeightedOctree< X, C, E >::Cell::appendNodes | ( | std::vector< X > & | list | ) |
Definition at line 611 of file WeightedOctree.cpp.
CubitVector& WeightedOctree< X, C, E >::Cell::center | ( | ) | [inline] |
Definition at line 77 of file WeightedOctree.hpp.
{return Center;}
Cell* WeightedOctree< X, C, E >::Cell::child | ( | int | quadrant | ) | [inline] |
Definition at line 97 of file WeightedOctree.hpp.
{ assert( quadrant >= 0 && quadrant < 8); return this->Children[quadrant]; }
bool WeightedOctree< X, C, E >::Cell::leaf | ( | ) |
Definition at line 606 of file WeightedOctree.cpp.
{ return !this->Children[0]; }
int WeightedOctree< X, C, E >::Cell::nodeCount | ( | ) | [inline] |
Definition at line 69 of file WeightedOctree.hpp.
{ return Nodes.size(); }
const std::vector<X>& WeightedOctree< X, C, E >::Cell::nodes | ( | ) | const [inline] |
Definition at line 64 of file WeightedOctree.hpp.
{ return Nodes; }
Cell* WeightedOctree< X, C, E >::Cell::parent | ( | ) | [inline] |
Definition at line 110 of file WeightedOctree.hpp.
{return this->Parent;}
void WeightedOctree< X, C, E >::Cell::removeAllNodes | ( | ) |
Definition at line 659 of file WeightedOctree.cpp.
{ this->Nodes.clear(); this->TotalWeight=0; }
bool WeightedOctree< X, C, E >::Cell::removeNode | ( | const X & | node | ) |
void WeightedOctree< X, C, E >::Cell::setCenter | ( | double & | x, |
double & | y, | ||
double & | z | ||
) |
Definition at line 667 of file WeightedOctree.cpp.
void WeightedOctree< X, C, E >::Cell::setCenter | ( | CubitVector & | center | ) |
Definition at line 654 of file WeightedOctree.cpp.
void WeightedOctree< X, C, E >::Cell::setChild | ( | int | quadrant, |
Cell * | c | ||
) |
Definition at line 583 of file WeightedOctree.cpp.
{ assert( quadrant >= 0 && quadrant < 8); this->Children[quadrant]=c; }
void WeightedOctree< X, C, E >::Cell::setParent | ( | Cell * | parent | ) |
Definition at line 576 of file WeightedOctree.cpp.
void WeightedOctree< X, C, E >::Cell::setWeight | ( | int | w | ) |
Definition at line 643 of file WeightedOctree.cpp.
{ this->TotalWeight=w; }
int WeightedOctree< X, C, E >::Cell::weight | ( | ) |
Definition at line 637 of file WeightedOctree.cpp.
{ return this->TotalWeight; }
CubitVector WeightedOctree< X, C, E >::Cell::Center [protected] |
Definition at line 124 of file WeightedOctree.hpp.
Cell* WeightedOctree< X, C, E >::Cell::Children[8] [protected] |
Definition at line 120 of file WeightedOctree.hpp.
bool WeightedOctree< X, C, E >::Cell::IsLeaf [protected] |
Definition at line 125 of file WeightedOctree.hpp.
std::vector<X> WeightedOctree< X, C, E >::Cell::Nodes [protected] |
Definition at line 122 of file WeightedOctree.hpp.
Cell* WeightedOctree< X, C, E >::Cell::Parent [protected] |
Definition at line 119 of file WeightedOctree.hpp.
int WeightedOctree< X, C, E >::Cell::TotalWeight [protected] |
Definition at line 123 of file WeightedOctree.hpp.