cgma
|
#include <geometry.hpp>
Public Member Functions | |
Fill () | |
Fill (const FillNode &origin_p) | |
Fill (irange x, irange y, irange z, std::vector< FillNode > nodes_p) | |
const FillNode & | getOriginNode () const |
const FillNode & | getNode (int x, int y, int z) const |
Protected Member Functions | |
size_t | indicesToSerialIndex (int x, int y, int z) const |
Protected Attributes | |
std::vector< FillNode > | nodes |
bool | has_grid |
irange | xrange |
irange | yrange |
irange | zrange |
Friends | |
class | Lattice |
A fill is a 3-dimensional grid of fill nodes
Definition at line 193 of file geometry.hpp.
Fill::Fill | ( | ) | [inline] |
Definition at line 204 of file geometry.hpp.
Fill::Fill | ( | const FillNode & | origin_p | ) | [inline] |
Definition at line 208 of file geometry.hpp.
Fill::Fill | ( | irange | x, |
irange | y, | ||
irange | z, | ||
std::vector< FillNode > | nodes_p | ||
) | [inline] |
const FillNode & Fill::getNode | ( | int | x, |
int | y, | ||
int | z | ||
) | const |
Definition at line 246 of file geometry.cpp.
{ assert( has_grid ); return nodes.at( indicesToSerialIndex(x, y, z) ); }
const FillNode & Fill::getOriginNode | ( | ) | const |
Definition at line 239 of file geometry.cpp.
{ if( !has_grid ){ return nodes.at(0); } else return nodes.at(indicesToSerialIndex( 0, 0, 0)); }
size_t Fill::indicesToSerialIndex | ( | int | x, |
int | y, | ||
int | z | ||
) | const [protected] |
Definition at line 224 of file geometry.cpp.
{ int grid_x = x - xrange.first; int grid_y = y - yrange.first; int grid_z = z - zrange.first; int dx = xrange.second - xrange.first + 1; int dy = yrange.second - yrange.first + 1; // int dz = zrange.second - zrange.first; int index = grid_z * (dy*dx) + grid_y * dx + grid_x; assert( index >= 0 && (unsigned)(index) <= nodes.size() ); return static_cast<size_t>( index ); }
friend class Lattice [friend] |
Definition at line 219 of file geometry.hpp.
bool Fill::has_grid [protected] |
Definition at line 197 of file geometry.hpp.
std::vector<FillNode> Fill::nodes [protected] |
Definition at line 196 of file geometry.hpp.
irange Fill::xrange [protected] |
Definition at line 198 of file geometry.hpp.
irange Fill::yrange [protected] |
Definition at line 198 of file geometry.hpp.
irange Fill::zrange [protected] |
Definition at line 198 of file geometry.hpp.