#include <symmetries.h>
Public Member Functions | |
symmetries_c (void) | |
virtual | ~symmetries_c (void) |
virtual unsigned int | getNumTransformations (void) const =0 |
Get the number of possible transformations for a voxel space. | |
virtual unsigned int | getNumTransformationsMirror (void) const =0 |
Get the number of possible transformations for a voxel space. | |
virtual bool | symmetrieContainsTransformation (symmetries_t s, unsigned int t) const =0 |
This return true, if the symmetry contains the given transformation. | |
virtual bool | isTransformationUnique (symmetries_t s, unsigned int t) const =0 |
When you apply all the transformations to the shape with a given symmetry s for which this function returns true, you get all possible orientations that that shape can have. | |
virtual unsigned char | transAdd (unsigned char t1, unsigned char t2) const =0 |
returns the transformation that results, when you first carry out transformation t1 and then transformation t2 | |
virtual unsigned char | minimizeTransformation (symmetries_t s, unsigned char trans) const =0 |
Find the first transformation, for a shape with the given symmetry group that results in a shape identical to the given transformation. | |
virtual unsigned int | countSymmetryIntersection (symmetries_t resultSym, symmetries_t s2) const =0 |
This counts how much 'overlap' there is in symmetry between the given result and the shape. | |
virtual bool | symmetriesLeft (symmetries_t resultSym, symmetries_t s2) const =0 |
Do the result and the shape share common symmetries? This is a bit like countSymmetryIntersection() > 1, only faster. | |
virtual bool | symmetryContainsMirror (symmetries_t sym) const =0 |
returns true, if the symmetry group given contains a mirror transformation, meaning the shape that symmetry belongs to can be mirrored by using just rotations | |
virtual symmetries_t | calculateSymmetry (const voxel_c *pp) const =0 |
calculate the symmetry group for the given voxel space | |
virtual bool | symmetryKnown (const voxel_c *pp) const =0 |
find out if the shape has an unknown symmetry group. | |
Private Member Functions | |
symmetries_c (const symmetries_c &) | |
void | operator= (const symmetries_c &) |
This is an absract base class only the derived classes actually do something. If you need an instance of this class you should always use the corresponding gridType_c function
symmetries_c::symmetries_c | ( | void | ) | [inline] |
virtual symmetries_c::~symmetries_c | ( | void | ) | [inline, virtual] |
symmetries_c::symmetries_c | ( | const symmetries_c & | ) | [private] |
virtual symmetries_t symmetries_c::calculateSymmetry | ( | const voxel_c * | pp | ) | const [pure virtual] |
calculate the symmetry group for the given voxel space
Implemented in symmetries_0_c, symmetries_1_c, and symmetries_2_c.
Referenced by voxel_c::selfSymmetries().
virtual unsigned int symmetries_c::countSymmetryIntersection | ( | symmetries_t | resultSym, | |
symmetries_t | s2 | |||
) | const [pure virtual] |
This counts how much 'overlap' there is in symmetry between the given result and the shape.
The value is small, when the 2 shapes have less symmetries in common
Implemented in symmetries_0_c, symmetries_1_c, and symmetries_2_c.
Referenced by assembler_1_c::prepare(), and assembler_0_c::prepare().
virtual unsigned int symmetries_c::getNumTransformations | ( | void | ) | const [pure virtual] |
Get the number of possible transformations for a voxel space.
This number does not include mirror transformations
Implemented in symmetries_0_c, symmetries_1_c, and symmetries_2_c.
Referenced by voxelTable_c::addSpace(), assembly_c::assembly_c(), assembly_c::containsMirroredPieces(), voxel_c::getMirrorTransform(), voxelTable_c::getSpace(), voxel_c::identicalWithRots(), movementCache_c::movementCache_c(), assembler_1_c::prepare(), assembler_0_c::prepare(), assembly_c::smallerRotationExists(), and assembly_c::transform().
virtual unsigned int symmetries_c::getNumTransformationsMirror | ( | void | ) | const [pure virtual] |
Get the number of possible transformations for a voxel space.
This time the mirror transformations are included. Normally this value is twice the number you get when calling getNumTransformations
Implemented in symmetries_0_c, symmetries_1_c, and symmetries_2_c.
Referenced by voxelTable_c::addSpace(), voxel_c::getMirrorTransform(), voxel_c::identicalWithRots(), assembler_1_c::prepare(), assembler_0_c::prepare(), voxel_c::recalcBoundingBox(), voxel_c::setHotspot(), assembly_c::smallerRotationExists(), and voxel_c::voxel_c().
virtual bool symmetries_c::isTransformationUnique | ( | symmetries_t | s, | |
unsigned int | t | |||
) | const [pure virtual] |
When you apply all the transformations to the shape with a given symmetry s for which this function returns true, you get all possible orientations that that shape can have.
Implemented in symmetries_0_c, symmetries_1_c, and symmetries_2_c.
Referenced by voxelTable_c::addSpace().
virtual unsigned char symmetries_c::minimizeTransformation | ( | symmetries_t | s, | |
unsigned char | trans | |||
) | const [pure virtual] |
Find the first transformation, for a shape with the given symmetry group that results in a shape identical to the given transformation.
This functionality is used when rotating an assembly. The new transformation is found out by using transAdd but then we might end up with a high transformation number even though the symmetries of the shape would say otherwise.
An example. Suppose you have a cube in orientation 0. Now you transform that cube by transformation 1 resulting in orientation 1 for the cube. But a cube in orientation 1, well in _any_ orientation looks identical so we can just as well say we leave the cube in orientation 0
Implemented in symmetries_0_c, symmetries_1_c, and symmetries_2_c.
Referenced by voxel_c::normalizeTransformation().
void symmetries_c::operator= | ( | const symmetries_c & | ) | [private] |
virtual bool symmetries_c::symmetrieContainsTransformation | ( | symmetries_t | s, | |
unsigned int | t | |||
) | const [pure virtual] |
This return true, if the symmetry contains the given transformation.
A a symmetry group contains a list of transformations. This functions tells you whether the given symmetry group s contains transformation t
Implemented in symmetries_0_c, symmetries_1_c, and symmetries_2_c.
Referenced by assembler_1_c::prepare(), assembler_0_c::prepare(), and assembly_c::smallerRotationExists().
virtual bool symmetries_c::symmetriesLeft | ( | symmetries_t | resultSym, | |
symmetries_t | s2 | |||
) | const [pure virtual] |
Do the result and the shape share common symmetries? This is a bit like countSymmetryIntersection() > 1, only faster.
Implemented in symmetries_0_c, symmetries_1_c, and symmetries_2_c.
Referenced by assembler_1_c::prepare(), and assembler_0_c::prepare().
virtual bool symmetries_c::symmetryContainsMirror | ( | symmetries_t | sym | ) | const [pure virtual] |
returns true, if the symmetry group given contains a mirror transformation, meaning the shape that symmetry belongs to can be mirrored by using just rotations
Implemented in symmetries_0_c, symmetries_1_c, and symmetries_2_c.
Referenced by assembler_1_c::prepare(), and assembler_0_c::prepare().
virtual bool symmetries_c::symmetryKnown | ( | const voxel_c * | pp | ) | const [pure virtual] |
find out if the shape has an unknown symmetry group.
This was especially useful when this feature with the symmetry groups was introduced and not all of the symmetry groups were known. Nowadays there should be very little chance of finding new symmetry groups. I still leave this extra check in just in case
Implemented in symmetries_0_c, symmetries_1_c, and symmetries_2_c.
virtual unsigned char symmetries_c::transAdd | ( | unsigned char | t1, | |
unsigned char | t2 | |||
) | const [pure virtual] |
returns the transformation that results, when you first carry out transformation t1 and then transformation t2
the function might return TND, when the new required transformation doesn't exist
Implemented in symmetries_0_c, symmetries_1_c, and symmetries_2_c.
Referenced by assembly_c::transform().