#include <symmetries_0.h>
Public Member Functions | |
symmetries_0_c (void) | |
unsigned int | getNumTransformations (void) const |
Get the number of possible transformations for a voxel space. | |
unsigned int | getNumTransformationsMirror (void) const |
Get the number of possible transformations for a voxel space. | |
bool | symmetrieContainsTransformation (symmetries_t s, unsigned int t) const |
This return true, if the symmetry contains the given transformation. | |
unsigned char | transAdd (unsigned char t1, unsigned char t2) const |
returns the transformation that results, when you first carry out transformation t1 and then transformation t2 | |
unsigned char | minimizeTransformation (symmetries_t s, unsigned char trans) const |
Find the first transformation, for a shape with the given symmetry group that results in a shape identical to the given transformation. | |
unsigned int | countSymmetryIntersection (symmetries_t resultSym, symmetries_t s2) const |
This counts how much 'overlap' there is in symmetry between the given result and the shape. | |
bool | symmetriesLeft (symmetries_t resultSym, symmetries_t s2) const |
Do the result and the shape share common symmetries? This is a bit like countSymmetryIntersection() > 1, only faster. | |
symmetries_t | calculateSymmetry (const voxel_c *pp) const |
calculate the symmetry group for the given voxel space | |
bool | symmetryContainsMirror (symmetries_t sym) const |
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 | |
bool | symmetryKnown (const voxel_c *pp) const |
find out if the shape has an unknown symmetry group. | |
bool | isTransformationUnique (symmetries_t s, unsigned int trans) const |
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. | |
Private Member Functions | |
symmetries_0_c (const symmetries_0_c &) | |
void | operator= (const symmetries_0_c &) |
symmetries_0_c::symmetries_0_c | ( | void | ) |
symmetries_0_c::symmetries_0_c | ( | const symmetries_0_c & | ) | [private] |
symmetries_t symmetries_0_c::calculateSymmetry | ( | const voxel_c * | pp | ) | const [virtual] |
calculate the symmetry group for the given voxel space
Implements symmetries_c.
References bt_assert, and symmetryKnown().
unsigned int symmetries_0_c::countSymmetryIntersection | ( | symmetries_t | resultSym, | |
symmetries_t | s2 | |||
) | const [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
Implements symmetries_c.
References bt_assert, symmetries, and unifiedSymmetries.
unsigned int symmetries_0_c::getNumTransformations | ( | void | ) | const [virtual] |
Get the number of possible transformations for a voxel space.
This number does not include mirror transformations
Implements symmetries_c.
Referenced by symmetryContainsMirror().
unsigned int symmetries_0_c::getNumTransformationsMirror | ( | void | ) | const [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
Implements symmetries_c.
bool symmetries_0_c::isTransformationUnique | ( | symmetries_t | s, | |
unsigned int | t | |||
) | const [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.
Implements symmetries_c.
References bt_assert, and uniqueSymmetries.
unsigned char symmetries_0_c::minimizeTransformation | ( | symmetries_t | s, | |
unsigned char | trans | |||
) | const [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
Implements symmetries_c.
References bt_assert, and transformationMinimizer.
void symmetries_0_c::operator= | ( | const symmetries_0_c & | ) | [private] |
bool symmetries_0_c::symmetrieContainsTransformation | ( | symmetries_t | s, | |
unsigned int | t | |||
) | const [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
Implements symmetries_c.
References bt_assert, and symmetries.
bool symmetries_0_c::symmetriesLeft | ( | symmetries_t | resultSym, | |
symmetries_t | s2 | |||
) | const [virtual] |
Do the result and the shape share common symmetries? This is a bit like countSymmetryIntersection() > 1, only faster.
Implements symmetries_c.
References bt_assert, symmetries, and unifiedSymmetries.
bool symmetries_0_c::symmetryContainsMirror | ( | symmetries_t | sym | ) | const [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
Implements symmetries_c.
References bt_assert, getNumTransformations(), and symmetries.
bool symmetries_0_c::symmetryKnown | ( | const voxel_c * | pp | ) | const [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
Implements symmetries_c.
References voxel_c::getGridType(), gridType_c::getVoxel(), voxel_c::identicalInBB(), symmetries, and voxel_c::transform().
Referenced by calculateSymmetry().
unsigned char symmetries_0_c::transAdd | ( | unsigned char | t1, | |
unsigned char | t2 | |||
) | const [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
Implements symmetries_c.