Avogadro
1.1.0
|
Data type holding regularly spaced data in a cube. More...
#include <avogadro/cube.h>
Public Types | |
enum | Type { VdW, ESP, ElectronDensity, MO, FromFile, None } |
Public Member Functions | |
Cube (QObject *parent=0) | |
Eigen::Vector3d | min () const |
Eigen::Vector3d | max () const |
Eigen::Vector3d | spacing () const |
Eigen::Vector3i | dimensions () const |
bool | setLimits (const Eigen::Vector3d &min, const Eigen::Vector3d &max, const Eigen::Vector3i &points) |
bool | setLimits (const Eigen::Vector3d &min, const Eigen::Vector3d &max, double spacing) |
bool | setLimits (const Eigen::Vector3d &min, const Eigen::Vector3i &dim, double spacing) |
bool | setLimits (const Cube &cube) |
bool | setLimits (const Molecule *mol, double spacing, double padding) |
std::vector< double > * | data () |
bool | setData (const std::vector< double > &values) |
bool | addData (const std::vector< double > &values) |
unsigned int | closestIndex (const Eigen::Vector3d &pos) const |
Eigen::Vector3i | indexVector (const Eigen::Vector3d &pos) const |
Eigen::Vector3d | position (unsigned int index) const |
double | value (int i, int j, int k) const |
double | value (const Eigen::Vector3i &pos) const |
float | valuef (const Eigen::Vector3f &pos) const |
double | value (const Eigen::Vector3d &pos) const |
bool | setValue (int i, int j, int k, double value) |
bool | setValue (unsigned int i, double value) |
double | minValue () const |
double | maxValue () const |
void | setName (QString name) |
QString | name () const |
void | setCubeType (Type type) |
Type | cubeType () |
QReadWriteLock * | lock () const |
Protected Attributes | |
std::vector< double > | m_data |
Eigen::Vector3d | m_min |
Eigen::Vector3d | m_max |
Eigen::Vector3d | m_spacing |
Eigen::Vector3i | m_points |
double | m_minValue |
double | m_maxValue |
QString | m_name |
Type | m_cubeType |
QReadWriteLock * | m_lock |
Data type holding regularly spaced data in a cube.
The Cube class is a Primitive subclass that provides storage for scalar values on a regularly spaced grid in three dimensions. This is typically used for things such as molecular orbital values, which can be rendered using other techniques.
enum Avogadro::Cube::Type |
This enum allows us to iterate through the various types of primitives.
Holds the primitive type
Reimplemented from Avogadro::Primitive.
bool Avogadro::Cube::addData | ( | const std::vector< double > & | values | ) |
Adds the values in the cube to those passed in the vector.
unsigned int Avogadro::Cube::closestIndex | ( | const Eigen::Vector3d & | pos | ) | const |
pos | Position to get closest index for. |
std::vector< double > * Avogadro::Cube::data | ( | ) |
Eigen::Vector3i Avogadro::Cube::dimensions | ( | ) | const [inline] |
Referenced by Avogadro::MeshGenerator::initialize(), and Avogadro::Molecule::OBMol().
Vector3i Avogadro::Cube::indexVector | ( | const Eigen::Vector3d & | pos | ) | const |
pos | Position to get closest index for. |
QReadWriteLock * Avogadro::Cube::lock | ( | ) | const |
Provides locking.
Referenced by Avogadro::MeshGenerator::initialize(), and Avogadro::MeshGenerator::run().
Eigen::Vector3d Avogadro::Cube::max | ( | ) | const [inline] |
Referenced by setLimits().
double Avogadro::Cube::maxValue | ( | ) | const [inline] |
Eigen::Vector3d Avogadro::Cube::min | ( | ) | const [inline] |
Referenced by Avogadro::MeshGenerator::initialize(), Avogadro::Molecule::OBMol(), and setLimits().
double Avogadro::Cube::minValue | ( | ) | const [inline] |
Vector3d Avogadro::Cube::position | ( | unsigned int | index | ) | const |
index | Index to be translated to a position. |
bool Avogadro::Cube::setData | ( | const std::vector< double > & | values | ) |
Set the values in the cube to those passed in the vector.
Referenced by Avogadro::Molecule::setOBMol().
bool Avogadro::Cube::setLimits | ( | const Eigen::Vector3d & | min, |
const Eigen::Vector3d & | max, | ||
const Eigen::Vector3i & | points | ||
) |
Set the limits of the cube.
min | The minimum point in the cube. |
max | The maximum point in the cube. |
points | The number of (integer) points in the cube. |
Referenced by setLimits(), and Avogadro::Molecule::setOBMol().
bool Avogadro::Cube::setLimits | ( | const Eigen::Vector3d & | min, |
const Eigen::Vector3d & | max, | ||
double | spacing | ||
) |
Set the limits of the cube.
min | The minimum point in the cube. |
max | The maximum point in the cube. |
spacing | The interval between points in the cube. |
bool Avogadro::Cube::setLimits | ( | const Eigen::Vector3d & | min, |
const Eigen::Vector3i & | dim, | ||
double | spacing | ||
) |
Set the limits of the cube.
min | The minimum point in the cube. |
dim | The integer dimensions of the cube in x, y and z. |
spacing | The interval between points in the cube. |
bool Avogadro::Cube::setLimits | ( | const Cube & | cube | ) |
bool Avogadro::Cube::setLimits | ( | const Molecule * | mol, |
double | spacing, | ||
double | padding | ||
) |
Set the limits of the cube by the molecule supplied with padding.
mol | The molecule to use when finding bounds. |
spacing | The interval between points in the cube. |
padding | The padding to use around the extents of the molecule. |
References QList::at(), Avogadro::Molecule::atoms(), max(), min(), Avogadro::Atom::pos(), setLimits(), and QList::size().
bool Avogadro::Cube::setValue | ( | int | i, |
int | j, | ||
int | k, | ||
double | value | ||
) |
Sets the value at the specified point in the cube.
i | x compenent of the position. |
j | y compenent of the position. |
k | z compenent of the position. |
value | Value at the specified position. |
References Avogadro::Primitive::index(), and value().
bool Avogadro::Cube::setValue | ( | unsigned int | i, |
double | value | ||
) | [inline] |
Sets the value at the specified index in the cube.
i | 1-dimenional index of the point to set in the cube. |
References value().
Eigen::Vector3d Avogadro::Cube::spacing | ( | ) | const [inline] |
Referenced by Avogadro::MeshGenerator::initialize(), and Avogadro::Molecule::OBMol().
double Avogadro::Cube::value | ( | int | i, |
int | j, | ||
int | k | ||
) | const |
This function is very quick as it just returns the value at the point.
References Avogadro::Primitive::index().
Referenced by Avogadro::MeshGenerator::marchingCube(), setValue(), and valuef().
double Avogadro::Cube::value | ( | const Eigen::Vector3i & | pos | ) | const |
This function is very quick as it just returns the value at the point.
double Avogadro::Cube::value | ( | const Eigen::Vector3d & | pos | ) | const |
This function uses trilinear interpolation to find the value at points between those specified in the cube.
float Avogadro::Cube::valuef | ( | const Eigen::Vector3f & | pos | ) | const |
This function uses trilinear interpolation to find the value at points between those specified in the cube.
References value().
Referenced by Avogadro::MeshGenerator::normal().