Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
|
#include <SuperellipseGenerator.hpp>
Public Member Functions | |
SuperellipseGenerator (unsigned numPoints=100, double ellipseExponent=1.0, double width=1.0, double height=1.0, double botLeftX=0.0, double botLeftY=0.0) | |
virtual | ~SuperellipseGenerator () |
double | GetTargetNodeSpacing () |
double | GetHeightOfTopSurface () |
const std::vector< c_vector< double, 2 > > | GetPointsAsVectors () const |
const std::vector< ChastePoint< 2 > > | GetPointsAsChastePoints () const |
Private Attributes | |
double | mTargetNodeSpacing |
double | mHeightOfTopSurface |
std::vector< c_vector< double, 2 > > | mPoints |
Class to generate roughly equally spaced points around a 2D superellipse. This shape is described by the equation (x/a)^n + (y/b)^n = 1, where n, a and b are positive numbers.
Definition at line 51 of file SuperellipseGenerator.hpp.
SuperellipseGenerator::SuperellipseGenerator | ( | unsigned | numPoints = 100 , |
double | ellipseExponent = 1.0 , |
||
double | width = 1.0 , |
||
double | height = 1.0 , |
||
double | botLeftX = 0.0 , |
||
double | botLeftY = 0.0 |
||
) |
Constructor.
Default values of the input arguments produce a circle bounded by the unit square.
numPoints | The number of points to generate around the circumference (defaults to 100) |
ellipseExponent | The exponent of the superellipse (defaults to 1) |
width | The width of the superellipse (defaults to 1) |
height | The height of the superellipse (defaults to 1) |
botLeftX | The x-coordinate of the bottom-left of the superellipse bounding box (defaults to 0) |
botLeftY | The y-coordinate of the bottom-left of the superellipse bounding box (defaults to 0) |
Definition at line 38 of file SuperellipseGenerator.cpp.
References mHeightOfTopSurface, mPoints, mTargetNodeSpacing, and NEVER_REACHED.
|
virtual |
Destructor.
Clears mPoints.
Definition at line 201 of file SuperellipseGenerator.cpp.
References mPoints.
double SuperellipseGenerator::GetHeightOfTopSurface | ( | ) |
Definition at line 211 of file SuperellipseGenerator.cpp.
References mHeightOfTopSurface.
const std::vector< ChastePoint< 2 > > SuperellipseGenerator::GetPointsAsChastePoints | ( | ) | const |
Definition at line 221 of file SuperellipseGenerator.cpp.
References mPoints.
const std::vector< c_vector< double, 2 > > SuperellipseGenerator::GetPointsAsVectors | ( | ) | const |
double SuperellipseGenerator::GetTargetNodeSpacing | ( | ) |
Definition at line 206 of file SuperellipseGenerator.cpp.
References mTargetNodeSpacing.
|
private |
The height at which the point of maximal curvature is achieved in the top right-hand corner of the superellipse.
If the superellipse exponent is 1.0 this definition does not make sense and we choose 80% of the height of the cell.
Definition at line 65 of file SuperellipseGenerator.hpp.
Referenced by SuperellipseGenerator(), and GetHeightOfTopSurface().
|
private |
Vector to store the points.
Definition at line 68 of file SuperellipseGenerator.hpp.
Referenced by SuperellipseGenerator(), ~SuperellipseGenerator(), GetPointsAsChastePoints(), and GetPointsAsVectors().
|
private |
The target spacing between points.
Definition at line 56 of file SuperellipseGenerator.hpp.
Referenced by SuperellipseGenerator(), and GetTargetNodeSpacing().