MOAB: Mesh Oriented datABase  (version 5.3.1)
torus Class Reference
+ Inheritance diagram for torus:
+ Collaboration diagram for torus:

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

Detailed Description

Definition at line 115 of file geomObject.cpp.


Constructor & Destructor Documentation

torus::torus ( double  x = 0,
double  y = 0,
double  z = 0,
double  aa = 0.3,
double  cc = 1.0 
) [inline]

Definition at line 118 of file geomObject.cpp.

        : centerx( x ), centery( y ), centerz( z ), a( aa ), c( cc )
    {
        assert( aa > 0 && cc > 0 );
    }
virtual torus::~torus ( ) [inline, virtual]

Definition at line 123 of file geomObject.cpp.

{}

Member Function Documentation

void torus::project_points2geom ( int  dim,
double *  oldcoords,
double *  newcoords,
double *  derivs 
) const [inline, virtual]

Implements geomObject.

Definition at line 124 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];
    }

Member Data Documentation

double torus::a [private]

Definition at line 151 of file geomObject.cpp.

Referenced by project_points2geom().

double torus::c [private]

Definition at line 151 of file geomObject.cpp.

Referenced by project_points2geom().

double torus::centerx [private]

Definition at line 151 of file geomObject.cpp.

Referenced by project_points2geom().

double torus::centery [private]

Definition at line 151 of file geomObject.cpp.

Referenced by project_points2geom().

double torus::centerz [private]

Definition at line 151 of file geomObject.cpp.

Referenced by project_points2geom().

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines