MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Public Member Functions | |
torus (double x=0, double y=0, double z=0, double aa=0.3, double cc=1.0) | |
virtual | ~torus () |
void | project_points2geom (int dim, double *oldcoords, double *newcoords, double *derivs) const |
Private Attributes | |
double | centerx |
double | centery |
double | centerz |
double | a |
double | c |
Definition at line 125 of file geomObject.cpp.
torus::torus | ( | double | x = 0 , |
double | y = 0 , |
||
double | z = 0 , |
||
double | aa = 0.3 , |
||
double | cc = 1.0 |
||
) | [inline] |
virtual torus::~torus | ( | ) | [inline, virtual] |
Definition at line 133 of file geomObject.cpp.
{}
void torus::project_points2geom | ( | int | dim, |
double * | oldcoords, | ||
double * | newcoords, | ||
double * | derivs | ||
) | const [inline, virtual] |
Implements geomObject.
Definition at line 134 of file geomObject.cpp.
References a, c, centerx, centery, centerz, and geomObject::Twonorm().
{ assert( dim == 3 && oldcoords && newcoords ); double transfer[3] = { oldcoords[0] - centerx, oldcoords[1] - centery, oldcoords[2] - centerz }; double twodnrm = geomObject::Twonorm( 2, transfer ); double tubecenter[3] = { c * transfer[0] / twodnrm + centerx, c * transfer[1] / twodnrm + centery, centerz }; double direction[3] = { oldcoords[0] - tubecenter[0], oldcoords[1] - tubecenter[1], oldcoords[2] - tubecenter[2] }; double len = geomObject::Twonorm( 3, direction ); assert( len > 0 ); direction[0] /= len; direction[1] /= len; direction[2] /= len; if( derivs ) { derivs[0] = direction[0]; derivs[1] = direction[1]; derivs[2] = direction[2]; } newcoords[0] = tubecenter[0] + a * direction[0]; newcoords[1] = tubecenter[1] + a * direction[1]; newcoords[2] = tubecenter[2] + a * direction[2]; }
double torus::a [private] |
Definition at line 161 of file geomObject.cpp.
Referenced by project_points2geom().
double torus::c [private] |
Definition at line 161 of file geomObject.cpp.
Referenced by project_points2geom().
double torus::centerx [private] |
Definition at line 161 of file geomObject.cpp.
Referenced by project_points2geom().
double torus::centery [private] |
Definition at line 161 of file geomObject.cpp.
Referenced by project_points2geom().
double torus::centerz [private] |
Definition at line 161 of file geomObject.cpp.
Referenced by project_points2geom().