ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include <Shape.hpp>
Public Member Functions | |
virtual void | calculate_dist (const Utils::Vector3d &pos, double &dist, Utils::Vector3d &vec) const =0 |
Calculate the minimum distance and the corresponding distance vector between a given position and the shape. | |
virtual bool | is_inside (Utils::Vector3d const &pos) const |
Check whether the given point is inside the shape or not. | |
std::vector< int > | rasterize (Utils::Vector3i const &grid_size, double grid_spacing, double grid_offset) const |
Rasterize a shape on a regular grid. | |
virtual | ~Shape ()=default |
Definition at line 29 of file shapes/include/shapes/Shape.hpp.
|
virtualdefault |
|
pure virtual |
Calculate the minimum distance and the corresponding distance vector between a given position and the shape.
[in] | pos | Position for which to calculate the distance. |
[out] | dist | Minimum distance between pos and the shape. Value is negative when pos is inside the shape, zero if pos is on the shape surface or positive if pos is outside the shape. |
[out] | vec | Distance vector. |
Implemented in Shapes::NoWhere, Shapes::Cylinder, Shapes::Ellipsoid, Shapes::HollowConicalFrustum, Shapes::Rhomboid, Shapes::SimplePore, Shapes::Slitpore, Shapes::Sphere, Shapes::SpheroCylinder, Shapes::Torus, Shapes::Wall, and Shapes::Union.
Referenced by is_inside().
|
inlinevirtual |
Check whether the given point is inside the shape or not.
For the edge case where the point is on the surface (zero distance), it is considered to be inside the shape.
pos | Position to check. |
Reimplemented in Shapes::Union.
Definition at line 49 of file shapes/include/shapes/Shape.hpp.
References calculate_dist().
Referenced by rasterize().
std::vector< int > Shapes::Shape::rasterize | ( | Utils::Vector3i const & | grid_size, |
double | grid_spacing, | ||
double | grid_offset | ||
) | const |
Rasterize a shape on a regular grid.
grid_size | Number of grid points in every direction. |
grid_spacing | Lattice distance. |
grid_offset | Lattice offset. |
Definition at line 29 of file Shape.cpp.
References is_inside().