#include <gridtype.h>

That means this class knows about the capabilities of the different grids. It know how to create assembler disassembler, STL-exporter, or voxelspaces for the different grid, ...
This is a factory (see http://en.wikipedia.org/wiki/Factory_method_pattern)
Public Types | |
| enum | gridType { GT_BRICKS, GT_TRIANGULAR_PRISM, GT_SPHERES, GT_RHOMBIC, GT_TETRA_OCTA, GT_NUM_GRIDS } |
| the available grid types More... | |
| enum | capabilities { CAP_ASSEMBLE = 1, CAP_DISASSEMBLE = 2, CAP_STLEXPORT = 4 } |
| capabilities of a given grid space More... | |
Public Member Functions | |
| gridType_c (xmlParser_c &pars) | |
| load from xml node | |
| gridType_c (const gridType_c &) | |
| copy constructor | |
| void | save (xmlWriter_c &xml) const |
| used to save to XML | |
| gridType_c (void) | |
| create a cube grid | |
| gridType_c (gridType gt) | |
| create a grid of the given type with its standard parameters | |
| ~gridType_c (void) | |
| gridType | getType (void) const |
| get the grid type | |
| unsigned int | getCapabilities (void) const |
| movementCache_c * | getMovementCache (const problem_c *puz) const |
| return a movement cache instance for this grid type | |
| voxel_c * | getVoxel (unsigned int x, unsigned int y, unsigned int z, voxel_type init) const |
| create a new voxel space of this grid type with the given dimensions | |
| voxel_c * | getVoxel (xmlParser_c &pars) const |
| create a new voxel space of this grid type, which is loaded from the XML node | |
| voxel_c * | getVoxel (const voxel_c &orig) const |
| create a new voxel space of this grid type, which is a copy of the given space | |
| voxel_c * | getVoxel (const voxel_c *orig) const |
| create a new voxel space of this grid type, which is a copy of the given space | |
| const symmetries_c * | getSymmetries (void) const |
| Return a pointer to the symmetry class for this grid. | |
| stlExporter_c * | getStlExporter (void) const |
| return an STL exporter for this grid | |
Static Public Member Functions | |
| static assembler_c * | findAssembler (const problem_c *p) |
| Find a suitable assembler for the given problem. | |
Protected Attributes | |
| gridType | type |
| the grid type of this instance | |
| union { | |
| struct { | |
| bool nothing | |
| } brick | |
| struct { | |
| bool nothgin | |
| } triangularPrism | |
| struct { | |
| bool nothing | |
| } spheres | |
| } | parameters |
| symmetries_c * | sym |
| The symmetry object for this grid type. | |
Private Member Functions | |
| void | operator= (const gridType_c &) |
| enum gridType_c::gridType |
the available grid types
| gridType_c::gridType_c | ( | xmlParser_c & | pars | ) |
load from xml node
| gridType_c::gridType_c | ( | const gridType_c & | orig | ) |
copy constructor
| gridType_c::gridType_c | ( | void | ) |
create a cube grid
| gridType_c::gridType_c | ( | gridType | gt | ) |
create a grid of the given type with its standard parameters
| gridType_c::~gridType_c | ( | void | ) |
| void gridType_c::save | ( | xmlWriter_c & | xml | ) | const |
used to save to XML
| gridType gridType_c::getType | ( | void | ) | const [inline] |
get the grid type
| unsigned int gridType_c::getCapabilities | ( | void | ) | const |
| movementCache_c * gridType_c::getMovementCache | ( | const problem_c * | puz | ) | const |
return a movement cache instance for this grid type
| voxel_c * gridType_c::getVoxel | ( | unsigned int | x, | |
| unsigned int | y, | |||
| unsigned int | z, | |||
| voxel_type | init | |||
| ) | const |
create a new voxel space of this grid type with the given dimensions
| voxel_c * gridType_c::getVoxel | ( | xmlParser_c & | pars | ) | const |
create a new voxel space of this grid type, which is loaded from the XML node
create a new voxel space of this grid type, which is a copy of the given space
create a new voxel space of this grid type, which is a copy of the given space
| const symmetries_c * gridType_c::getSymmetries | ( | void | ) | const |
Return a pointer to the symmetry class for this grid.
Don't free this instance the ownership stays with the gridType_c class You just use the class and forget about it
| stlExporter_c * gridType_c::getStlExporter | ( | void | ) | const |
return an STL exporter for this grid
| assembler_c * gridType_c::findAssembler | ( | const problem_c * | p | ) | [static] |
Find a suitable assembler for the given problem.
This function is different from the above, it is not dependend on the gridtype of the puzzle but on some of the parameters of the puzzle, e.g has the puzzle multipieces, has the puzzle piece count ranges, ... the function tries to find the fastest assembler that can handle the puzzle. because we are not dependend on the gridtype this function is static but it needs to know the puzzle
| void gridType_c::operator= | ( | const gridType_c & | ) | [private] |
gridType gridType_c::type [protected] |
the grid type of this instance
| bool gridType_c::nothing |
| struct { ... } gridType_c::brick |
| bool gridType_c::nothgin |
| struct { ... } gridType_c::triangularPrism |
| struct { ... } gridType_c::spheres |
union { ... } gridType_c::parameters [protected] |
symmetries_c* gridType_c::sym [mutable, protected] |
The symmetry object for this grid type.
As we only need one symmetry object for a grid type we create a local instance here and just return a pointer to it for the application to use
1.5.4