gridType_c Class Reference

#include <gridtype.h>

Collaboration diagram for gridType_c:

Collaboration graph
[legend]

List of all members.


Detailed Description

This class encapsulates all information required to handle the different grid types.

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_cgetMovementCache (const problem_c *puz) const
 return a movement cache instance for this grid type
voxel_cgetVoxel (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_cgetVoxel (xmlParser_c &pars) const
 create a new voxel space of this grid type, which is loaded from the XML node
voxel_cgetVoxel (const voxel_c &orig) const
 create a new voxel space of this grid type, which is a copy of the given space
voxel_cgetVoxel (const voxel_c *orig) const
 create a new voxel space of this grid type, which is a copy of the given space
const symmetries_cgetSymmetries (void) const
 Return a pointer to the symmetry class for this grid.
stlExporter_cgetStlExporter (void) const
 return an STL exporter for this grid

Static Public Member Functions

static assembler_cfindAssembler (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_csym
 The symmetry object for this grid type.

Private Member Functions

void operator= (const gridType_c &)


Member Enumeration Documentation

enum gridType_c::gridType

the available grid types

Enumerator:
GT_BRICKS  cubes
GT_TRIANGULAR_PRISM  triangles stacked in Z-direction
GT_SPHERES  tightly packed spheres
GT_RHOMBIC  complicated cut cube to build rhombic dodecahrdra
GT_TETRA_OCTA  spacegrid for with tetraedra and octrahera, also a cut cube
GT_NUM_GRIDS  always the last entry, the number of different grids

enum gridType_c::capabilities

capabilities of a given grid space

Enumerator:
CAP_ASSEMBLE  the grid has an assembler
CAP_DISASSEMBLE  the grid has a disassembler
CAP_STLEXPORT  the grid can export to SDL


Constructor & Destructor Documentation

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   ) 


Member Function Documentation

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

voxel_c * gridType_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 * gridType_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 * 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]


Member Data Documentation

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


The documentation for this class was generated from the following files:
Generated on Wed Apr 29 18:11:15 2009 for BurrTools by  doxygen 1.5.4