Class SBDTypeUnitCell#
This class is used to represent a unit cell. More...
#include <SBDTypeUnitCell.hpp>
Public Types#
Type | Name |
---|---|
enum | ShapeType |
Public Functions#
Type | Name |
---|---|
SBDTypeUnitCell () Constructs an infinite unit cell. |
|
SBDTypeUnitCell (const SBQuantity::length & length, SBDTypeUnitCell::ShapeType shapeType=SBDTypeUnitCell::ShapeType::Cubic) Constructs a cubic, rhombic dodecahedral, or truncated octahedral box with the box length length . |
|
SBDTypeUnitCell (const SBLength3 & lengths) Constructs an orthorhombic unit cell with the box size lengths . |
|
SBDTypeUnitCell (const SBLength3 & lengths, const SBVector3 & angles) Constructs a triclinic unit cell with the box size length and anglesangles (in degrees) |
|
SBDTypeUnitCell (const SBQuantity::length & a, const SBQuantity::length & b, const SBQuantity::length & c, const SBQuantity::degree & alpha, const SBQuantity::degree & beta, const SBQuantity::degree & gamma) Constructs a triclinic unit cell with the box size and angles (in degrees) |
|
SBDTypeUnitCell (const SBLength3 & vectorA, const SBLength3 & vectorB, const SBLength3 & vectorC) Constructs a unit cell based on 3 vectors vectorA ,vectorB ,vectorC . |
|
SBDTypeUnitCell (const SBMatrix33 & matrix) Constructs a unit cell based on the matrix matrix (triclinic vectors) |
|
bool | checkTriclinicConditions (std::string & error) const Returns true if the box described by the unit cell satisfies a set of triclinic box conditions. |
const SBVector3 & | getAngles () const Returns the angles of the unit cell. |
SBPosition3 | getCenterOfTriclinicCell () const Returns the center of the triclinic unit cell. |
SBInverseLength3 | getInverseLengths () const Returns the inverse lengths of the unit cell. |
const SBLength3 & | getLengths () const Returns the lengths of the unit cell. |
const SBMatrix33 & | getMatrix () const Returns the matrix of the unit cell. |
const SBPosition3 & | getOrigin () const Returns the origin of the unit cell. |
SBDTypeUnitCell::ShapeType | getShapeType () const Returns the unit cell's shape type. |
std::string | getShapeTypeString () const Returns the name of the unit cell's shape type. |
SBQuantity::cubicLength | getVolume () const Returns the volume of the unit cell. |
virtual bool | isSerializable () const Returns true. |
bool | operator!= (const SBDTypeUnitCell & unitCell) Returns true if this unit cell is not equal to unit cell unitCell (component-wise) |
SBDTypeUnitCell & | operator= (const SBDTypeUnitCell & unitCell) Assignment operator. |
bool | operator== (const SBDTypeUnitCell & unitCell) Returns true if this unit cell is equal to unit cell unitCell (component-wise) |
virtual void | print () const Prints the unit cell. |
virtual void | serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) const Serializes the color. |
void | setOrigin (const SBPosition3 & origin) Sets the origin of the unit cell. |
void | setShapeType (SBDTypeUnitCell::ShapeType shapeType) Sets the unit cell's shape type to shapeType . |
virtual void | unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) Unserializes the color. |
~SBDTypeUnitCell () |
Public Static Functions#
Type | Name |
---|---|
bool | checkTriclinicConditions (const SBMatrix33 & matrix, std::string & error) Returns true if the box described by the matrix matrix satisfies a set of triclinic box conditions. |
SBVector3 | getAngles (const SBMatrix33 & matrix) Returns box angles based on the matrix matrix . |
SBLength3 | getLengths (const SBMatrix33 & matrix) Returns box length based on the matrix matrix . |
SBMatrix33 | getMatrix (const SBLength3 & lengths, const SBVector3 & angles) Returns box matrix based on length lengths and anglesangles . |
SBDTypeUnitCell::ShapeType | getShapeType (const SBMatrix33 & matrix) Returns the unit cell's shape type based on the box matrix matrix . |
std::string | getShapeTypeString (SBDTypeUnitCell::ShapeType shapeType) Returns the name of the unit cell's shape type shapeType . |
Protected Attributes#
Type | Name |
---|---|
SBVector3 | angles The angles, in degrees, of the unit cell between the box vectors (bc, ac, ab) |
SBLength3 | lengths The lengths of the unit cell - the box vector lengths (a, b, c) |
SBMatrix33 | matrix The unit cell matrix. |
SBPosition3 | origin The origin of the unit cell, by default it is (0, 0, 0) |
ShapeType | shapeType The type of the unit cell shape. |
Detailed Description#
Short name: SBUnitCell
See also: SAMSON's unit system
Public Types Documentation#
enum ShapeType#
enum SBDTypeUnitCell::ShapeType {
Undefined = 0,
Infinite = 0,
Cubic = 1,
Orthorhombic = 2,
Triclinic = 3,
Dodecahedron = 4,
RhombicDodecahedron = 4,
Octahedron = 5,
TruncatedOctahedron = 5
};
Public Functions Documentation#
function SBDTypeUnitCell [1/7]#
Constructs an infinite unit cell.
function SBDTypeUnitCell [2/7]#
Constructs a cubic, rhombic dodecahedral, or truncated octahedral box with the box length length
.
SBDTypeUnitCell::SBDTypeUnitCell (
const SBQuantity::length & length,
SBDTypeUnitCell::ShapeType shapeType=SBDTypeUnitCell::ShapeType::Cubic
)
function SBDTypeUnitCell [3/7]#
Constructs an orthorhombic unit cell with the box size lengths
.
function SBDTypeUnitCell [4/7]#
Constructs a triclinic unit cell with the box size length
and anglesangles
(in degrees)
function SBDTypeUnitCell [5/7]#
Constructs a triclinic unit cell with the box size and angles (in degrees)
SBDTypeUnitCell::SBDTypeUnitCell (
const SBQuantity::length & a,
const SBQuantity::length & b,
const SBQuantity::length & c,
const SBQuantity::degree & alpha,
const SBQuantity::degree & beta,
const SBQuantity::degree & gamma
)
function SBDTypeUnitCell [6/7]#
Constructs a unit cell based on 3 vectors vectorA
,vectorB
,vectorC
.
SBDTypeUnitCell::SBDTypeUnitCell (
const SBLength3 & vectorA,
const SBLength3 & vectorB,
const SBLength3 & vectorC
)
function SBDTypeUnitCell [7/7]#
Constructs a unit cell based on the matrix matrix
(triclinic vectors)
function checkTriclinicConditions [1/2]#
Returns true if the box described by the unit cell satisfies a set of triclinic box conditions.
This function returns whether the box satisfies the set of triclinic box conditions:
- the matrix should be upper-diagonal
- the diagonal elements should be positive
- the box should not be too skewed:
|b_x| > a_x/2
or|c_x| > a_x/2
or|c_y| > b_y/2
Fills in error
with a message in case if the matrix does not satisfy the triclinic conditions.
function getAngles [1/2]#
Returns the angles of the unit cell.
function getCenterOfTriclinicCell#
Returns the center of the triclinic unit cell.
function getInverseLengths#
Returns the inverse lengths of the unit cell.
function getLengths [1/2]#
Returns the lengths of the unit cell.
function getMatrix [1/2]#
Returns the matrix of the unit cell.
function getOrigin#
Returns the origin of the unit cell.
function getShapeType [1/2]#
Returns the unit cell's shape type.
function getShapeTypeString [1/2]#
Returns the name of the unit cell's shape type.
function getVolume#
Returns the volume of the unit cell.
Returns the volume of the unit cell. The volume is computed as the matrix trace product. Returns zero for infinite and undefined boxes.
function isSerializable#
Returns true.
function operator!=#
Returns true if this unit cell is not equal to unit cell unitCell
(component-wise)
function operator=#
Assignment operator.
function operator==#
Returns true if this unit cell is equal to unit cell unitCell
(component-wise)
function print#
Prints the unit cell.
function serialize#
Serializes the color.
virtual void SBDTypeUnitCell::serialize (
SBCSerializer * serializer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) const
function setOrigin#
Sets the origin of the unit cell.
function setShapeType#
Sets the unit cell's shape type to shapeType
.
function unserialize#
Unserializes the color.
virtual void SBDTypeUnitCell::unserialize (
SBCSerializer * serializer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
)
function ~SBDTypeUnitCell#
Public Static Functions Documentation#
function checkTriclinicConditions [2/2]#
Returns true if the box described by the matrix matrix
satisfies a set of triclinic box conditions.
static bool SBDTypeUnitCell::checkTriclinicConditions (
const SBMatrix33 & matrix,
std::string & error
)
This function returns whether the box described by the matrix satisfies the set of triclinic box conditions:
- the matrix should be upper-diagonal
- the diagonal elements should be positive
- the box should not be too skewed:
|b_x| > a_x/2
or|c_x| > a_x/2
or|c_y| > b_y/2
Fills in error
with a message in case if the matrix does not satisfy the triclinic conditions.
function getAngles [2/2]#
Returns box angles based on the matrix matrix
.
function getLengths [2/2]#
Returns box length based on the matrix matrix
.
function getMatrix [2/2]#
Returns box matrix based on length lengths
and anglesangles
.
static SBMatrix33 SBDTypeUnitCell::getMatrix (
const SBLength3 & lengths,
const SBVector3 & angles
)
function getShapeType [2/2]#
Returns the unit cell's shape type based on the box matrix matrix
.
function getShapeTypeString [2/2]#
Returns the name of the unit cell's shape type shapeType
.
Protected Attributes Documentation#
variable angles#
The angles, in degrees, of the unit cell between the box vectors (bc, ac, ab)
variable lengths#
The lengths of the unit cell - the box vector lengths (a, b, c)
variable matrix#
The unit cell matrix.
variable origin#
The origin of the unit cell, by default it is (0, 0, 0)
variable shapeType#
The type of the unit cell shape.