#include <PolicyTreeSpatialGrid.hpp>
Public Types | |
enum class | TreeType : int { OctTree , BinTree } |
Public Member Functions | |
TreePolicy * | policy () const |
TreeType | treeType () const |
![]() | |
~TreeSpatialGrid () | |
int | cellIndex (Position bfr) const override |
Position | centralPositionInCell (int m) const override |
std::unique_ptr< PathSegmentGenerator > | createPathSegmentGenerator () const override |
double | diagonal (int m) const override |
int | numCells () const override |
Position | randomPositionInCell (int m) const override |
double | volume (int m) const override |
void | writeTopology (TextOutFile *outfile) const |
![]() | |
Box | boundingBox () const override |
int | dimension () const override |
double | maxX () const |
double | maxY () const |
double | maxZ () const |
double | minX () const |
double | minY () const |
double | minZ () const |
![]() | |
virtual Box | boundingBox () const =0 |
virtual int | cellIndex (Position bfr) const =0 |
virtual Position | centralPositionInCell (int m) const =0 |
virtual std::unique_ptr< PathSegmentGenerator > | createPathSegmentGenerator () const =0 |
virtual double | diagonal (int m) const =0 |
virtual int | dimension () const =0 |
virtual int | numCells () const =0 |
virtual Position | randomPositionInCell (int m) const =0 |
virtual double | volume (int m) const =0 |
virtual void | writeGridPlotFiles (const SimulationItem *probe) const |
![]() | |
template<class T > | |
T * | find (bool setup=true) const |
template<class T > | |
T * | interface (int levels=-999999, bool setup=true) const |
virtual string | itemName () const |
void | setup () |
string | typeAndName () const |
![]() | |
Item (const Item &)=delete | |
virtual | ~Item () |
void | addChild (Item *child) |
const vector< Item * > & | children () const |
virtual void | clearItemListProperty (const PropertyDef *property) |
void | destroyChild (Item *child) |
virtual bool | getBoolProperty (const PropertyDef *property) const |
virtual vector< double > | getDoubleListProperty (const PropertyDef *property) const |
virtual double | getDoubleProperty (const PropertyDef *property) const |
virtual string | getEnumProperty (const PropertyDef *property) const |
virtual int | getIntProperty (const PropertyDef *property) const |
virtual vector< Item * > | getItemListProperty (const PropertyDef *property) const |
virtual Item * | getItemProperty (const PropertyDef *property) const |
virtual string | getStringProperty (const PropertyDef *property) const |
int | getUtilityProperty (string name) const |
virtual void | insertIntoItemListProperty (const PropertyDef *property, int index, Item *item) |
Item & | operator= (const Item &)=delete |
Item * | parent () const |
virtual void | removeFromItemListProperty (const PropertyDef *property, int index) |
virtual void | setBoolProperty (const PropertyDef *property, bool value) |
virtual void | setDoubleListProperty (const PropertyDef *property, vector< double > value) |
virtual void | setDoubleProperty (const PropertyDef *property, double value) |
virtual void | setEnumProperty (const PropertyDef *property, string value) |
virtual void | setIntProperty (const PropertyDef *property, int value) |
virtual void | setItemProperty (const PropertyDef *property, Item *item) |
virtual void | setStringProperty (const PropertyDef *property, string value) |
void | setUtilityProperty (string name, int value) |
virtual string | type () const |
![]() | |
Box () | |
Box (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) | |
Box (Vec rmin, Vec rmax) | |
void | cellIndices (int &i, int &j, int &k, Vec r, int nx, int ny, int nz) const |
Vec | center () const |
bool | contains (const Box &box) const |
bool | contains (double x, double y, double z) const |
bool | contains (Vec r) const |
double | diagonal () const |
void | extend (const Box &box) |
const Box & | extent () const |
void | extent (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const |
Vec | fracPos (double xfrac, double yfrac, double zfrac) const |
Vec | fracPos (int xd, int yd, int zd, int xn, int yn, int zn) const |
bool | intersects (const Box &box) const |
bool | intersects (Vec r, const Vec k, double &smin, double &smax) const |
bool | intersects (Vec rc, double r) const |
Vec | rmax () const |
Vec | rmin () const |
double | volume () const |
Vec | widths () const |
double | xmax () const |
double | xmin () const |
double | xwidth () const |
double | ymax () const |
double | ymin () const |
double | ywidth () const |
double | zmax () const |
double | zmin () const |
double | zwidth () const |
Protected Member Functions | |
PolicyTreeSpatialGrid () | |
vector< TreeNode * > | constructTree () override |
![]() | |
TreeSpatialGrid () | |
virtual vector< TreeNode * > | constructTree ()=0 |
void | setupSelfAfter () override |
void | write_xy (SpatialGridPlotFile *outfile) const override |
void | write_xyz (SpatialGridPlotFile *outfile) const override |
void | write_xz (SpatialGridPlotFile *outfile) const override |
void | write_yz (SpatialGridPlotFile *outfile) const override |
![]() | |
BoxSpatialGrid () | |
void | setupSelfBefore () override |
![]() | |
SpatialGrid () | |
Random * | random () const |
void | setupSelfBefore () override |
virtual void | write_xy (SpatialGridPlotFile *outfile) const |
virtual void | write_xyz (SpatialGridPlotFile *outfile) const |
virtual void | write_xz (SpatialGridPlotFile *outfile) const |
virtual void | write_yz (SpatialGridPlotFile *outfile) const |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
![]() | |
void | setExtent (const Box &extent) |
void | setExtent (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) |
Private Types | |
using | BaseType = TreeSpatialGrid |
using | ItemType = PolicyTreeSpatialGrid |
Private Attributes | |
TreePolicy * | _policy |
TreeType | _treeType |
Friends | |
class | ItemRegistry |
PolicyTreeSpatialGrid is a concrete subclass of the TreeSpatialGrid class representing three-dimensional spatial grids with cuboidal cells organized in a hierarchical tree. The tree's root node encloses the complete spatial domain, and nodes on subsequent levels recursively divide space into ever finer nodes. The depth of the tree can vary from place to place. The leaf nodes (those that are not further subdivided) are the actual spatial cells.
This class offers a user-configurable option to select the tree type. Depending on the type of node employed, the tree can become an octtree (8 children per node) or a binary tree (2 children per node). Other node types could be implemented, as long as they are cuboids lined up with the coordinate axes.
The actual tree construction, other than the choice of node type, is delegated to a user-configurable policy instance. Encapsulating the configurable options and the corresponding implementation mechanisms for constructing spatial tree grids in a separate class hierarchy allows offering and possibly combining different policies without complicating the TreeSpatialGrid class hierarchy.
|
strong |
The enumeration type indicating the type of tree to be constructed: an octtree (8 children per node) or a binary tree (2 children per node).
OctTree : "an octtree (8 children per node)" .
BinTree : "a binary tree (2 children per node)" .
|
inlineprotected |
Default constructor for concrete Item subclass PolicyTreeSpatialGrid : "a tree-based spatial grid" .
|
overrideprotectedvirtual |
This function constructs the hierarchical tree and all (interconnected) nodes forming the tree as described for the corresponding pure virtual function in the base class. For this class, this function merely creates a root node of the appropriate type for the tree type configured by the user, and then invokes the constructTree() function of the policy configured by the user.
Implements TreeSpatialGrid.
|
inline |
This function returns the value of the discoverable item property policy : "the tree construction policy (configuration options)" .
The default value for this property is given by the conditional value expression "DensityTreePolicy" .
|
inline |
This function returns the value of the discoverable TreeType enumeration property treeType : "the type of tree" .
The default value for this property is given by the conditional value expression "OctTree" .
This property is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.
When a value is entered for this property, the names provided by the conditional value expression "treeTypeOctTree:OctTreeGrid;treeTypeBinTree:BinTreeGrid" are inserted into the name sets used for evaluating Boolean expressions.